From 5346edab16732f285942d78737d38d781f6a9dd8 Mon Sep 17 00:00:00 2001 From: Emman Mensdorf Date: Thu, 8 Feb 2024 16:02:06 +0100 Subject: [PATCH] test test_SimpleKI.c KI Bewegung, Emman Mensdorf --- test/test_SimpleKI.c | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/test/test_SimpleKI.c b/test/test_SimpleKI.c index 72f0c30..6ed05f0 100644 --- a/test/test_SimpleKI.c +++ b/test/test_SimpleKI.c @@ -1,21 +1,41 @@ #ifdef TEST #include "unity.h" #include "Schachbrett.h" -#include "Moving.h" #include "Spieler.h" -#include "Turm.h" #include "Bauer.h" -#include "Koenig.h" -#include "Springer.h" -#include "Dame.h" +#include "Turm.h" #include "Laeufer.h" +#include "Dame.h" +#include "Springer.h" +#include "Koenig.h" +#include "Moving.h" +#include "SimpleKI.h" #include -void setUp(void) { -} -void tearDown(void) { +void test_KI_Bewegung (void) { + + char** brett = Schachbrett_erstellen(); + char** ver_brett = Schachbrett_erstellen(); + int startX = 1; + int startY = 1; + int endX = 2; + int endY = 1; + Player player = PLAYER_BLACK; + + + TEST_ASSERT_NOT_NULL(brett); + + kuenstliche_intelligenz(brett, player); + + TEST_ASSERT_FALSE(brett == ver_brett); + + + for (int i = 0; i < 8; i++) { + free(brett[i]); + } + free(brett); } -#endif // TEST +#endif // TEST \ No newline at end of file