From ee2db90393f083de9f912c72c778a588ed389347 Mon Sep 17 00:00:00 2001 From: Emman Mensdorf Date: Mon, 5 Feb 2024 21:24:24 +0100 Subject: [PATCH] Dame test falsche bewegung, Emman Mensdorf --- test/test_Dame.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/test_Dame.c diff --git a/test/test_Dame.c b/test/test_Dame.c new file mode 100644 index 0000000..cdd6abc --- /dev/null +++ b/test/test_Dame.c @@ -0,0 +1,34 @@ +#ifdef TEST +#include "unity.h" +#include "Schachbrett.h" +#include "Spieler.h" +#include "Dame.h" +#include + + +void test_Dame_Falsche_Bewegung(void) { + + char** brett = Schachbrett_erstellen(); + int startX = 3; + int startY = 0; + int endX = 3; + int endY = 4; + Player player = PLAYER_WHITE; + + + TEST_ASSERT_NOT_NULL(brett); + + + print_Schachfeld(brett); + + + TEST_ASSERT_FALSE(istzugerlaubt_Dame( brett, startX, startY, endX, endY, player)); + + + for (int i = 0; i < 8; i++) { + free(brett[i]); + } + free(brett); +} + +#endif // TEST \ No newline at end of file