|
@ -41,7 +41,7 @@ void test_En_Passaut_Weiss(void) { |
|
|
anzahl_Zuege++; |
|
|
anzahl_Zuege++; |
|
|
startX = 2; |
|
|
startX = 2; |
|
|
startY = 4; |
|
|
startY = 4; |
|
|
endX = 2; |
|
|
|
|
|
|
|
|
endX = 1; |
|
|
endY = 5; |
|
|
endY = 5; |
|
|
currentPlayer = PLAYER_WHITE; |
|
|
currentPlayer = PLAYER_WHITE; |
|
|
|
|
|
|
|
@ -61,5 +61,53 @@ void test_En_Passaut_Weiss(void) { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_En_Passaut_Schwarz(void) { |
|
|
|
|
|
|
|
|
|
|
|
int MAX_ZUEGE = 70; |
|
|
|
|
|
int ZUG_INFO = 5; |
|
|
|
|
|
|
|
|
|
|
|
// Historie erstellen |
|
|
|
|
|
int** meineHistorie = erstellen_historie(); |
|
|
|
|
|
|
|
|
|
|
|
// Testdaten |
|
|
|
|
|
int startX = 1; |
|
|
|
|
|
int startY = 1; |
|
|
|
|
|
int endX = 1; |
|
|
|
|
|
int endY = 3; |
|
|
|
|
|
Player currentPlayer = PLAYER_WHITE; |
|
|
|
|
|
int anzahl_Zuege = 0; |
|
|
|
|
|
|
|
|
|
|
|
// Züge zur Historie hinzufügen |
|
|
|
|
|
hinzufuegen_historie(meineHistorie, startX, startY, endX, endY, currentPlayer, anzahl_Zuege); |
|
|
|
|
|
|
|
|
|
|
|
char** brett = Schachbrett_erstellen(); |
|
|
|
|
|
clear_Schachbrett(brett); |
|
|
|
|
|
|
|
|
|
|
|
TEST_ASSERT_NOT_NULL(brett); |
|
|
|
|
|
|
|
|
|
|
|
brett[endY][endX] = 'P'; |
|
|
|
|
|
anzahl_Zuege++; |
|
|
|
|
|
startX = 2; |
|
|
|
|
|
startY = 3; |
|
|
|
|
|
endX = 1; |
|
|
|
|
|
endY = 2; |
|
|
|
|
|
currentPlayer = PLAYER_BLACK; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST_ASSERT_TRUE(ist_En_Passaut_erlaubt_Bauer(brett,startX,startY,endX,endY,currentPlayer,anzahl_Zuege,meineHistorie)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 8; i++) { |
|
|
|
|
|
free(brett[i]); |
|
|
|
|
|
} |
|
|
|
|
|
free(brett); |
|
|
|
|
|
|
|
|
|
|
|
// Speicher freigeben |
|
|
|
|
|
for (int i = 0; i < MAX_ZUEGE; i++) { |
|
|
|
|
|
free(meineHistorie[i]); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // TEST |
|
|
#endif // TEST |