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