diff --git a/test/test_Misc.c b/test/test_Misc.c new file mode 100644 index 0000000..6ea2fad --- /dev/null +++ b/test/test_Misc.c @@ -0,0 +1,32 @@ +#ifdef TEST +#include "unity.h" +#include "Schachbrett.h" +#include "Spieler.h" +#include "Misc.h" +#include +#include +#include + +void test_king_alive() { + char** brett = malloc(8 * sizeof(char*)); + for(int i = 0; i < 8; i++) { + brett[i] = malloc(8 * sizeof(char)); + for(int j = 0; j < 8; j++) { + brett[i][j] = '.'; + } + } + + // Testfall 1: Beide Könige sind auf dem Brett + brett[0][0] = 'K'; + brett[7][7] = 'k'; + assert(king_alive(brett) == true); + + for(int i = 0; i < 8; i++) { + free(brett[i]); + } + free(brett); +} + + + +#endif // TEST MISC