Browse Source

Turm else eingebaut, Luis Hahn

remotes/origin/Luis-Branch
Luis Hahn 11 months ago
parent
commit
25e6cc69a0
  1. 2
      src/Turm.c
  2. 27
      test/test_Turm.c

2
src/Turm.c

@ -48,6 +48,8 @@ int counter = 0;
return true; return true;
} }
}else{
return false;
} }

27
test/test_Turm.c

@ -38,6 +38,8 @@ void test_Turm_Y_Bewegung(void) {
free(brett); free(brett);
} }
void test_Turm_X_Bewegung(void) { void test_Turm_X_Bewegung(void) {
char** brett = Schachbrett_erstellen(); char** brett = Schachbrett_erstellen();
@ -88,6 +90,31 @@ void test_Turm_negative_Y_Bewegung(void) {
free(brett); free(brett);
} }
void test_Turm_Falsche_Bewegung(void) {
char** brett = Schachbrett_erstellen();
int startX = 0;
int startY = 0;
int endX = 1;
int endY = 3;
Player player = PLAYER_WHITE;
TEST_ASSERT_NOT_NULL(brett);
print_Schachfeld(brett);
TEST_ASSERT_FALSE(istzugerlaubt_Turm( brett, startX, startY, endX, endY, player));
for (int i = 0; i < 8; i++) {
free(brett[i]);
}
free(brett);
}
#endif // TEST #endif // TEST

Loading…
Cancel
Save