diff --git a/build/test/cache/test_Spiellogik.c b/build/test/cache/test_Spiellogik.c index 95eb8e9..7bf717f 100644 --- a/build/test/cache/test_Spiellogik.c +++ b/build/test/cache/test_Spiellogik.c @@ -73,3 +73,25 @@ void test_feldFrei_Verhalten_bei_freiem_Feld(void){ ), (UNITY_UINT)(32), UNITY_DISPLAY_STYLE_INT); } + + + + + +void test_lose_up_freiesFeld(void){ + + int realU[20][20] = { 0 }; + + realU[10][12] = 4; + + int result = lose(realU, 'u'); + + + + UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(41), UNITY_DISPLAY_STYLE_INT); + +} diff --git a/build/test/out/c/test_Spiellogik.o b/build/test/out/c/test_Spiellogik.o index 88cf1b0..d4b1112 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 d184210..e24ebca 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/test_Spiellogik.out b/build/test/out/test_Spiellogik.out index 740250b..abfe44c 100755 Binary files a/build/test/out/test_Spiellogik.out and b/build/test/out/test_Spiellogik.out differ diff --git a/build/test/preprocess/files/test_Spiellogik.c b/build/test/preprocess/files/test_Spiellogik.c index 95eb8e9..7bf717f 100644 --- a/build/test/preprocess/files/test_Spiellogik.c +++ b/build/test/preprocess/files/test_Spiellogik.c @@ -73,3 +73,25 @@ void test_feldFrei_Verhalten_bei_freiem_Feld(void){ ), (UNITY_UINT)(32), UNITY_DISPLAY_STYLE_INT); } + + + + + +void test_lose_up_freiesFeld(void){ + + int realU[20][20] = { 0 }; + + realU[10][12] = 4; + + int result = lose(realU, 'u'); + + + + UnityAssertEqualNumber((UNITY_INT)((0)), (UNITY_INT)((result)), ( + + ((void *)0) + + ), (UNITY_UINT)(41), UNITY_DISPLAY_STYLE_INT); + +} diff --git a/build/test/results/test_Spiellogik.pass b/build/test/results/test_Spiellogik.pass index 01e1ece..a92f4b3 100644 --- a/build/test/results/test_Spiellogik.pass +++ b/build/test/results/test_Spiellogik.pass @@ -15,12 +15,16 @@ :line: 27 :message: '' :unity_test_time: 0 +- :test: test_lose_up_freiesFeld + :line: 36 + :message: '' + :unity_test_time: 0 :failures: [] :ignores: [] :counts: - :total: 3 - :passed: 3 + :total: 4 + :passed: 4 :failed: 0 :ignored: 0 :stdout: [] -:time: 0.0012968020000698743 +:time: 0.0011183120000168856 diff --git a/build/test/results/test_Umgebung.pass b/build/test/results/test_Umgebung.pass index d613774..65c1103 100644 --- a/build/test/results/test_Umgebung.pass +++ b/build/test/results/test_Umgebung.pass @@ -19,4 +19,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.0011922139997295744 +:time: 0.0011495720000311849 diff --git a/build/test/results/test_test.pass b/build/test/results/test_test.pass index f1d7be2..f1acee8 100644 --- a/build/test/results/test_test.pass +++ b/build/test/results/test_test.pass @@ -15,4 +15,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.002588016000117932 +:time: 0.0012508869999692251 diff --git a/build/test/runners/test_Spiellogik_runner.c b/build/test/runners/test_Spiellogik_runner.c index 05950ca..702f56e 100644 --- a/build/test/runners/test_Spiellogik_runner.c +++ b/build/test/runners/test_Spiellogik_runner.c @@ -13,6 +13,7 @@ extern void tearDown(void); extern void test_test1(void); extern void test_feldFrei_Verhalten_bei_belegtem_Feld(void); extern void test_feldFrei_Verhalten_bei_freiem_Feld(void); +extern void test_lose_up_freiesFeld(void); /*=======Mock Management=====*/ @@ -80,6 +81,7 @@ int main(void) run_test(test_test1, "test_test1", 12); 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); + run_test(test_lose_up_freiesFeld, "test_lose_up_freiesFeld", 36); return UnityEnd(); } diff --git a/src/Spiellogik.h b/src/Spiellogik.h index 224e691..54eed4d 100644 --- a/src/Spiellogik.h +++ b/src/Spiellogik.h @@ -5,5 +5,6 @@ int probe(int input); int feldFrei(int realU[N][N], int ii, int jj); +int lose(int realU[N][N], char richtung); #endif \ No newline at end of file diff --git a/test/test_Spiellogik.c b/test/test_Spiellogik.c index 2d28061..9aa2572 100644 --- a/test/test_Spiellogik.c +++ b/test/test_Spiellogik.c @@ -31,3 +31,12 @@ void test_feldFrei_Verhalten_bei_freiem_Feld(void){ TEST_ASSERT_EQUAL_INT(1, result); } + +//Tests zur Bewegung nach oben +void test_lose_up_freiesFeld(void){ + int realU[20][20] = { 0 }; + realU[10][12] = 4; + int result = lose(realU, 'u'); + + TEST_ASSERT_EQUAL_INT(0, result); +} \ No newline at end of file