Browse Source

Vierter Unit Test

main
fdai7172 2 years ago
parent
commit
1211a75bb1
  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. 12
      build/test/results/test_Modules.pass
  7. 6
      build/test/runners/test_Modules_runner.c
  8. 22
      test/test_Modules.c

50
build/test/cache/test_Modules.c

@ -94,7 +94,7 @@ void test_checkBallPosition_output_if_no_goal(void)
void test_sortScoreboard_check_if_file_exists(void) {
void test_sortScoreboard_check_if_file_is_created(void) {
@ -129,3 +129,51 @@ void test_sortScoreboard_check_if_file_exists(void) {
), (UNITY_UINT)(61), UNITY_DISPLAY_STYLE_INT); ), (UNITY_UINT)(61), UNITY_DISPLAY_STYLE_INT);
} }
void test_clearField_check_if_Playgroung_clear(void)
{
field[3][3]='T';
int output = 0;
clearField();
for (int i = 0; i < 23; i++)
{
for (int j = 0; j < 29; j++)
{
if(field[i][j] != ' ')
{
output=1;
}
}
}
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((output)), (
((void *)0)
), (UNITY_UINT)(83), 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

@ -94,7 +94,7 @@ void test_checkBallPosition_output_if_no_goal(void)
void test_sortScoreboard_check_if_file_exists(void) {
void test_sortScoreboard_check_if_file_is_created(void) {
@ -129,3 +129,51 @@ void test_sortScoreboard_check_if_file_exists(void) {
), (UNITY_UINT)(61), UNITY_DISPLAY_STYLE_INT); ), (UNITY_UINT)(61), UNITY_DISPLAY_STYLE_INT);
} }
void test_clearField_check_if_Playgroung_clear(void)
{
field[3][3]='T';
int output = 0;
clearField();
for (int i = 0; i < 23; i++)
{
for (int j = 0; j < 29; j++)
{
if(field[i][j] != ' ')
{
output=1;
}
}
}
UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((output)), (
((void *)0)
), (UNITY_UINT)(83), UNITY_DISPLAY_STYLE_INT);
}

12
build/test/results/test_Modules.pass

@ -11,19 +11,23 @@
:line: 31 :line: 31
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_sortScoreboard_check_if_file_exists
- :test: test_sortScoreboard_check_if_file_is_created
:line: 47 :line: 47
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
- :test: test_clearField_check_if_Playgroung_clear
:line: 64
:message: ''
:unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 3
:passed: 3
:total: 4
:passed: 4
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: :stdout:
- "\e[H\e[2J\e[3J" - "\e[H\e[2J\e[3J"
- " Scoreboard:" - " Scoreboard:"
- '' - ''
:time: 0.0021875080001336755
:time: 0.0012868310004705563

6
build/test/runners/test_Modules_runner.c

@ -12,7 +12,8 @@ extern void setUp(void);
extern void tearDown(void); extern void tearDown(void);
extern void test_checkBallPosition_output_if_goal(void); extern void test_checkBallPosition_output_if_goal(void);
extern void test_checkBallPosition_output_if_no_goal(void); extern void test_checkBallPosition_output_if_no_goal(void);
extern void test_sortScoreboard_check_if_file_exists(void);
extern void test_sortScoreboard_check_if_file_is_created(void);
extern void test_clearField_check_if_Playgroung_clear(void);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -79,7 +80,8 @@ int main(void)
UnityBegin("test_Modules.c"); UnityBegin("test_Modules.c");
run_test(test_checkBallPosition_output_if_goal, "test_checkBallPosition_output_if_goal", 15); run_test(test_checkBallPosition_output_if_goal, "test_checkBallPosition_output_if_goal", 15);
run_test(test_checkBallPosition_output_if_no_goal, "test_checkBallPosition_output_if_no_goal", 31); run_test(test_checkBallPosition_output_if_no_goal, "test_checkBallPosition_output_if_no_goal", 31);
run_test(test_sortScoreboard_check_if_file_exists, "test_sortScoreboard_check_if_file_exists", 47);
run_test(test_sortScoreboard_check_if_file_is_created, "test_sortScoreboard_check_if_file_is_created", 47);
run_test(test_clearField_check_if_Playgroung_clear, "test_clearField_check_if_Playgroung_clear", 64);
return UnityEnd(); return UnityEnd();
} }

22
test/test_Modules.c

@ -61,4 +61,26 @@ void test_sortScoreboard_check_if_file_is_created(void) {
TEST_ASSERT_EQUAL(0, output); TEST_ASSERT_EQUAL(0, output);
} }
void test_clearField_check_if_Playgroung_clear(void)
{
/* arrange */
field[3][3]='T';
int output = 0;
/* act */
clearField();
for (int i = 0; i < fieldWidth; i++)
{
for (int j = 0; j < fieldHeigth; j++)
{
if(field[i][j] != ' ')
{
output=1;
}
}
}
/* assert */
TEST_ASSERT_EQUAL(0, output);
}
#endif // TEST #endif // TEST
Loading…
Cancel
Save