diff --git a/build/test/cache/test_Modules.c b/build/test/cache/test_Modules.c index d40518e..1b86fea 100644 --- a/build/test/cache/test_Modules.c +++ b/build/test/cache/test_Modules.c @@ -597,3 +597,41 @@ void test_generateField_negative_points_not_possible(void){ ), (UNITY_UINT)(273), UNITY_DISPLAY_STYLE_INT); } + + + +void test_generateField_check_if_first_live_is_displayed_correctly(void) + +{ + + + + int output = 1; + + lifeCount = 3; + + + + + + generateField(); + + + + if (field[3][1] == 'O') + + { + + output = 0; + + } + + + + UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((output)), ( + + ((void *)0) + + ), (UNITY_UINT)(290), UNITY_DISPLAY_STYLE_INT); + +} diff --git a/build/test/out/c/test_Modules.o b/build/test/out/c/test_Modules.o index 104a301..1eb4bfa 100644 Binary files a/build/test/out/c/test_Modules.o and b/build/test/out/c/test_Modules.o differ diff --git a/build/test/out/c/test_Modules_runner.o b/build/test/out/c/test_Modules_runner.o index 40aeb33..debf0f0 100644 Binary files a/build/test/out/c/test_Modules_runner.o and b/build/test/out/c/test_Modules_runner.o differ diff --git a/build/test/out/test_Modules.out b/build/test/out/test_Modules.out index 66296ec..19bf06b 100755 Binary files a/build/test/out/test_Modules.out and b/build/test/out/test_Modules.out differ diff --git a/build/test/preprocess/files/test_Modules.c b/build/test/preprocess/files/test_Modules.c index d40518e..1b86fea 100644 --- a/build/test/preprocess/files/test_Modules.c +++ b/build/test/preprocess/files/test_Modules.c @@ -597,3 +597,41 @@ void test_generateField_negative_points_not_possible(void){ ), (UNITY_UINT)(273), UNITY_DISPLAY_STYLE_INT); } + + + +void test_generateField_check_if_first_live_is_displayed_correctly(void) + +{ + + + + int output = 1; + + lifeCount = 3; + + + + + + generateField(); + + + + if (field[3][1] == 'O') + + { + + output = 0; + + } + + + + UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((output)), ( + + ((void *)0) + + ), (UNITY_UINT)(290), UNITY_DISPLAY_STYLE_INT); + +} diff --git a/build/test/results/test_Modules.pass b/build/test/results/test_Modules.pass index a9771ad..b07207a 100644 --- a/build/test/results/test_Modules.pass +++ b/build/test/results/test_Modules.pass @@ -59,11 +59,15 @@ :line: 264 :message: '' :unity_test_time: 0 +- :test: test_generateField_check_if_first_live_is_displayed_correctly + :line: 276 + :message: '' + :unity_test_time: 0 :failures: [] :ignores: [] :counts: - :total: 14 - :passed: 14 + :total: 15 + :passed: 15 :failed: 0 :ignored: 0 :stdout: @@ -200,7 +204,7 @@ - "| |" - "| V |" - "| / \\ |" -- "| / \\ \e[H\e[2J\e[3J\e[H\e[2J\e[3J\e[H\e[2J\e[3J |" +- "| / \\ \e[H\e[2J\e[3J\e[H\e[2J\e[3J\e[H\e[2J\e[3J\e[H\e[2J\e[3J |" - "| |" - "| |" - "| |" @@ -304,4 +308,33 @@ - "| |" - "| |" - "|=======================|" -:time: 0.008977019999747426 +- "|=======================|" +- "| OOO 000 |" +- "|=======================|" +- "| \\ |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| V |" +- "| / \\ |" +- "| / \\ |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "|=======================|" +:time: 0.011396616999263642 diff --git a/build/test/runners/test_Modules_runner.c b/build/test/runners/test_Modules_runner.c index f59f01e..0b67427 100644 --- a/build/test/runners/test_Modules_runner.c +++ b/build/test/runners/test_Modules_runner.c @@ -24,6 +24,7 @@ extern void test_generateField_check_if_first_life_away(void); extern void test_generateField_check_if_second_life_away(void); extern void test_generateField_check_if_third_life_away(void); extern void test_generateField_negative_points_not_possible(void); +extern void test_generateField_check_if_first_live_is_displayed_correctly(void); /*=======Mock Management=====*/ @@ -102,6 +103,7 @@ int main(void) run_test(test_generateField_check_if_second_life_away, "test_generateField_check_if_second_life_away", 230); run_test(test_generateField_check_if_third_life_away, "test_generateField_check_if_third_life_away", 247); run_test(test_generateField_negative_points_not_possible, "test_generateField_negative_points_not_possible", 264); + run_test(test_generateField_check_if_first_live_is_displayed_correctly, "test_generateField_check_if_first_live_is_displayed_correctly", 276); return UnityEnd(); } diff --git a/test/test_Modules.c b/test/test_Modules.c index fab5ced..531513f 100644 --- a/test/test_Modules.c +++ b/test/test_Modules.c @@ -273,4 +273,21 @@ void test_generateField_negative_points_not_possible(void){ TEST_ASSERT_EQUAL(0, output); } +void test_generateField_check_if_first_live_is_displayed_correctly(void) +{ + /* arrange */ + int output = 1; + lifeCount = 3; + + /* act */ + generateField(); + + if (field[3][1] == 'O') + { + output = 0; + } + /* assert */ + TEST_ASSERT_EQUAL(0, output); +} + #endif // TEST \ No newline at end of file