Browse Source

Vierzehnter Unit Test

main
fdai7103 2 years ago
parent
commit
32ae4787e2
  1. 28
      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. 28
      build/test/preprocess/files/test_Modules.c
  6. 41
      build/test/results/test_Modules.pass
  7. 2
      build/test/runners/test_Modules_runner.c
  8. 12
      test/test_Modules.c

28
build/test/cache/test_Modules.c

@ -569,3 +569,31 @@ void test_generateField_check_if_third_life_away(void)
), (UNITY_UINT)(261), UNITY_DISPLAY_STYLE_INT);
}
void test_generateField_negative_points_not_possible(void){
int output = 1;
scorePoints = -50;
generateField();
output = scorePoints;
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((output)), (
((void *)0)
), (UNITY_UINT)(273), 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

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

@ -569,3 +569,31 @@ void test_generateField_check_if_third_life_away(void)
), (UNITY_UINT)(261), UNITY_DISPLAY_STYLE_INT);
}
void test_generateField_negative_points_not_possible(void){
int output = 1;
scorePoints = -50;
generateField();
output = scorePoints;
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((output)), (
((void *)0)
), (UNITY_UINT)(273), UNITY_DISPLAY_STYLE_INT);
}

41
build/test/results/test_Modules.pass

@ -55,11 +55,15 @@
:line: 247
:message: ''
:unity_test_time: 0
- :test: test_generateField_negative_points_not_possible
:line: 264
:message: ''
:unity_test_time: 0
:failures: []
:ignores: []
:counts:
:total: 13
:passed: 13
:total: 14
:passed: 14
:failed: 0
:ignored: 0
:stdout:
@ -196,7 +200,7 @@
- "| |"
- "| 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 |"
- "| |"
- "| |"
- "| |"
@ -271,4 +275,33 @@
- "| |"
- "| |"
- "|=======================|"
:time: 0.010807849999764585
- "|=======================|"
- "| XXX 000 |"
- "|=======================|"
- "| \\ |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| V |"
- "| / \\ |"
- "| / \\ |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "| |"
- "|=======================|"
:time: 0.008977019999747426

2
build/test/runners/test_Modules_runner.c

@ -23,6 +23,7 @@ extern void test_generateField_check_first_position_change_on_score(void);
extern void test_generateField_check_if_first_life_away(void);
extern void test_generateField_check_if_second_life_away(void);
extern void test_generateField_check_if_third_life_away(void);
extern void test_generateField_negative_points_not_possible(void);
/*=======Mock Management=====*/
@ -100,6 +101,7 @@ int main(void)
run_test(test_generateField_check_if_first_life_away, "test_generateField_check_if_first_life_away", 213);
run_test(test_generateField_check_if_second_life_away, "test_generateField_check_if_second_life_away", 230);
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);
return UnityEnd();
}

12
test/test_Modules.c

@ -261,4 +261,16 @@ void test_generateField_check_if_third_life_away(void)
TEST_ASSERT_EQUAL(0, output);
}
void test_generateField_negative_points_not_possible(void){
int output = 1;
scorePoints = -50;
generateField();
output = scorePoints;
TEST_ASSERT_EQUAL(0, output);
}
#endif // TEST
Loading…
Cancel
Save