diff --git a/build/test/cache/test_duellist_spielesammlung_projekt.c b/build/test/cache/test_duellist_spielesammlung_projekt.c index 74c99eb..c7841c4 100644 --- a/build/test/cache/test_duellist_spielesammlung_projekt.c +++ b/build/test/cache/test_duellist_spielesammlung_projekt.c @@ -16,7 +16,7 @@ void tearDown(void) {} -void test_coinflip_player_x_starts(void) { +void test_coinflip_x_starts(void) { @@ -44,7 +44,7 @@ void test_coinflip_player_x_starts(void) { -void test_coinflip_player_o_starts(void) { +void test_coinflip_o_starts(void) { @@ -166,7 +166,7 @@ void test_diagonal_win(void) { -void test_valid_move_and_switch_player(void) { +void test_valid_move_and_switch(void) { @@ -272,7 +272,7 @@ void test_valid_input(void) { -void test_invalid_input_type1(void) { +void test_invalid_input_negative_row(void) { @@ -304,7 +304,7 @@ void test_invalid_input_type1(void) { -void test_invalid_input_type2(void) { +void test_invalid_input_overflow_column(void) { @@ -336,7 +336,7 @@ void test_invalid_input_type2(void) { -void test_getNumberOfMoves_returns_correct_number_of_moves(void) { +void test_NumberOfMoves_returns_correct_number_of_moves(void) { @@ -352,7 +352,7 @@ void test_getNumberOfMoves_returns_correct_number_of_moves(void) { - int moves = getNumberOfMoves(&game); + int moves = NumberOfMoves(&game); @@ -420,7 +420,7 @@ void test_BoardFull_returns_true_when_board_is_full(void) { } -void test_getCurrentPlayer_returns_correct_player(void) { +void test_CurrentPlayer_returns_correct_player(void) { @@ -436,7 +436,7 @@ void test_getCurrentPlayer_returns_correct_player(void) { - Player currentPlayer = getCurrentPlayer(&game); + Player currentPlayer = CurrentPlayer(&game); diff --git a/build/test/dependencies/duellist-spielesammlung-projekt.d b/build/test/dependencies/duellist-spielesammlung-projekt.d new file mode 100644 index 0000000..e5d9f35 --- /dev/null +++ b/build/test/dependencies/duellist-spielesammlung-projekt.d @@ -0,0 +1,3 @@ +build/test/out/c/duellist-spielesammlung-projekt.o: \ + src/main/duellist-spielesammlung-projekt.c \ + src/main/duellist-spielesammlung-projekt.h diff --git a/build/test/out/c/duellist-spielesammlung-projekt.o b/build/test/out/c/duellist-spielesammlung-projekt.o new file mode 100644 index 0000000..ca060d1 Binary files /dev/null and b/build/test/out/c/duellist-spielesammlung-projekt.o differ diff --git a/build/test/out/c/test_duellist_spielesammlung_projekt.o b/build/test/out/c/test_duellist_spielesammlung_projekt.o index 7bf0ec4..83a04df 100644 Binary files a/build/test/out/c/test_duellist_spielesammlung_projekt.o and b/build/test/out/c/test_duellist_spielesammlung_projekt.o differ diff --git a/build/test/out/c/test_duellist_spielesammlung_projekt_runner.o b/build/test/out/c/test_duellist_spielesammlung_projekt_runner.o index 02e689f..006b2b4 100644 Binary files a/build/test/out/c/test_duellist_spielesammlung_projekt_runner.o and b/build/test/out/c/test_duellist_spielesammlung_projekt_runner.o differ diff --git a/build/test/out/test_duellist_spielesammlung_projekt.out b/build/test/out/test_duellist_spielesammlung_projekt.out index 8bb26f0..003d98b 100644 Binary files a/build/test/out/test_duellist_spielesammlung_projekt.out and b/build/test/out/test_duellist_spielesammlung_projekt.out differ diff --git a/build/test/preprocess/files/test_duellist_spielesammlung_projekt.c b/build/test/preprocess/files/test_duellist_spielesammlung_projekt.c index 74c99eb..c7841c4 100644 --- a/build/test/preprocess/files/test_duellist_spielesammlung_projekt.c +++ b/build/test/preprocess/files/test_duellist_spielesammlung_projekt.c @@ -16,7 +16,7 @@ void tearDown(void) {} -void test_coinflip_player_x_starts(void) { +void test_coinflip_x_starts(void) { @@ -44,7 +44,7 @@ void test_coinflip_player_x_starts(void) { -void test_coinflip_player_o_starts(void) { +void test_coinflip_o_starts(void) { @@ -166,7 +166,7 @@ void test_diagonal_win(void) { -void test_valid_move_and_switch_player(void) { +void test_valid_move_and_switch(void) { @@ -272,7 +272,7 @@ void test_valid_input(void) { -void test_invalid_input_type1(void) { +void test_invalid_input_negative_row(void) { @@ -304,7 +304,7 @@ void test_invalid_input_type1(void) { -void test_invalid_input_type2(void) { +void test_invalid_input_overflow_column(void) { @@ -336,7 +336,7 @@ void test_invalid_input_type2(void) { -void test_getNumberOfMoves_returns_correct_number_of_moves(void) { +void test_NumberOfMoves_returns_correct_number_of_moves(void) { @@ -352,7 +352,7 @@ void test_getNumberOfMoves_returns_correct_number_of_moves(void) { - int moves = getNumberOfMoves(&game); + int moves = NumberOfMoves(&game); @@ -420,7 +420,7 @@ void test_BoardFull_returns_true_when_board_is_full(void) { } -void test_getCurrentPlayer_returns_correct_player(void) { +void test_CurrentPlayer_returns_correct_player(void) { @@ -436,7 +436,7 @@ void test_getCurrentPlayer_returns_correct_player(void) { - Player currentPlayer = getCurrentPlayer(&game); + Player currentPlayer = CurrentPlayer(&game); diff --git a/build/test/results/test_duellist_spielesammlung_projekt.pass b/build/test/results/test_duellist_spielesammlung_projekt.pass new file mode 100644 index 0000000..1ad831c --- /dev/null +++ b/build/test/results/test_duellist_spielesammlung_projekt.pass @@ -0,0 +1,78 @@ +--- +:source: + :path: src/test + :file: test_duellist_spielesammlung_projekt.c +:successes: +- :test: test_coinflip_x_starts + :line: 11 + :message: '' + :unity_test_time: 0 +- :test: test_coinflip_o_starts + :line: 23 + :message: '' + :unity_test_time: 0 +- :test: test_vertical_win + :line: 35 + :message: '' + :unity_test_time: 0 +- :test: test_horizontal_win + :line: 49 + :message: '' + :unity_test_time: 0 +- :test: test_diagonal_win + :line: 62 + :message: '' + :unity_test_time: 0 +- :test: test_valid_move_and_switch + :line: 76 + :message: '' + :unity_test_time: 0 +- :test: test_invalid_input + :line: 92 + :message: '' + :unity_test_time: 0 +- :test: test_valid_input + :line: 106 + :message: '' + :unity_test_time: 0 +- :test: test_invalid_input_negative_row + :line: 121 + :message: '' + :unity_test_time: 0 +- :test: test_invalid_input_overflow_column + :line: 135 + :message: '' + :unity_test_time: 0 +- :test: test_NumberOfMoves_returns_correct_number_of_moves + :line: 149 + :message: '' + :unity_test_time: 0 +- :test: test_BoardFull_returns_false_when_board_is_not_full + :line: 163 + :message: '' + :unity_test_time: 0 +- :test: test_BoardFull_returns_true_when_board_is_full + :line: 176 + :message: '' + :unity_test_time: 0 +- :test: test_CurrentPlayer_returns_correct_player + :line: 189 + :message: '' + :unity_test_time: 0 +- :test: test_FieldEmpty_returns_true_for_empty_field + :line: 202 + :message: '' + :unity_test_time: 0 +- :test: test_FieldEmpty_returns_false_for_nonempty_field + :line: 215 + :message: '' + :unity_test_time: 0 +:failures: [] +:ignores: [] +:counts: + :total: 16 + :passed: 16 + :failed: 0 + :ignored: 0 +:stdout: [] +:time: 0.04396939999423921 diff --git a/build/test/runners/test_duellist_spielesammlung_projekt_runner.c b/build/test/runners/test_duellist_spielesammlung_projekt_runner.c index f4e3d01..61464f8 100644 --- a/build/test/runners/test_duellist_spielesammlung_projekt_runner.c +++ b/build/test/runners/test_duellist_spielesammlung_projekt_runner.c @@ -10,20 +10,20 @@ char* GlobalOrderError; /*=======External Functions This Runner Calls=====*/ extern void setUp(void); extern void tearDown(void); -extern void test_coinflip_player_x_starts(void); -extern void test_coinflip_player_o_starts(void); +extern void test_coinflip_x_starts(void); +extern void test_coinflip_o_starts(void); extern void test_vertical_win(void); extern void test_horizontal_win(void); extern void test_diagonal_win(void); -extern void test_valid_move_and_switch_player(void); +extern void test_valid_move_and_switch(void); extern void test_invalid_input(void); extern void test_valid_input(void); -extern void test_invalid_input_type1(void); -extern void test_invalid_input_type2(void); -extern void test_getNumberOfMoves_returns_correct_number_of_moves(void); +extern void test_invalid_input_negative_row(void); +extern void test_invalid_input_overflow_column(void); +extern void test_NumberOfMoves_returns_correct_number_of_moves(void); extern void test_BoardFull_returns_false_when_board_is_not_full(void); extern void test_BoardFull_returns_true_when_board_is_full(void); -extern void test_getCurrentPlayer_returns_correct_player(void); +extern void test_CurrentPlayer_returns_correct_player(void); extern void test_FieldEmpty_returns_true_for_empty_field(void); extern void test_FieldEmpty_returns_false_for_nonempty_field(void); @@ -90,20 +90,20 @@ static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE l int main(void) { UnityBegin("test_duellist_spielesammlung_projekt.c"); - run_test(test_coinflip_player_x_starts, "test_coinflip_player_x_starts", 11); - run_test(test_coinflip_player_o_starts, "test_coinflip_player_o_starts", 23); + run_test(test_coinflip_x_starts, "test_coinflip_x_starts", 11); + run_test(test_coinflip_o_starts, "test_coinflip_o_starts", 23); run_test(test_vertical_win, "test_vertical_win", 35); run_test(test_horizontal_win, "test_horizontal_win", 49); run_test(test_diagonal_win, "test_diagonal_win", 62); - run_test(test_valid_move_and_switch_player, "test_valid_move_and_switch_player", 76); + run_test(test_valid_move_and_switch, "test_valid_move_and_switch", 76); run_test(test_invalid_input, "test_invalid_input", 92); run_test(test_valid_input, "test_valid_input", 106); - run_test(test_invalid_input_type1, "test_invalid_input_type1", 121); - run_test(test_invalid_input_type2, "test_invalid_input_type2", 135); - run_test(test_getNumberOfMoves_returns_correct_number_of_moves, "test_getNumberOfMoves_returns_correct_number_of_moves", 149); + run_test(test_invalid_input_negative_row, "test_invalid_input_negative_row", 121); + run_test(test_invalid_input_overflow_column, "test_invalid_input_overflow_column", 135); + run_test(test_NumberOfMoves_returns_correct_number_of_moves, "test_NumberOfMoves_returns_correct_number_of_moves", 149); run_test(test_BoardFull_returns_false_when_board_is_not_full, "test_BoardFull_returns_false_when_board_is_not_full", 163); run_test(test_BoardFull_returns_true_when_board_is_full, "test_BoardFull_returns_true_when_board_is_full", 176); - run_test(test_getCurrentPlayer_returns_correct_player, "test_getCurrentPlayer_returns_correct_player", 189); + run_test(test_CurrentPlayer_returns_correct_player, "test_CurrentPlayer_returns_correct_player", 189); run_test(test_FieldEmpty_returns_true_for_empty_field, "test_FieldEmpty_returns_true_for_empty_field", 202); run_test(test_FieldEmpty_returns_false_for_nonempty_field, "test_FieldEmpty_returns_false_for_nonempty_field", 215); diff --git a/src/main/duellist-spielesammlung-projekt.c b/src/main/duellist-spielesammlung-projekt.c index dbe397a..cc6f212 100644 --- a/src/main/duellist-spielesammlung-projekt.c +++ b/src/main/duellist-spielesammlung-projekt.c @@ -138,10 +138,9 @@ GameResult checkGameResult(const TicTacToeGame* game) { return draw ? GAME_DRAW : SUCCESS; } - -int berechneMinen(int hoehe, int breite) { - int anzahl_minen; - if (hoehe <= 1 || breite <= 1) { +int calculate_mines(int height, int width) { + int num_mines; + if (height <= 1 || width <= 1) { return 0; } else { @@ -180,17 +179,6 @@ void distribute_mines(char** mines, int height, int width, int num_mines) { } } - // Diagonalen Sieg prüfen - if ((game->board[0][0] == game->board[1][1] && game->board[1][1] == game->board[2][2] && game->board[0][0] != EMPTY) || - (game->board[0][2] == game->board[1][1] && game->board[1][1] == game->board[2][0] && game->board[0][2] != EMPTY)) { - return GAME_WIN; - } - - - - - - int minesweeper() { int height, width, row, column; printf("Enter the height of the game field:\n"); diff --git a/src/main/duellist-spielesammlung-projekt.h b/src/main/duellist-spielesammlung-projekt.h index 2f63a3e..53b7127 100644 --- a/src/main/duellist-spielesammlung-projekt.h +++ b/src/main/duellist-spielesammlung-projekt.h @@ -38,18 +38,4 @@ int FieldEmpty(const TicTacToeGame* game, int row, int col); int decideGameType(); Player playRockPaperScissors(); -#endif // DUEELIST_SPIELESAMMLUNG_PROJEKT_ - - - - - - - - - - - - - - +#endif // DUEELIST_SPIELESAMMLUNG_PROJEKT_H \ No newline at end of file