From ec18d803eed3658ec245eb3a6ef97760a2f32caf Mon Sep 17 00:00:00 2001 From: Emman Mensdorf Date: Mon, 5 Feb 2024 22:17:32 +0100 Subject: [PATCH] Dame test horizontal bewegung, Emman Mensdorf --- test/test_Dame.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/test/test_Dame.c b/test/test_Dame.c index 4ae6e4b..73ae442 100644 --- a/test/test_Dame.c +++ b/test/test_Dame.c @@ -105,6 +105,56 @@ void test_Dame_vertikal_Rechts_Bewegung(void) { free(brett); } +void test_Dame_Diagonal_negative_X_Y_Bewegung(void) { + + char** brett = Schachbrett_erstellen(); + int startX = 3; + int startY = 4; + int endX = 1; + int endY = 2; + Player player = PLAYER_WHITE; + + + TEST_ASSERT_NOT_NULL(brett); + + brett[4][3] = 'Q'; + print_Schachfeld(brett); + + + TEST_ASSERT_TRUE(istzugerlaubt_Dame( brett, startX, startY, endX, endY, player)); + + + for (int i = 0; i < 8; i++) { + free(brett[i]); + } + free(brett); +} + +void test_Dame_Diagonal_positive_X_Y_Bewegung(void) { + + char** brett = Schachbrett_erstellen(); + int startX = 4; + int startY = 3; + int endX = 5; + int endY = 4; + Player player = PLAYER_WHITE; + + + TEST_ASSERT_NOT_NULL(brett); + + brett[3][4] = 'Q'; + print_Schachfeld(brett); + + + TEST_ASSERT_TRUE(istzugerlaubt_Dame( brett, startX, startY, endX, endY, player)); + + + for (int i = 0; i < 8; i++) { + free(brett[i]); + } + free(brett); +} + void test_Dame_Falsche_Bewegung(void) { char** brett = Schachbrett_erstellen();