|
@ -62,18 +62,18 @@ void test_TicTacToe_Winner_X_line_3(void) |
|
|
void test_TicTacToe_Winner_O_col_1(void) |
|
|
void test_TicTacToe_Winner_O_col_1(void) |
|
|
{ |
|
|
{ |
|
|
/* arrange */ |
|
|
/* arrange */ |
|
|
int expected = 2; |
|
|
|
|
|
int actual; |
|
|
|
|
|
char board[3][3] = { |
|
|
|
|
|
{'O', 'X', 'X'}, |
|
|
|
|
|
{'O', 'O', '_'}, |
|
|
|
|
|
{'O', '_', '_'} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
int expected = 2; |
|
|
|
|
|
int actual; |
|
|
|
|
|
char board[3][3] = { |
|
|
|
|
|
{'O', 'X', 'X'}, |
|
|
|
|
|
{'O', 'O', '_'}, |
|
|
|
|
|
{'O', '_', '_'} |
|
|
|
|
|
}; |
|
|
/* act */ |
|
|
/* act */ |
|
|
actual = Winner(board); |
|
|
|
|
|
|
|
|
actual = Winner(board); |
|
|
|
|
|
|
|
|
/* assert */ |
|
|
/* assert */ |
|
|
TEST_ASSERT_EQUAL_INT(expected, actual); |
|
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_INT(expected, actual); |
|
|
} |
|
|
} |
|
|
void test_TicTacToe_Winner_X_col_2(void) |
|
|
void test_TicTacToe_Winner_X_col_2(void) |
|
|
{ |
|
|
{ |
|
@ -154,4 +154,20 @@ void test_TicTacToe_mid_Round(void) |
|
|
|
|
|
|
|
|
/* assert */ |
|
|
/* assert */ |
|
|
TEST_ASSERT_EQUAL_INT(expected, actual); |
|
|
TEST_ASSERT_EQUAL_INT(expected, actual); |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
void test_TicTacToe_Tie(void) |
|
|
|
|
|
{ |
|
|
|
|
|
/* arrange */ |
|
|
|
|
|
int expected = 0; |
|
|
|
|
|
int actual; |
|
|
|
|
|
char board[3][3] = { |
|
|
|
|
|
{'X', 'X', 'O'}, |
|
|
|
|
|
{'O', 'O', 'X'}, |
|
|
|
|
|
{'X', 'X', 'O'} |
|
|
|
|
|
}; |
|
|
|
|
|
/* act */ |
|
|
|
|
|
actual = Winner(board); |
|
|
|
|
|
|
|
|
|
|
|
/* assert */ |
|
|
|
|
|
TEST_ASSERT_EQUAL_INT(expected, actual); |
|
|
|
|
|
} |