Browse Source

Sechzehnter Unit Test

main
fdai7172 2 years ago
parent
commit
0d256fd288
  1. 38
      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. 38
      build/test/preprocess/files/test_Modules.c
  6. 42
      build/test/results/test_Modules.pass
  7. 2
      build/test/runners/test_Modules_runner.c
  8. 17
      test/test_Modules.c

38
build/test/cache/test_Modules.c

@ -635,3 +635,41 @@ void test_generateField_check_if_first_live_is_displayed_correctly(void)
), (UNITY_UINT)(290), UNITY_DISPLAY_STYLE_INT); ), (UNITY_UINT)(290), UNITY_DISPLAY_STYLE_INT);
} }
void test_generateField_check_if_second_live_is_displayed_correctly(void)
{
int output = 1;
lifeCount = 2;
generateField();
if (field[2][1] == 'O')
{
output = 0;
}
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((output)), (
((void *)0)
), (UNITY_UINT)(307), 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

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

@ -635,3 +635,41 @@ void test_generateField_check_if_first_live_is_displayed_correctly(void)
), (UNITY_UINT)(290), UNITY_DISPLAY_STYLE_INT); ), (UNITY_UINT)(290), UNITY_DISPLAY_STYLE_INT);
} }
void test_generateField_check_if_second_live_is_displayed_correctly(void)
{
int output = 1;
lifeCount = 2;
generateField();
if (field[2][1] == 'O')
{
output = 0;
}
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((output)), (
((void *)0)
), (UNITY_UINT)(307), UNITY_DISPLAY_STYLE_INT);
}

42
build/test/results/test_Modules.pass

@ -63,11 +63,15 @@
:line: 276 :line: 276
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_generateField_check_if_second_live_is_displayed_correctly
:line: 293
:message: ''
:unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 15
:passed: 15
:total: 16
:passed: 16
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: :stdout:
@ -204,7 +208,8 @@
- "| |" - "| |"
- "| 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\e[H\e[2J\e[3J\e[H\e[2J\e[3J
\ |"
- "| |" - "| |"
- "| |" - "| |"
- "| |" - "| |"
@ -337,4 +342,33 @@
- "| |" - "| |"
- "| |" - "| |"
- "|=======================|" - "|=======================|"
:time: 0.011396616999263642
- "|=======================|"
- "| OOX 000 |"
- "|=======================|"
- "| \\ |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| V |"
- "| / \\ |"
- "| / \\ |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "|=======================|"
:time: 0.008129914999699395

2
build/test/runners/test_Modules_runner.c

@ -25,6 +25,7 @@ extern void test_generateField_check_if_second_life_away(void);
extern void test_generateField_check_if_third_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_negative_points_not_possible(void);
extern void test_generateField_check_if_first_live_is_displayed_correctly(void); extern void test_generateField_check_if_first_live_is_displayed_correctly(void);
extern void test_generateField_check_if_second_live_is_displayed_correctly(void);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -104,6 +105,7 @@ int main(void)
run_test(test_generateField_check_if_third_life_away, "test_generateField_check_if_third_life_away", 247); 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_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); run_test(test_generateField_check_if_first_live_is_displayed_correctly, "test_generateField_check_if_first_live_is_displayed_correctly", 276);
run_test(test_generateField_check_if_second_live_is_displayed_correctly, "test_generateField_check_if_second_live_is_displayed_correctly", 293);
return UnityEnd(); return UnityEnd();
} }

17
test/test_Modules.c

@ -290,4 +290,21 @@ void test_generateField_check_if_first_live_is_displayed_correctly(void)
TEST_ASSERT_EQUAL(0, output); TEST_ASSERT_EQUAL(0, output);
} }
void test_generateField_check_if_second_live_is_displayed_correctly(void)
{
/* arrange */
int output = 1;
lifeCount = 2;
/* act */
generateField();
if (field[2][1] == 'O')
{
output = 0;
}
/* assert */
TEST_ASSERT_EQUAL(0, output);
}
#endif // TEST #endif // TEST
Loading…
Cancel
Save