You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
617 B

  1. #ifdef TEST
  2. #include "unity.h"
  3. #include "Schachbrett.h"
  4. #include "Moving.h"
  5. #include "Spieler.h"
  6. void setUp(void) {
  7. }
  8. void tearDown(void) {
  9. }
  10. void test_Bauern_bewegen(void) {
  11. char** brett = Schachbrett_erstellen();
  12. int startX = 0;
  13. int startY = 1;
  14. int endX = 0;
  15. int endY = 2;
  16. Player player = PLAYER_WHITE;
  17. TEST_ASSERT_NOT_NULL(brett);
  18. machezug( brett, startX, startY, endX, endY, player);
  19. TEST_ASSERT_EQUAL('P', brett[0][2]);
  20. TEST_ASSERT_EQUAL(' ', brett[0][1]);
  21. for (int i = 0; i < 8; i++) {
  22. free(brett[i]);
  23. }
  24. free(brett);
  25. }
  26. #endif // TEST