diff --git a/Startcode/unit_tests.c b/Startcode/unit_tests.c index 34b07ed..5846d73 100644 --- a/Startcode/unit_tests.c +++ b/Startcode/unit_tests.c @@ -93,10 +93,12 @@ void test_createWordSalad_too_small(void) { TEST_ASSERT_LESS_OR_EQUAL(2, placed); // Feld muss vollständig gefüllt sein - for (int i = 0; i < 5; i++) { - for (int j = 0; j < 5; j++) { - TEST_ASSERT_GREATER_OR_EQUAL('A', salad[i][j]); - TEST_ASSERT_LESS_OR_EQUAL('Z', salad[i][j]); + if (placed >= 1){ + for (int i = 0; i < 5; i++) { + for (int j = 0; j < 5; j++) { + TEST_ASSERT_GREATER_OR_EQUAL('A', salad[i][j]); + TEST_ASSERT_LESS_OR_EQUAL('Z', salad[i][j]); + } } } }