|
|
@ -162,5 +162,34 @@ void test_GreiftKoenigAn(void) { |
|
|
|
|
|
|
|
freeTestBrett(Brett); |
|
|
|
} |
|
|
|
void test_istFeldUnsicher(void) { |
|
|
|
char** Brett = ErstelleTestBrett(); |
|
|
|
Brett[4][4] = 'p'; |
|
|
|
print_Schachfeld(Brett); |
|
|
|
TEST_ASSERT_TRUE(istFeldUnsicher(Brett, 5, 3, player)); |
|
|
|
TEST_ASSERT_FALSE(istFeldUnsicher(Brett, 0, 0, player)); |
|
|
|
|
|
|
|
Brett[4][4] = ' '; |
|
|
|
Brett[0][1] = 'N'; |
|
|
|
player = PLAYER_BLACK; |
|
|
|
|
|
|
|
TEST_ASSERT_TRUE(istFeldUnsicher(Brett, 2, 2, player)); |
|
|
|
TEST_ASSERT_FALSE(istFeldUnsicher(Brett, 0, 0, player)); |
|
|
|
|
|
|
|
Brett[0][1] = ' '; |
|
|
|
Brett[7][0] = 'r'; |
|
|
|
player = PLAYER_WHITE; |
|
|
|
|
|
|
|
TEST_ASSERT_TRUE(istFeldUnsicher(Brett, 0, 0, player)); |
|
|
|
TEST_ASSERT_FALSE(istFeldUnsicher(Brett, 4, 4, player)); |
|
|
|
|
|
|
|
Brett[7][0] = ' '; |
|
|
|
Brett[3][3] = 'Q'; |
|
|
|
player = PLAYER_BLACK; |
|
|
|
TEST_ASSERT_TRUE(istFeldUnsicher(Brett, 7, 7, player)); |
|
|
|
TEST_ASSERT_TRUE(istFeldUnsicher(Brett, 3, 0, player)); |
|
|
|
|
|
|
|
freeTestBrett(Brett); |
|
|
|
} |
|
|
|
#endif // TEST |
|
|
|
|