|
@ -59,7 +59,19 @@ void test_horizontal_win(void) { |
|
|
// Assert |
|
|
// Assert |
|
|
TEST_ASSERT_EQUAL(GAME_WIN, result); |
|
|
TEST_ASSERT_EQUAL(GAME_WIN, result); |
|
|
} |
|
|
} |
|
|
|
|
|
void test_diagonal_win(void) { |
|
|
|
|
|
// Arrange |
|
|
|
|
|
TicTacToeGame game = { .board = {{PLAYER_X, EMPTY, EMPTY}, |
|
|
|
|
|
{EMPTY, PLAYER_X, EMPTY}, |
|
|
|
|
|
{EMPTY, EMPTY, PLAYER_X}}, |
|
|
|
|
|
.currentPlayer = PLAYER_O }; |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
|
|
|
GameResult result = checkGameResult(&game); |
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
|
|
TEST_ASSERT_EQUAL(GAME_WIN, result); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|