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.

38 lines
682 B

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