From 44ab4924e83f79f7e16e90a8acb2f0908e67ad43 Mon Sep 17 00:00:00 2001 From: Luis Hahn Date: Sat, 3 Feb 2024 16:32:39 +0100 Subject: [PATCH] Turm Y Bewegung, Luis Hahn --- src/Turm.c | 13 +++++++++++++ test/test_Turm.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 test/test_Turm.c diff --git a/src/Turm.c b/src/Turm.c index 8859c96..329ed18 100644 --- a/src/Turm.c +++ b/src/Turm.c @@ -7,6 +7,19 @@ bool istzugerlaubt_Turm(char** Brett, int startX, int startY, int endX, int endY, Player player) { +int counter = 0; + + if(startX == startY){ + counter = endY-startY; + for(int i = 0; i + +void setUp(void) { +} + +void tearDown(void) { +} + +void test_Turm_Y_Bewegung(void) { + + char** brett = Schachbrett_erstellen(); + int startX = 0; + int startY = 0; + int endX = 0; + int endY = 3; + Player player = PLAYER_WHITE; + + + TEST_ASSERT_NOT_NULL(brett); + + brett[1][0] = ' '; + print_Schachfeld(brett); + + + TEST_ASSERT_FALSE(istzugerlaubt_Turm( brett, startX, startY, endX, endY, player)); + + + for (int i = 0; i < 8; i++) { + free(brett[i]); + } + free(brett); +} + + + +#endif // TEST + + + + + + +