Browse Source

Siebzehnter Unit Test

main
David PC Saiz 2 years ago
parent
commit
b0d6323ed6
  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. 39
      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

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

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

39
build/test/results/test_Modules.pass

@ -67,11 +67,15 @@
:line: 293
:message: ''
:unity_test_time: 0
- :test: test_generateField_check_if_third_live_is_displayed_correctly
:line: 310
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 16
:passed: 16
:total: 17
:passed: 17
:failed: 0
:ignored: 0
:stdout:
@ -353,6 +357,35 @@
- "| |"
- "| |"
- "| V |"
- "| \e[H\e[2J\e[3J / \\ |"
- "| / \\ |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "|=======================|"
- "|=======================|"
- "| OXX 000 |"
- "|=======================|"
- "| \\ |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| V |"
- "| / \\ |"
- "| / \\ |"
- "| |"
@ -371,4 +404,4 @@
- "| |"
- "| |"
- "|=======================|"
:time: 0.008129914999699395
:time: 0.016900140999950963

2
build/test/runners/test_Modules_runner.c

@ -26,6 +26,7 @@ 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);
extern void test_generateField_check_if_second_live_is_displayed_correctly(void);
extern void test_generateField_check_if_third_live_is_displayed_correctly(void);
/*=======Mock Management=====*/
@ -106,6 +107,7 @@ int main(void)
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_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);
return UnityEnd();
}

17
test/test_Modules.c

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