|
|
@ -21,4 +21,21 @@ void test_no_bombs_placed_around_tile(void){ |
|
|
|
TEST_ASSERT_EQUAL_INT(0, result);//no bombs placed |
|
|
|
} |
|
|
|
|
|
|
|
void test_searching_for_bombs_on_correct_tiles(void){ |
|
|
|
/* arrange */ |
|
|
|
int result; |
|
|
|
Minesweeper_Board board = initialize_minesweeper(); |
|
|
|
int tile = 0 + board.width * 1; |
|
|
|
board.bombs[0] = 0 + board.width * 2; |
|
|
|
board.bombs[0] = 2 + board.width * 1; |
|
|
|
board.bombs[0] = board.width - 1 + board.width * 1; |
|
|
|
board.bombs[0] = 0 + board.width * (board.height - 1); |
|
|
|
|
|
|
|
/* act */ |
|
|
|
result = number_of_bombs(&board, tile); |
|
|
|
|
|
|
|
/* assert */ |
|
|
|
TEST_ASSERT_EQUAL_INT(0, result);//no bombs placed around tile |
|
|
|
} |
|
|
|
|
|
|
|
#endif // TEST |