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
663 B

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