Browse Source

Zwanzigster Unit Test

main
fdai7172 2 years ago
parent
commit
b11c33ae46
  1. 50
      build/test/cache/test_Modules.c
  2. BIN
      build/test/out/c/test_Modules.o
  3. BIN
      build/test/out/c/test_Modules_runner.o
  4. BIN
      build/test/out/test_Modules.out
  5. 50
      build/test/preprocess/files/test_Modules.c
  6. 43
      build/test/results/test_Modules.pass
  7. 4
      build/test/runners/test_Modules_runner.c
  8. 23
      test/test_Modules.c

50
build/test/cache/test_Modules.c

@ -714,7 +714,9 @@ void test_generateField_check_if_third_live_is_displayed_correctly(void)
void test_generateField_check_if_wind_form_right_correct_displayed(void){
void test_generateField_check_if_wind_form_right_correct_displayed(void)
{
@ -744,13 +746,15 @@ void test_generateField_check_if_wind_form_right_correct_displayed(void){
((void *)0) ((void *)0)
), (UNITY_UINT)(340), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(341), UNITY_DISPLAY_STYLE_INT);
} }
void test_generateField_check_if_wind_form_left_correct_displayed(void){
void test_generateField_check_if_wind_form_left_correct_displayed(void)
{
@ -780,6 +784,44 @@ void test_generateField_check_if_wind_form_left_correct_displayed(void){
((void *)0) ((void *)0)
), (UNITY_UINT)(356), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(358), UNITY_DISPLAY_STYLE_INT);
}
void test_generateField_check_if_wind_force_correct_displayed(void)
{
int output = 1;
windForce = 3;
generateField();
if (field[20][1] == '3')
{
output = 0;
}
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((output)), (
((void *)0)
), (UNITY_UINT)(375), UNITY_DISPLAY_STYLE_INT);
} }

BIN
build/test/out/c/test_Modules.o

BIN
build/test/out/c/test_Modules_runner.o

BIN
build/test/out/test_Modules.out

50
build/test/preprocess/files/test_Modules.c

@ -714,7 +714,9 @@ void test_generateField_check_if_third_live_is_displayed_correctly(void)
void test_generateField_check_if_wind_form_right_correct_displayed(void){
void test_generateField_check_if_wind_form_right_correct_displayed(void)
{
@ -744,13 +746,15 @@ void test_generateField_check_if_wind_form_right_correct_displayed(void){
((void *)0) ((void *)0)
), (UNITY_UINT)(340), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(341), UNITY_DISPLAY_STYLE_INT);
} }
void test_generateField_check_if_wind_form_left_correct_displayed(void){
void test_generateField_check_if_wind_form_left_correct_displayed(void)
{
@ -780,6 +784,44 @@ void test_generateField_check_if_wind_form_left_correct_displayed(void){
((void *)0) ((void *)0)
), (UNITY_UINT)(356), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(358), UNITY_DISPLAY_STYLE_INT);
}
void test_generateField_check_if_wind_force_correct_displayed(void)
{
int output = 1;
windForce = 3;
generateField();
if (field[20][1] == '3')
{
output = 0;
}
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((output)), (
((void *)0)
), (UNITY_UINT)(375), UNITY_DISPLAY_STYLE_INT);
} }

43
build/test/results/test_Modules.pass

@ -76,14 +76,18 @@
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_generateField_check_if_wind_form_left_correct_displayed - :test: test_generateField_check_if_wind_form_left_correct_displayed
:line: 343
:line: 344
:message: ''
:unity_test_time: 0
- :test: test_generateField_check_if_wind_force_correct_displayed
:line: 361
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 19
:passed: 19
:total: 20
:passed: 20
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: :stdout:
@ -365,7 +369,7 @@
- "| |" - "| |"
- "| |" - "| |"
- "| V |" - "| 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 / \\ |"
- "| / \\ |" - "| / \\ |"
- "| |" - "| |"
- "| |" - "| |"
@ -470,4 +474,33 @@
- "| |" - "| |"
- "| |" - "| |"
- "|=======================|" - "|=======================|"
:time: 0.014473204000751139
- "|=======================|"
- "| OXX 000 >3 |"
- "|=======================|"
- "| \\ |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| V |"
- "| / \\ |"
- "| / \\ |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "|=======================|"
:time: 0.010942392999822914

4
build/test/runners/test_Modules_runner.c

@ -29,6 +29,7 @@ extern void test_generateField_check_if_second_live_is_displayed_correctly(void)
extern void test_generateField_check_if_third_live_is_displayed_correctly(void); 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_right_correct_displayed(void);
extern void test_generateField_check_if_wind_form_left_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);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -111,7 +112,8 @@ int main(void)
run_test(test_generateField_check_if_second_live_is_displayed_correctly, "test_generateField_check_if_second_live_is_displayed_correctly", 293); run_test(test_generateField_check_if_second_live_is_displayed_correctly, "test_generateField_check_if_second_live_is_displayed_correctly", 293);
run_test(test_generateField_check_if_third_live_is_displayed_correctly, "test_generateField_check_if_third_live_is_displayed_correctly", 310); run_test(test_generateField_check_if_third_live_is_displayed_correctly, "test_generateField_check_if_third_live_is_displayed_correctly", 310);
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_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", 343);
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);
return UnityEnd(); return UnityEnd();
} }

23
test/test_Modules.c

@ -324,7 +324,8 @@ void test_generateField_check_if_third_live_is_displayed_correctly(void)
TEST_ASSERT_EQUAL(0, output); TEST_ASSERT_EQUAL(0, output);
} }
void test_generateField_check_if_wind_form_right_correct_displayed(void){
void test_generateField_check_if_wind_form_right_correct_displayed(void)
{
/* arrange */ /* arrange */
int output = 1; int output = 1;
windForce = -2; windForce = -2;
@ -340,7 +341,8 @@ void test_generateField_check_if_wind_form_right_correct_displayed(void){
TEST_ASSERT_EQUAL(0, output); TEST_ASSERT_EQUAL(0, output);
} }
void test_generateField_check_if_wind_form_left_correct_displayed(void){
void test_generateField_check_if_wind_form_left_correct_displayed(void)
{
/* arrange */ /* arrange */
int output = 1; int output = 1;
windForce = 2; windForce = 2;
@ -356,4 +358,21 @@ void test_generateField_check_if_wind_form_left_correct_displayed(void){
TEST_ASSERT_EQUAL(0, output); TEST_ASSERT_EQUAL(0, output);
} }
void test_generateField_check_if_wind_force_correct_displayed(void)
{
/* arrange */
int output = 1;
windForce = 3;
/* act */
generateField();
if (field[20][1] == '3')
{
output = 0;
}
/* assert */
TEST_ASSERT_EQUAL(0, output);
}
#endif // TEST #endif // TEST
Loading…
Cancel
Save