Browse Source

Zweiundzwanzigster Unit Test

main cloned-at-2023-02-11
fdai7103 2 years ago
parent
commit
fc172eb180
  1. 46
      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. 46
      build/test/preprocess/files/test_Modules.c
  6. 41
      build/test/results/test_Modules.pass
  7. 4
      build/test/runners/test_Modules_runner.c
  8. 19
      test/test_Modules.c

46
build/test/cache/test_Modules.c

@ -796,6 +796,8 @@ void test_generateField_check_if_wind_force_correct_displayed(void)
int output = 1; int output = 1;
windForce = 3; windForce = 3;
@ -822,7 +824,47 @@ void test_generateField_check_if_wind_force_correct_displayed(void)
((void *)0) ((void *)0)
), (UNITY_UINT)(375), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(376), UNITY_DISPLAY_STYLE_INT);
}
void test_generateField_check_if_wind_only_displayed_if_wind_enabled(void)
{
int output = 0;
windForce = 0;
lvlNumber = 7;
generateField();
if (field[19][1] != '<' && field[19][1] != '>')
{
output = 1;
}
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((output)), (
((void *)0)
), (UNITY_UINT)(394), UNITY_DISPLAY_STYLE_INT);
} }
@ -878,6 +920,6 @@ void test_generateField_check_if_wall_is_build_correctly(void)
((void *)0) ((void *)0)
), (UNITY_UINT)(401), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(420), 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

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

@ -796,6 +796,8 @@ void test_generateField_check_if_wind_force_correct_displayed(void)
int output = 1; int output = 1;
windForce = 3; windForce = 3;
@ -822,7 +824,47 @@ void test_generateField_check_if_wind_force_correct_displayed(void)
((void *)0) ((void *)0)
), (UNITY_UINT)(375), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(376), UNITY_DISPLAY_STYLE_INT);
}
void test_generateField_check_if_wind_only_displayed_if_wind_enabled(void)
{
int output = 0;
windForce = 0;
lvlNumber = 7;
generateField();
if (field[19][1] != '<' && field[19][1] != '>')
{
output = 1;
}
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((output)), (
((void *)0)
), (UNITY_UINT)(394), UNITY_DISPLAY_STYLE_INT);
} }
@ -878,6 +920,6 @@ void test_generateField_check_if_wall_is_build_correctly(void)
((void *)0) ((void *)0)
), (UNITY_UINT)(401), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(420), UNITY_DISPLAY_STYLE_INT);
} }

41
build/test/results/test_Modules.pass

@ -83,15 +83,19 @@
:line: 361 :line: 361
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_generateField_check_if_wind_only_displayed_if_wind_enabled
:line: 379
:message: ''
:unity_test_time: 0
- :test: test_generateField_check_if_wall_is_build_correctly - :test: test_generateField_check_if_wall_is_build_correctly
:line: 378
:line: 397
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 21
:passed: 21
:total: 22
:passed: 22
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: :stdout:
@ -509,6 +513,35 @@
- "| |" - "| |"
- "|=======================|" - "|=======================|"
- "|=======================|" - "|=======================|"
- "| OXX 000 >3 |"
- "|=======================|"
- "| \\ |"
- "| |"
- "| |"
- "| |"
- "| \e[H\e[2J\e[3J |"
- "| |"
- "| |"
- "| V |"
- "| / \\ |"
- "| / \\ |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "|=======================|"
- "|=======================|"
- "| OXX 000 >2 |" - "| OXX 000 >2 |"
- "|=======================|" - "|=======================|"
- "| \\ |" - "| \\ |"
@ -537,4 +570,4 @@
- "| |" - "| |"
- "| |" - "| |"
- "|=======================|" - "|=======================|"
:time: 0.020374785000058182
:time: 0.0169911820003108

4
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_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); extern void test_generateField_check_if_wind_force_correct_displayed(void);
extern void test_generateField_check_if_wind_only_displayed_if_wind_enabled(void);
extern void test_generateField_check_if_wall_is_build_correctly(void); extern void test_generateField_check_if_wall_is_build_correctly(void);
@ -115,7 +116,8 @@ 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_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_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_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);
run_test(test_generateField_check_if_wind_only_displayed_if_wind_enabled, "test_generateField_check_if_wind_only_displayed_if_wind_enabled", 379);
run_test(test_generateField_check_if_wall_is_build_correctly, "test_generateField_check_if_wall_is_build_correctly", 397);
return UnityEnd(); return UnityEnd();
} }

19
test/test_Modules.c

@ -360,6 +360,7 @@ void test_generateField_check_if_wind_form_left_correct_displayed(void)
void test_generateField_check_if_wind_force_correct_displayed(void) void test_generateField_check_if_wind_force_correct_displayed(void)
{ {
/* arrange */ /* arrange */
int output = 1; int output = 1;
windForce = 3; windForce = 3;
@ -375,6 +376,24 @@ void test_generateField_check_if_wind_force_correct_displayed(void)
TEST_ASSERT_EQUAL(0, output); TEST_ASSERT_EQUAL(0, output);
} }
void test_generateField_check_if_wind_only_displayed_if_wind_enabled(void)
{
/* arrange */
int output = 0;
windForce = 0;
lvlNumber = 7;
/* act */
generateField();
if (field[19][1] != '<' && field[19][1] != '>')
{
output = 1;
}
/* assert */
TEST_ASSERT_EQUAL(0, output);
}
void test_generateField_check_if_wall_is_build_correctly(void) void test_generateField_check_if_wall_is_build_correctly(void)
{ {
/* arrange */ /* arrange */

Loading…
Cancel
Save