From 0f2143cd499f56ed99210646666f44a1f2f2ef94 Mon Sep 17 00:00:00 2001 From: Jannis Date: Wed, 8 Feb 2023 13:50:37 +0100 Subject: [PATCH] Setup Unittest Funktion win --- build/test/cache/test_Spiellogik.c | 58 ++++++++++++++---- build/test/out/c/test_Spiellogik.o | Bin 13200 -> 13200 bytes build/test/out/c/test_Spiellogik_runner.o | Bin 11992 -> 11992 bytes build/test/out/test_Spiellogik.out | Bin 62408 -> 62408 bytes build/test/preprocess/files/test_Spiellogik.c | 58 ++++++++++++++---- build/test/results/test_Spiellogik.pass | 24 ++++---- build/test/results/test_Umgebung.pass | 2 +- build/test/results/test_test.pass | 2 +- build/test/runners/test_Spiellogik_runner.c | 22 +++---- src/Spiellogik.h | 1 + 10 files changed, 120 insertions(+), 47 deletions(-) diff --git a/build/test/cache/test_Spiellogik.c b/build/test/cache/test_Spiellogik.c index 9764754..5ce3638 100644 --- a/build/test/cache/test_Spiellogik.c +++ b/build/test/cache/test_Spiellogik.c @@ -78,6 +78,10 @@ void test_feldFrei_Verhalten_bei_freiem_Feld(void){ + + + + void test_lose_up_freiesFeld(void){ int realU[20][20] = { 0 }; @@ -92,12 +96,14 @@ void test_lose_up_freiesFeld(void){ ((void *)0) - ), (UNITY_UINT)(41), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(43), UNITY_DISPLAY_STYLE_INT); } + + void test_lose_up_belegtesFeld(void){ int realU[20][20] = { 0 }; @@ -114,12 +120,16 @@ void test_lose_up_belegtesFeld(void){ ((void *)0) - ), (UNITY_UINT)(50), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(53), UNITY_DISPLAY_STYLE_INT); } + + + + void test_lose_up_Obererrand(void){ int realU[20][20] = { 0 }; @@ -134,7 +144,7 @@ void test_lose_up_Obererrand(void){ ((void *)0) - ), (UNITY_UINT)(58), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(63), UNITY_DISPLAY_STYLE_INT); } @@ -142,6 +152,8 @@ void test_lose_up_Obererrand(void){ + + void test_lose_down_freiesFeld(void){ int realU[20][20] = { 0 }; @@ -156,12 +168,16 @@ void test_lose_down_freiesFeld(void){ ((void *)0) - ), (UNITY_UINT)(67), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(73), UNITY_DISPLAY_STYLE_INT); } + + + + void test_lose_down_belegtesFeld(void){ int realU[20][20] = { 0 }; @@ -178,7 +194,7 @@ void test_lose_down_belegtesFeld(void){ ((void *)0) - ), (UNITY_UINT)(76), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(84), UNITY_DISPLAY_STYLE_INT); } @@ -202,12 +218,16 @@ void test_lose_left_freiesFeld(void){ ((void *)0) - ), (UNITY_UINT)(86), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(94), UNITY_DISPLAY_STYLE_INT); } + + + + void test_lose_left_belegtesFeld(void){ int realU[20][20] = { 0 }; @@ -224,12 +244,16 @@ void test_lose_left_belegtesFeld(void){ ((void *)0) - ), (UNITY_UINT)(95), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(105), UNITY_DISPLAY_STYLE_INT); } + + + + void test_lose_left_linkerRand(void){ int realU[20][20] = { 0 }; @@ -244,7 +268,7 @@ void test_lose_left_linkerRand(void){ ((void *)0) - ), (UNITY_UINT)(103), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(115), UNITY_DISPLAY_STYLE_INT); } @@ -252,6 +276,8 @@ void test_lose_left_linkerRand(void){ + + void test_lose_right_freiesFeld(void){ int realU[20][20] = { 0 }; @@ -266,12 +292,16 @@ void test_lose_right_freiesFeld(void){ ((void *)0) - ), (UNITY_UINT)(112), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(125), UNITY_DISPLAY_STYLE_INT); } + + + + void test_lose_right_belegtesFeld(void){ int realU[20][20] = { 0 }; @@ -288,10 +318,16 @@ void test_lose_right_belegtesFeld(void){ ((void *)0) - ), (UNITY_UINT)(121), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(136), UNITY_DISPLAY_STYLE_INT); } + + + + + + void test_lose_right_rechterRand(void){ int realU[20][20] = { 0 }; @@ -306,6 +342,6 @@ void test_lose_right_rechterRand(void){ ((void *)0) - ), (UNITY_UINT)(128), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(146), UNITY_DISPLAY_STYLE_INT); } diff --git a/build/test/out/c/test_Spiellogik.o b/build/test/out/c/test_Spiellogik.o index 1be7e693d901454dd4e357aa6cc916e5506476fc..adae98840301c619090cb433e1682455bc6b72f6 100644 GIT binary patch delta 793 zcmZvXOG^S#6oBWhTuC*-Mc;S?@~tj=)tW|`p( z_!#S6IdtNLPF>JGet6~TffG7%K?Qqu*AkLG!d!F5sj4n@gQ}em=cu|#)nV($TP`<; z6`x#Prj!M(xS;vo0dI7`f>T{|sWZLm4^=Z%wRf9!xhYKgu)f_dB775xS4j{nfl*Wg15iQ`B{{;EI=vPlyhebHNF>IW@G+1~Tiqb9wz`^B Y8Z;j4sz-GR#G#RYCH=*AQp|^c0j1%K#Q*>R delta 793 zcmZvXTT22#6oB{aIyq~W<`NnEVwj0w-XMvRB7%a5ponf1ffB29K`@BuV*La4*qdb3 zLvI!M7kVrD74lb6{SKLjvo1Mx;1Q7*W(l z@m>nSYzvx%MWg&-i^E!l+`_J&RzWk1ZhY(-f_#M>V$vRmQ=|N*M^}0jZiMJM0L5!L z40e2yH^OIvd2Y-bYKkZb(9F)|W+;{K3PyT~35P#bFgcJ& z1shf8vpAUhB=Q$gs75?>LTH767*I%nW^vo)g)D+w!A)0hPx~#Xzdg7jv8-Wws8+X% YM!An`I6`xJtA6jlQjltmh&%270fq#KW&i*H diff --git a/build/test/out/c/test_Spiellogik_runner.o b/build/test/out/c/test_Spiellogik_runner.o index e2376e3ea4bd8ab96d1c935120381ae9f6842e57..87299cf595098da65ae2f9a0df9c5615bdb81bec 100644 GIT binary patch delta 112 zcmcZ+dn0zkMMg%o$sZUc*pB`C|9_W0kSWV(1s3Q63AlinIUuGVh{@|NrmugUG7GWvijGejwS%$rpjVK28vmdE$a%#$r|mh6$4=lq=gb*+VtVhigcJ zX=p~((8g&4RKq-RPB8;BH!}l6#pL(p(h8NRimH(meFPemH(9GfIyxU!Q6Z9|7NAMV zWs(rv5snZB3WHspf~qwgNoxa8Q{?0Y719b(sET5c6d3`1?l<{1&=LNqih__7MFDMd zSt|~41S05;z#QRjIz}tI2_t(hAn7ifoY-)iN?L=uhscl=e12Rb-5$Xco|V zwI`zJjwl6s02~tPs9H5Qf2z#TGRS_y%K4O4m?NE4Xg(_|$0SxpCRJfpRgO#~aU==l z$rqQ1N~>~YAxR^&sdHpa-nB$e0wOEKkv<EfHbX0IJhlD#i#D5ZN5L HG~W*Zv~0}r delta 894 zcmX@{ocY9a<_#6hB2|*t)f9`oxYcHfiSgbj>08UEn7Fxzc^yBa%4BO{Sw@}7kwDUP za=EaqtsMgcgGVo`wk?qAJO*U3uz*;{U*!Dz|9_VoL{=RxTMd=<1IY$Xz6dlYa`Jm1 znKYSKM3ymovNn(`p6m%Et2d{MJY{6moa`$$kI`uI8?h;jR+AgWr!YEC7L%CA=reh% z#1zJ`$zGE47~?0ul$^qtKDkb63S+@!Vd;5{m6JC~Pho7>>@G7sijiaT{W2X!_Q^cu z5jxfPq=9Y%f~gRSfpLy769WU|HK4<4I6+M2i3^Gui&+^M>LyPpSGFm(hiaG)*N_C$ zP=czVoYMxVhI!(gVg_bzW(J1r$?wah6>?A&^6RckDg)&`)az{v|Lq!oft6@?%vG6MSCZSrlPBivCHc_Ar^0@`M` zRvh98M9>|9Il>-Qt0R)u1wb{XlLITI70gf-Ss*E@Wn^H`ncPz;?X8Qd$N)*vETHu& zPejojQ3~_`I3!e2wW@FaRGFcbkokm_^C_z^M>?y}d{$PDNvw=as=}eE{)#+W{7smSKYrTKmU DQcld7 diff --git a/build/test/preprocess/files/test_Spiellogik.c b/build/test/preprocess/files/test_Spiellogik.c index 9764754..5ce3638 100644 --- a/build/test/preprocess/files/test_Spiellogik.c +++ b/build/test/preprocess/files/test_Spiellogik.c @@ -78,6 +78,10 @@ void test_feldFrei_Verhalten_bei_freiem_Feld(void){ + + + + void test_lose_up_freiesFeld(void){ int realU[20][20] = { 0 }; @@ -92,12 +96,14 @@ void test_lose_up_freiesFeld(void){ ((void *)0) - ), (UNITY_UINT)(41), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(43), UNITY_DISPLAY_STYLE_INT); } + + void test_lose_up_belegtesFeld(void){ int realU[20][20] = { 0 }; @@ -114,12 +120,16 @@ void test_lose_up_belegtesFeld(void){ ((void *)0) - ), (UNITY_UINT)(50), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(53), UNITY_DISPLAY_STYLE_INT); } + + + + void test_lose_up_Obererrand(void){ int realU[20][20] = { 0 }; @@ -134,7 +144,7 @@ void test_lose_up_Obererrand(void){ ((void *)0) - ), (UNITY_UINT)(58), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(63), UNITY_DISPLAY_STYLE_INT); } @@ -142,6 +152,8 @@ void test_lose_up_Obererrand(void){ + + void test_lose_down_freiesFeld(void){ int realU[20][20] = { 0 }; @@ -156,12 +168,16 @@ void test_lose_down_freiesFeld(void){ ((void *)0) - ), (UNITY_UINT)(67), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(73), UNITY_DISPLAY_STYLE_INT); } + + + + void test_lose_down_belegtesFeld(void){ int realU[20][20] = { 0 }; @@ -178,7 +194,7 @@ void test_lose_down_belegtesFeld(void){ ((void *)0) - ), (UNITY_UINT)(76), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(84), UNITY_DISPLAY_STYLE_INT); } @@ -202,12 +218,16 @@ void test_lose_left_freiesFeld(void){ ((void *)0) - ), (UNITY_UINT)(86), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(94), UNITY_DISPLAY_STYLE_INT); } + + + + void test_lose_left_belegtesFeld(void){ int realU[20][20] = { 0 }; @@ -224,12 +244,16 @@ void test_lose_left_belegtesFeld(void){ ((void *)0) - ), (UNITY_UINT)(95), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(105), UNITY_DISPLAY_STYLE_INT); } + + + + void test_lose_left_linkerRand(void){ int realU[20][20] = { 0 }; @@ -244,7 +268,7 @@ void test_lose_left_linkerRand(void){ ((void *)0) - ), (UNITY_UINT)(103), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(115), UNITY_DISPLAY_STYLE_INT); } @@ -252,6 +276,8 @@ void test_lose_left_linkerRand(void){ + + void test_lose_right_freiesFeld(void){ int realU[20][20] = { 0 }; @@ -266,12 +292,16 @@ void test_lose_right_freiesFeld(void){ ((void *)0) - ), (UNITY_UINT)(112), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(125), UNITY_DISPLAY_STYLE_INT); } + + + + void test_lose_right_belegtesFeld(void){ int realU[20][20] = { 0 }; @@ -288,10 +318,16 @@ void test_lose_right_belegtesFeld(void){ ((void *)0) - ), (UNITY_UINT)(121), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(136), UNITY_DISPLAY_STYLE_INT); } + + + + + + void test_lose_right_rechterRand(void){ int realU[20][20] = { 0 }; @@ -306,6 +342,6 @@ void test_lose_right_rechterRand(void){ ((void *)0) - ), (UNITY_UINT)(128), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(146), UNITY_DISPLAY_STYLE_INT); } diff --git a/build/test/results/test_Spiellogik.pass b/build/test/results/test_Spiellogik.pass index f57fad2..d5dd92f 100644 --- a/build/test/results/test_Spiellogik.pass +++ b/build/test/results/test_Spiellogik.pass @@ -16,47 +16,47 @@ :message: '' :unity_test_time: 0 - :test: test_lose_up_freiesFeld - :line: 36 + :line: 38 :message: '' :unity_test_time: 0 - :test: test_lose_up_belegtesFeld - :line: 44 + :line: 47 :message: '' :unity_test_time: 0 - :test: test_lose_up_Obererrand - :line: 53 + :line: 58 :message: '' :unity_test_time: 0 - :test: test_lose_down_freiesFeld - :line: 62 + :line: 68 :message: '' :unity_test_time: 0 - :test: test_lose_down_belegtesFeld - :line: 70 + :line: 78 :message: '' :unity_test_time: 0 - :test: test_lose_left_freiesFeld - :line: 81 + :line: 89 :message: '' :unity_test_time: 0 - :test: test_lose_left_belegtesFeld - :line: 89 + :line: 99 :message: '' :unity_test_time: 0 - :test: test_lose_left_linkerRand - :line: 98 + :line: 110 :message: '' :unity_test_time: 0 - :test: test_lose_right_freiesFeld - :line: 107 + :line: 120 :message: '' :unity_test_time: 0 - :test: test_lose_right_belegtesFeld - :line: 115 + :line: 130 :message: '' :unity_test_time: 0 - :test: test_lose_right_rechterRand - :line: 123 + :line: 141 :message: '' :unity_test_time: 0 :failures: [] @@ -67,4 +67,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.0020299840016377857 +:time: 0.000997625000309199 diff --git a/build/test/results/test_Umgebung.pass b/build/test/results/test_Umgebung.pass index 5925f89..2923dbb 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.0014718490001541795 +:time: 0.0012777290012309095 diff --git a/build/test/results/test_test.pass b/build/test/results/test_test.pass index c57278f..c51756b 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.0013736040000367211 +:time: 0.0011423740015743533 diff --git a/build/test/runners/test_Spiellogik_runner.c b/build/test/runners/test_Spiellogik_runner.c index cd6f2e8..4db60cb 100644 --- a/build/test/runners/test_Spiellogik_runner.c +++ b/build/test/runners/test_Spiellogik_runner.c @@ -91,17 +91,17 @@ 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); - run_test(test_lose_up_belegtesFeld, "test_lose_up_belegtesFeld", 44); - run_test(test_lose_up_Obererrand, "test_lose_up_Obererrand", 53); - run_test(test_lose_down_freiesFeld, "test_lose_down_freiesFeld", 62); - run_test(test_lose_down_belegtesFeld, "test_lose_down_belegtesFeld", 70); - run_test(test_lose_left_freiesFeld, "test_lose_left_freiesFeld", 81); - run_test(test_lose_left_belegtesFeld, "test_lose_left_belegtesFeld", 89); - run_test(test_lose_left_linkerRand, "test_lose_left_linkerRand", 98); - run_test(test_lose_right_freiesFeld, "test_lose_right_freiesFeld", 107); - run_test(test_lose_right_belegtesFeld, "test_lose_right_belegtesFeld", 115); - run_test(test_lose_right_rechterRand, "test_lose_right_rechterRand", 123); + run_test(test_lose_up_freiesFeld, "test_lose_up_freiesFeld", 38); + run_test(test_lose_up_belegtesFeld, "test_lose_up_belegtesFeld", 47); + run_test(test_lose_up_Obererrand, "test_lose_up_Obererrand", 58); + run_test(test_lose_down_freiesFeld, "test_lose_down_freiesFeld", 68); + run_test(test_lose_down_belegtesFeld, "test_lose_down_belegtesFeld", 78); + run_test(test_lose_left_freiesFeld, "test_lose_left_freiesFeld", 89); + run_test(test_lose_left_belegtesFeld, "test_lose_left_belegtesFeld", 99); + run_test(test_lose_left_linkerRand, "test_lose_left_linkerRand", 110); + run_test(test_lose_right_freiesFeld, "test_lose_right_freiesFeld", 120); + run_test(test_lose_right_belegtesFeld, "test_lose_right_belegtesFeld", 130); + run_test(test_lose_right_rechterRand, "test_lose_right_rechterRand", 141); return UnityEnd(); } diff --git a/src/Spiellogik.h b/src/Spiellogik.h index 54eed4d..e676795 100644 --- a/src/Spiellogik.h +++ b/src/Spiellogik.h @@ -4,6 +4,7 @@ #define N 20 int probe(int input); +int win(realU[N][N]); int feldFrei(int realU[N][N], int ii, int jj); int lose(int realU[N][N], char richtung);