Browse Source

Erster Unit Test

main
David PC Saiz 2 years ago
parent
commit
88b2e0d874
  1. 10
      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. 10
      build/test/preprocess/files/test_Modules.c
  6. 4
      build/test/results/test_Modules.pass
  7. 4
      build/test/runners/test_Modules_runner.c
  8. 15
      test/test_Modules.c

10
build/test/cache/test_Modules.c

@ -24,10 +24,12 @@ void tearDown(void)
void test_checkBallPosition_output(void)
void test_checkBallPosition_output_if_goal(void)
{ {
binX = 1; binX = 1;
binY = 1; binY = 1;
@ -40,14 +42,18 @@ void test_checkBallPosition_output(void)
int output = checkBallPosition(); int output = checkBallPosition();
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((output)), ( UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((output)), (
((void *)0) ((void *)0)
), (UNITY_UINT)(25), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(28), 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

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

@ -24,10 +24,12 @@ void tearDown(void)
void test_checkBallPosition_output(void)
void test_checkBallPosition_output_if_goal(void)
{ {
binX = 1; binX = 1;
binY = 1; binY = 1;
@ -40,14 +42,18 @@ void test_checkBallPosition_output(void)
int output = checkBallPosition(); int output = checkBallPosition();
UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((output)), ( UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((output)), (
((void *)0) ((void *)0)
), (UNITY_UINT)(25), UNITY_DISPLAY_STYLE_INT);
), (UNITY_UINT)(28), UNITY_DISPLAY_STYLE_INT);
} }

4
build/test/results/test_Modules.pass

@ -3,7 +3,7 @@
:path: test :path: test
:file: test_Modules.c :file: test_Modules.c
:successes: :successes:
- :test: test_checkBallPosition_output
- :test: test_checkBallPosition_output_if_goal
:line: 15 :line: 15
:message: '' :message: ''
:unity_test_time: 0 :unity_test_time: 0
@ -15,4 +15,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.0006377379995683441
:time: 0.0009687959991424577

4
build/test/runners/test_Modules_runner.c

@ -10,7 +10,7 @@ char* GlobalOrderError;
/*=======External Functions This Runner Calls=====*/ /*=======External Functions This Runner Calls=====*/
extern void setUp(void); extern void setUp(void);
extern void tearDown(void); extern void tearDown(void);
extern void test_checkBallPosition_output(void);
extern void test_checkBallPosition_output_if_goal(void);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -75,7 +75,7 @@ static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE l
int main(void) int main(void)
{ {
UnityBegin("test_Modules.c"); UnityBegin("test_Modules.c");
run_test(test_checkBallPosition_output, "test_checkBallPosition_output", 15);
run_test(test_checkBallPosition_output_if_goal, "test_checkBallPosition_output_if_goal", 15);
return UnityEnd(); return UnityEnd();
} }

15
test/test_Modules.c

@ -12,9 +12,20 @@ void tearDown(void)
{ {
} }
void test_dsadsa_NeedToImplement(void)
void test_checkBallPosition_output_if_goal(void)
{ {
TEST_IGNORE_MESSAGE("Need to Implement dsadsa");
/* arrange */
binX = 1;
binY = 1;
ballX = 1;
ballY = 3;
/* act */
int output = checkBallPosition();
/* assert */
TEST_ASSERT_EQUAL(1, output);
} }
#endif // TEST #endif // TEST
Loading…
Cancel
Save