diff --git a/build/test/cache/test_schach.c b/build/test/cache/test_schach.c index 69e491c..677744c 100644 --- a/build/test/cache/test_schach.c +++ b/build/test/cache/test_schach.c @@ -62,7 +62,7 @@ void test_print_Schachfeld(void){ -void test_print_Schachfeld_Turm(void){ +void test_print_Schachfeld_Turm_weiss(void){ @@ -98,6 +98,44 @@ void test_print_Schachfeld_Turm(void){ +void test_print_Schachfeld_dame_schwarz(void){ + + + + char expected = 'd'; + + int x = 8; + + int y = 8; + + + + + + char** Spielfeld = create_Schachfeld(x, y); + + + + + + UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )((expected)), (UNITY_INT)(UNITY_INT8 )((Spielfeld[7][3])), ( + + ((void *)0) + + ), (UNITY_UINT)(54), UNITY_DISPLAY_STYLE_CHAR); + + + +} + + + + + + + + + void test_read_input(void) { @@ -152,7 +190,7 @@ void test_read_input(void) { ((void *)0) - ), (UNITY_UINT)(63), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(80), UNITY_DISPLAY_STYLE_INT); diff --git a/build/test/out/c/schach.o b/build/test/out/c/schach.o index adfb845..ac71289 100644 Binary files a/build/test/out/c/schach.o and b/build/test/out/c/schach.o differ diff --git a/build/test/out/c/test_schach.o b/build/test/out/c/test_schach.o index d27dd18..ccee82d 100644 Binary files a/build/test/out/c/test_schach.o and b/build/test/out/c/test_schach.o differ diff --git a/build/test/out/c/test_schach_runner.o b/build/test/out/c/test_schach_runner.o index 2cc7649..0f961d9 100644 Binary files a/build/test/out/c/test_schach_runner.o and b/build/test/out/c/test_schach_runner.o differ diff --git a/build/test/out/test_schach.out b/build/test/out/test_schach.out index 9d907c7..6ebad14 100644 Binary files a/build/test/out/test_schach.out and b/build/test/out/test_schach.out differ diff --git a/build/test/preprocess/files/test_schach.c b/build/test/preprocess/files/test_schach.c index 69e491c..677744c 100644 --- a/build/test/preprocess/files/test_schach.c +++ b/build/test/preprocess/files/test_schach.c @@ -62,7 +62,7 @@ void test_print_Schachfeld(void){ -void test_print_Schachfeld_Turm(void){ +void test_print_Schachfeld_Turm_weiss(void){ @@ -98,6 +98,44 @@ void test_print_Schachfeld_Turm(void){ +void test_print_Schachfeld_dame_schwarz(void){ + + + + char expected = 'd'; + + int x = 8; + + int y = 8; + + + + + + char** Spielfeld = create_Schachfeld(x, y); + + + + + + UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )((expected)), (UNITY_INT)(UNITY_INT8 )((Spielfeld[7][3])), ( + + ((void *)0) + + ), (UNITY_UINT)(54), UNITY_DISPLAY_STYLE_CHAR); + + + +} + + + + + + + + + void test_read_input(void) { @@ -152,7 +190,7 @@ void test_read_input(void) { ((void *)0) - ), (UNITY_UINT)(63), UNITY_DISPLAY_STYLE_INT); + ), (UNITY_UINT)(80), UNITY_DISPLAY_STYLE_INT); diff --git a/build/test/results/test_schach.pass b/build/test/results/test_schach.pass index 7a19fd3..112e16b 100644 --- a/build/test/results/test_schach.pass +++ b/build/test/results/test_schach.pass @@ -7,20 +7,24 @@ :line: 16 :message: '' :unity_test_time: 0 -- :test: test_print_Schachfeld_Turm +- :test: test_print_Schachfeld_Turm_weiss :line: 30 :message: '' :unity_test_time: 0 -- :test: test_read_input +- :test: test_print_Schachfeld_dame_schwarz :line: 44 :message: '' :unity_test_time: 0 +- :test: test_read_input + :line: 61 + :message: '' + :unity_test_time: 0 :failures: [] :ignores: [] :counts: - :total: 3 - :passed: 3 + :total: 4 + :passed: 4 :failed: 0 :ignored: 0 :stdout: [] -:time: 0.14233430003514513 +:time: 1.981050599948503 diff --git a/build/test/runners/test_schach_runner.c b/build/test/runners/test_schach_runner.c index d271d71..856a617 100644 --- a/build/test/runners/test_schach_runner.c +++ b/build/test/runners/test_schach_runner.c @@ -11,7 +11,8 @@ char* GlobalOrderError; extern void setUp(void); extern void tearDown(void); extern void test_print_Schachfeld(void); -extern void test_print_Schachfeld_Turm(void); +extern void test_print_Schachfeld_Turm_weiss(void); +extern void test_print_Schachfeld_dame_schwarz(void); extern void test_read_input(void); @@ -78,8 +79,9 @@ int main(void) { UnityBegin("test_schach.c"); run_test(test_print_Schachfeld, "test_print_Schachfeld", 16); - run_test(test_print_Schachfeld_Turm, "test_print_Schachfeld_Turm", 30); - run_test(test_read_input, "test_read_input", 44); + run_test(test_print_Schachfeld_Turm_weiss, "test_print_Schachfeld_Turm_weiss", 30); + run_test(test_print_Schachfeld_dame_schwarz, "test_print_Schachfeld_dame_schwarz", 44); + run_test(test_read_input, "test_read_input", 61); return UnityEnd(); } diff --git a/src/main.c b/src/main.c index e27ca00..743359a 100644 --- a/src/main.c +++ b/src/main.c @@ -6,11 +6,19 @@ int main() { int x = 8; int y = 8; - + int spieler = 0; char** Spielfeld = create_Schachfeld(x, y); while (checkmate() == 0){ print_Schachfeld(Spielfeld, x, y); + if(spieler % 2 == 0){ + + //weiß + } + else{ //schwarz + } + spieler++; } + free_Schachfeld(Spielfeld, x); return 0; diff --git a/test/test_schach.c b/test/test_schach.c index 4e21771..3dd1997 100644 --- a/test/test_schach.c +++ b/test/test_schach.c @@ -27,7 +27,7 @@ void test_print_Schachfeld(void){ TEST_ASSERT_EQUAL_CHAR(expected,Spielfeld[4][3]); } -void test_print_Schachfeld_Turm(void){ +void test_print_Schachfeld_Turm_weiss(void){ /* arrange */ char expected = 'T'; int x = 8; @@ -41,6 +41,23 @@ void test_print_Schachfeld_Turm(void){ TEST_ASSERT_EQUAL_CHAR(expected,Spielfeld[0][7]); } +void test_print_Schachfeld_dame_schwarz(void){ + /* arrange */ + char expected = 'd'; + int x = 8; + int y = 8; + + /* act */ + char** Spielfeld = create_Schachfeld(x, y); + + /* assert */ + TEST_ASSERT_EQUAL_CHAR(expected,Spielfeld[7][3]); + //TEST_ASSERT_EQUAL_CHAR(expected,Spielfeld[0][7]); +} + + + + void test_read_input(void) { /* arrange */ const char *input = "8\n";