Browse Source

Test checkWinner

remotes/origin/Ariana
fdai7775 11 months ago
parent
commit
6effaec97b
  1. 1
      src/main/c/GameTic_Tac_Toe/tictactoe.h
  2. 4
      test/test_tictactoe.c

1
src/main/c/GameTic_Tac_Toe/tictactoe.h

@ -8,5 +8,6 @@ char checkLine(char a, char b, char c);
void start_tictactoe(); void start_tictactoe();
char checkWinner(); char checkWinner();
void makeMove(int choice); void makeMove(int choice);
void displayBoard();
#endif #endif

4
test/test_tictactoe.c

@ -52,11 +52,13 @@ void test_checkWinner_vertikalerGewinner(void) {
char result; char result;
// Setze die Daten für einen vertikalen Gewinner // Setze die Daten für einen vertikalen Gewinner
displayBoard();
makeMove(1); makeMove(1);
makeMove(2); makeMove(2);
makeMove(4); makeMove(4);
makeMove(3); makeMove(3);
makeMove(7); makeMove(7);
displayBoard();
/* handeln */ /* handeln */
result = checkWinner(); result = checkWinner();
@ -69,11 +71,13 @@ void test_checkWinner_horizontalerGewinner(void) {
/* arrangieren */ /* arrangieren */
char result; char result;
displayBoard();
makeMove(1); makeMove(1);
makeMove(4); makeMove(4);
makeMove(2); makeMove(2);
makeMove(5); makeMove(5);
makeMove(3); makeMove(3);
displayBoard();
/* handeln */ /* handeln */
result = checkWinner(); result = checkWinner();

Loading…
Cancel
Save