|
@ -1,5 +1,7 @@ |
|
|
#include "src/schach.h" |
|
|
#include "src/schach.h" |
|
|
#include "C:/Ruby30/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" |
|
|
|
|
|
|
|
|
#include "C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -48,12 +50,98 @@ void test_print_Schachfeld(void){ |
|
|
|
|
|
|
|
|
((void *)0) |
|
|
((void *)0) |
|
|
|
|
|
|
|
|
), (UNITY_UINT)(25), UNITY_DISPLAY_STYLE_CHAR); |
|
|
|
|
|
|
|
|
), (UNITY_UINT)(26), UNITY_DISPLAY_STYLE_CHAR); |
|
|
|
|
|
|
|
|
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )((expected)), (UNITY_INT)(UNITY_INT8 )((Spielfeld[1][0])), ( |
|
|
UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )((expected)), (UNITY_INT)(UNITY_INT8 )((Spielfeld[1][0])), ( |
|
|
|
|
|
|
|
|
((void *)0) |
|
|
((void *)0) |
|
|
|
|
|
|
|
|
), (UNITY_UINT)(26), UNITY_DISPLAY_STYLE_CHAR); |
|
|
|
|
|
|
|
|
), (UNITY_UINT)(27), UNITY_DISPLAY_STYLE_CHAR); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void test_read_input(void) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const char *input = "8\n"; |
|
|
|
|
|
|
|
|
|
|
|
int result = 0; |
|
|
|
|
|
|
|
|
|
|
|
int expected = 7; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FILE *original_stdin = freopen( |
|
|
|
|
|
|
|
|
|
|
|
((void *)0) |
|
|
|
|
|
|
|
|
|
|
|
, "r", |
|
|
|
|
|
|
|
|
|
|
|
(__acrt_iob_func(0)) |
|
|
|
|
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FILE *tempInput = fopen("temp_input.txt", "w"); |
|
|
|
|
|
|
|
|
|
|
|
fputs(input, tempInput); |
|
|
|
|
|
|
|
|
|
|
|
fclose(tempInput); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tempInput = freopen("temp_input.txt", "r", |
|
|
|
|
|
|
|
|
|
|
|
(__acrt_iob_func(0)) |
|
|
|
|
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result = read_input(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UnityAssertEqualNumber((UNITY_INT)((expected)), (UNITY_INT)((result)), ( |
|
|
|
|
|
|
|
|
|
|
|
((void *)0) |
|
|
|
|
|
|
|
|
|
|
|
), (UNITY_UINT)(49), UNITY_DISPLAY_STYLE_INT); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fclose(tempInput); |
|
|
|
|
|
|
|
|
|
|
|
freopen("/dev/tty", "r", |
|
|
|
|
|
|
|
|
|
|
|
(__acrt_iob_func(0)) |
|
|
|
|
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
freopen( |
|
|
|
|
|
|
|
|
|
|
|
((void *)0) |
|
|
|
|
|
|
|
|
|
|
|
, "r", |
|
|
|
|
|
|
|
|
|
|
|
(__acrt_iob_func(0)) |
|
|
|
|
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
} |
|
|
} |