diff --git a/build/test/cache/test_Modules.c b/build/test/cache/test_Modules.c index f5a124c..7a2a7bb 100644 --- a/build/test/cache/test_Modules.c +++ b/build/test/cache/test_Modules.c @@ -825,3 +825,59 @@ void test_generateField_check_if_wind_force_correct_displayed(void) ), (UNITY_UINT)(375), UNITY_DISPLAY_STYLE_INT); } + + + +void test_generateField_check_if_wall_is_build_correctly(void) + +{ + + + + windForce = 2; + + binX = 16; + + binY = 12; + + wallX = 5; + + wallY = 7; + + wallLength = 5; + + int output = 0; + + + + + + generateField(); + + + + for (int i = wallX; i < +wallX + wallLength; i++) + + { + + if (field[i][wallY] != '_') + + { + + output = 1; + + } + + } + + + + + + UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((output)), ( + + ((void *)0) + + ), (UNITY_UINT)(401), UNITY_DISPLAY_STYLE_INT); + +} diff --git a/build/test/out/c/test_Modules.o b/build/test/out/c/test_Modules.o index 69e79d7..aafa12f 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 f3fb282..7532af2 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 0330f8a..c8ca841 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 f5a124c..7a2a7bb 100644 --- a/build/test/preprocess/files/test_Modules.c +++ b/build/test/preprocess/files/test_Modules.c @@ -825,3 +825,59 @@ void test_generateField_check_if_wind_force_correct_displayed(void) ), (UNITY_UINT)(375), UNITY_DISPLAY_STYLE_INT); } + + + +void test_generateField_check_if_wall_is_build_correctly(void) + +{ + + + + windForce = 2; + + binX = 16; + + binY = 12; + + wallX = 5; + + wallY = 7; + + wallLength = 5; + + int output = 0; + + + + + + generateField(); + + + + for (int i = wallX; i < +wallX + wallLength; i++) + + { + + if (field[i][wallY] != '_') + + { + + output = 1; + + } + + } + + + + + + UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((output)), ( + + ((void *)0) + + ), (UNITY_UINT)(401), UNITY_DISPLAY_STYLE_INT); + +} diff --git a/build/test/results/test_Modules.pass b/build/test/results/test_Modules.pass index f802433..7c36e8d 100644 --- a/build/test/results/test_Modules.pass +++ b/build/test/results/test_Modules.pass @@ -83,11 +83,15 @@ :line: 361 :message: '' :unity_test_time: 0 +- :test: test_generateField_check_if_wall_is_build_correctly + :line: 378 + :message: '' + :unity_test_time: 0 :failures: [] :ignores: [] :counts: - :total: 20 - :passed: 20 + :total: 21 + :passed: 21 :failed: 0 :ignored: 0 :stdout: @@ -369,7 +373,8 @@ - "| |" - "| |" - "| 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\e[H\e[2J\e[3J\e[H\e[2J\e[3J / + \\ |" - "| / \\ |" - "| |" - "| |" @@ -503,4 +508,33 @@ - "| |" - "| |" - "|=======================|" -:time: 0.010942392999822914 +- "|=======================|" +- "| OXX 000 >2 |" +- "|=======================|" +- "| \\ |" +- "| |" +- "| |" +- "| |" +- "| _____ |" +- "| |" +- "| |" +- "| V |" +- "| / \\ |" +- "| / \\ V |" +- "| / \\ |" +- "| / \\ |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "| |" +- "|=======================|" +:time: 0.020374785000058182 diff --git a/build/test/runners/test_Modules_runner.c b/build/test/runners/test_Modules_runner.c index 4d327bc..cf7e9b5 100644 --- a/build/test/runners/test_Modules_runner.c +++ b/build/test/runners/test_Modules_runner.c @@ -30,6 +30,7 @@ extern void test_generateField_check_if_third_live_is_displayed_correctly(void); extern void test_generateField_check_if_wind_form_right_correct_displayed(void); extern void test_generateField_check_if_wind_form_left_correct_displayed(void); extern void test_generateField_check_if_wind_force_correct_displayed(void); +extern void test_generateField_check_if_wall_is_build_correctly(void); /*=======Mock Management=====*/ @@ -114,6 +115,7 @@ int main(void) run_test(test_generateField_check_if_wind_form_right_correct_displayed, "test_generateField_check_if_wind_form_right_correct_displayed", 327); run_test(test_generateField_check_if_wind_form_left_correct_displayed, "test_generateField_check_if_wind_form_left_correct_displayed", 344); run_test(test_generateField_check_if_wind_force_correct_displayed, "test_generateField_check_if_wind_force_correct_displayed", 361); + run_test(test_generateField_check_if_wall_is_build_correctly, "test_generateField_check_if_wall_is_build_correctly", 378); return UnityEnd(); } diff --git a/test/test_Modules.c b/test/test_Modules.c index ddb16bb..a0a7252 100644 --- a/test/test_Modules.c +++ b/test/test_Modules.c @@ -375,4 +375,30 @@ void test_generateField_check_if_wind_force_correct_displayed(void) TEST_ASSERT_EQUAL(0, output); } +void test_generateField_check_if_wall_is_build_correctly(void) +{ + /* arrange */ + windForce = 2; + binX = 16; + binY = 12; + wallX = 5; + wallY = 7; + wallLength = 5; + int output = 0; + + /* act */ + generateField(); + + for (int i = wallX; i < +wallX + wallLength; i++) + { + if (field[i][wallY] != '_') + { + output = 1; + } + } + + /* assert */ + TEST_ASSERT_EQUAL(0, output); +} + #endif // TEST \ No newline at end of file