From 5e43b25604433988fff84f7670e38fd07ce05b60 Mon Sep 17 00:00:00 2001 From: fdai7492 Date: Tue, 6 Feb 2024 05:35:20 +0000 Subject: [PATCH] istschachmatt Test, Anton Lohrey --- test/test_Koenig.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/test_Koenig.c b/test/test_Koenig.c index 6696839..a0ae758 100644 --- a/test/test_Koenig.c +++ b/test/test_Koenig.c @@ -103,4 +103,20 @@ void test_KoenigKannEntkommen(void) { TEST_ASSERT_TRUE(KannKoenigEntkommen(testBrett, 4, 4, PLAYER_BLACK)); TEST_ASSERT_FALSE(KannKoenigEntkommen(testBrett, 4, 7, PLAYER_BLACK)); } +void test_KingInCheckmate(void) { + char** testBrett = Schachbrett_erstellen(); + testBrett[4][4] = 'K'; + + TEST_ASSERT_FALSE(istSchachmatt(testBrett, 4, 4 ,PLAYER_WHITE)); + testBrett[4][0] = 'q'; + testBrett[5][0] = 'q'; + TEST_ASSERT_FALSE(istSchachmatt(testBrett, 4, 4 ,PLAYER_WHITE)); + testBrett[3][0] = 'q'; + testBrett[3][7] = 'q'; + testBrett[4][7] = 'q'; + testBrett[5][7] = 'q'; + testBrett[7][4] = ' '; + print_Schachfeld(testBrett); + TEST_ASSERT_TRUE(istSchachmatt(testBrett, 4, 4 ,PLAYER_WHITE)); +} #endif // TEST