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.

37 lines
651 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. print_Schachfeld(brett,8,8);
  20. TEST_ASSERT_EQUAL('P', brett[2][0]);
  21. TEST_ASSERT_EQUAL(' ', brett[1][0]);
  22. for (int i = 0; i < 8; i++) {
  23. free(brett[i]);
  24. }
  25. free(brett);
  26. }
  27. #endif // TEST