|
@ -103,4 +103,20 @@ void test_KoenigKannEntkommen(void) { |
|
|
TEST_ASSERT_TRUE(KannKoenigEntkommen(testBrett, 4, 4, PLAYER_BLACK)); |
|
|
TEST_ASSERT_TRUE(KannKoenigEntkommen(testBrett, 4, 4, PLAYER_BLACK)); |
|
|
TEST_ASSERT_FALSE(KannKoenigEntkommen(testBrett, 4, 7, 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 |
|
|
#endif // TEST |