diff --git a/build/test/cache/test_Spiellogik.c b/build/test/cache/test_Spiellogik.c index fac6b8e..95eb8e9 100644 --- a/build/test/cache/test_Spiellogik.c +++ b/build/test/cache/test_Spiellogik.c @@ -36,7 +36,7 @@ void test_test1(void){ -void test_feldFrei(void){ +void test_feldFrei_Verhalten_bei_belegtem_Feld(void){ int realU[20][20]; @@ -53,3 +53,23 @@ void test_feldFrei(void){ ), (UNITY_UINT)(24), UNITY_DISPLAY_STYLE_INT); } + + + +void test_feldFrei_Verhalten_bei_freiem_Feld(void){ + + int realU[20][20]; + + realU[11][12] = 0; + + int result = feldFrei(realU, 11, 12); + + + + UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(32), UNITY_DISPLAY_STYLE_INT); + +} diff --git a/build/test/cache/test_test.c b/build/test/cache/test_test.c index 9b598de..10bf57d 100644 --- a/build/test/cache/test_test.c +++ b/build/test/cache/test_test.c @@ -21,21 +21,3 @@ void tearDown(void){ } - - - -void test_test1(void){ - - - - int result = probe(2); - - - - UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result)), ( - -((void *)0) - -), (UNITY_UINT)(19), UNITY_DISPLAY_STYLE_INT); - -} diff --git a/build/test/out/c/test_Spiellogik.o b/build/test/out/c/test_Spiellogik.o index 8d0f092..88cf1b0 100644 Binary files a/build/test/out/c/test_Spiellogik.o and b/build/test/out/c/test_Spiellogik.o differ diff --git a/build/test/out/c/test_Spiellogik_runner.o b/build/test/out/c/test_Spiellogik_runner.o index e21c01e..d184210 100644 Binary files a/build/test/out/c/test_Spiellogik_runner.o and b/build/test/out/c/test_Spiellogik_runner.o differ diff --git a/build/test/out/c/test_test.o b/build/test/out/c/test_test.o index 92a9d92..15c5e3f 100644 Binary files a/build/test/out/c/test_test.o and b/build/test/out/c/test_test.o differ diff --git a/build/test/out/c/test_test_runner.o b/build/test/out/c/test_test_runner.o index 1c46812..bc5fd61 100644 Binary files a/build/test/out/c/test_test_runner.o and b/build/test/out/c/test_test_runner.o differ diff --git a/build/test/out/test_Spiellogik.out b/build/test/out/test_Spiellogik.out index 9c9f122..48055f6 100755 Binary files a/build/test/out/test_Spiellogik.out and b/build/test/out/test_Spiellogik.out differ diff --git a/build/test/out/test_test.out b/build/test/out/test_test.out index c891bdb..b96d135 100755 Binary files a/build/test/out/test_test.out and b/build/test/out/test_test.out differ diff --git a/build/test/preprocess/files/test_Spiellogik.c b/build/test/preprocess/files/test_Spiellogik.c index fac6b8e..95eb8e9 100644 --- a/build/test/preprocess/files/test_Spiellogik.c +++ b/build/test/preprocess/files/test_Spiellogik.c @@ -36,7 +36,7 @@ void test_test1(void){ -void test_feldFrei(void){ +void test_feldFrei_Verhalten_bei_belegtem_Feld(void){ int realU[20][20]; @@ -53,3 +53,23 @@ void test_feldFrei(void){ ), (UNITY_UINT)(24), UNITY_DISPLAY_STYLE_INT); } + + + +void test_feldFrei_Verhalten_bei_freiem_Feld(void){ + + int realU[20][20]; + + realU[11][12] = 0; + + int result = feldFrei(realU, 11, 12); + + + + UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(32), UNITY_DISPLAY_STYLE_INT); + +} diff --git a/build/test/preprocess/files/test_test.c b/build/test/preprocess/files/test_test.c index 9b598de..10bf57d 100644 --- a/build/test/preprocess/files/test_test.c +++ b/build/test/preprocess/files/test_test.c @@ -21,21 +21,3 @@ void tearDown(void){ } - - - -void test_test1(void){ - - - - int result = probe(2); - - - - UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result)), ( - -((void *)0) - -), (UNITY_UINT)(19), UNITY_DISPLAY_STYLE_INT); - -} diff --git a/build/test/results/test_Spiellogik.pass b/build/test/results/test_Spiellogik.pass index 178c373..57c1e63 100644 --- a/build/test/results/test_Spiellogik.pass +++ b/build/test/results/test_Spiellogik.pass @@ -7,16 +7,20 @@ :line: 12 :message: '' :unity_test_time: 0 -- :test: test_feldFrei +- :test: test_feldFrei_Verhalten_bei_belegtem_Feld :line: 19 :message: '' :unity_test_time: 0 +- :test: test_feldFrei_Verhalten_bei_freiem_Feld + :line: 27 + :message: '' + :unity_test_time: 0 :failures: [] :ignores: [] :counts: - :total: 2 - :passed: 2 + :total: 3 + :passed: 3 :failed: 0 :ignored: 0 :stdout: [] -:time: 0.001353542999822821 +:time: 0.0033078729993576417 diff --git a/build/test/results/test_test.pass b/build/test/results/test_test.pass index 9c32ebf..b40fc77 100644 --- a/build/test/results/test_test.pass +++ b/build/test/results/test_test.pass @@ -2,17 +2,13 @@ :source: :path: test :file: test_test.c -:successes: -- :test: test_test1 - :line: 15 - :message: '' - :unity_test_time: 0 +:successes: [] :failures: [] :ignores: [] :counts: - :total: 1 - :passed: 1 + :total: 0 + :passed: 0 :failed: 0 :ignored: 0 :stdout: [] -:time: 0.0018875850000767969 +:time: 0.0013589549998869188 diff --git a/build/test/runners/test_Spiellogik_runner.c b/build/test/runners/test_Spiellogik_runner.c index 2b7c4da..05950ca 100644 --- a/build/test/runners/test_Spiellogik_runner.c +++ b/build/test/runners/test_Spiellogik_runner.c @@ -11,7 +11,8 @@ char* GlobalOrderError; extern void setUp(void); extern void tearDown(void); extern void test_test1(void); -extern void test_feldFrei(void); +extern void test_feldFrei_Verhalten_bei_belegtem_Feld(void); +extern void test_feldFrei_Verhalten_bei_freiem_Feld(void); /*=======Mock Management=====*/ @@ -77,7 +78,8 @@ int main(void) { UnityBegin("test_Spiellogik.c"); run_test(test_test1, "test_test1", 12); - run_test(test_feldFrei, "test_feldFrei", 19); + run_test(test_feldFrei_Verhalten_bei_belegtem_Feld, "test_feldFrei_Verhalten_bei_belegtem_Feld", 19); + run_test(test_feldFrei_Verhalten_bei_freiem_Feld, "test_feldFrei_Verhalten_bei_freiem_Feld", 27); return UnityEnd(); } diff --git a/build/test/runners/test_test_runner.c b/build/test/runners/test_test_runner.c index 1d607b0..d7c7c6a 100644 --- a/build/test/runners/test_test_runner.c +++ b/build/test/runners/test_test_runner.c @@ -10,7 +10,6 @@ char* GlobalOrderError; /*=======External Functions This Runner Calls=====*/ extern void setUp(void); extern void tearDown(void); -extern void test_test1(void); /*=======Mock Management=====*/ @@ -43,39 +42,10 @@ void verifyTest(void) CMock_Verify(); } -/*=======Test Runner Used To Run Each Test=====*/ -static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num) -{ - Unity.CurrentTestName = name; - Unity.CurrentTestLineNumber = line_num; -#ifdef UNITY_USE_COMMAND_LINE_ARGS - if (!UnityTestMatches()) - return; -#endif - Unity.NumberOfTests++; - UNITY_CLR_DETAILS(); - UNITY_EXEC_TIME_START(); - CMock_Init(); - if (TEST_PROTECT()) - { - setUp(); - func(); - } - if (TEST_PROTECT()) - { - tearDown(); - CMock_Verify(); - } - CMock_Destroy(); - UNITY_EXEC_TIME_STOP(); - UnityConcludeTest(); -} - /*=======MAIN=====*/ int main(void) { UnityBegin("test_test.c"); - run_test(test_test1, "test_test1", 15); return UnityEnd(); } diff --git a/test/test_Spiellogik.c b/test/test_Spiellogik.c index 58811d3..bf49757 100644 --- a/test/test_Spiellogik.c +++ b/test/test_Spiellogik.c @@ -16,10 +16,18 @@ void test_test1(void){ TEST_ASSERT_EQUAL_INT(2, result); } -void test_feldFrei(void){ +void test_feldFrei_Verhalten_bei_belegtem_Feld(void){ int realU[N][N]; realU[11][12] = 1; int result = feldFrei( realU, 11,12); TEST_ASSERT_EQUAL_INT(0 , result); +} + +void test_feldFrei_Verhalten_bei_freiem_Feld(void){ + int realU[N][N]; + realU[11][12] = 0; + int result = feldFrei(realU, 11, 12); + + TEST_ASSERT_EQUAL_INT(1, result); } \ No newline at end of file