|
|
@ -0,0 +1,25 @@ |
|
|
|
#ifdef TEST |
|
|
|
#include "unity.h" |
|
|
|
#include <stdbool.h> |
|
|
|
#include "../../src/main/c/Minesweeper/minesweeper_start.h" |
|
|
|
|
|
|
|
|
|
|
|
void setUp(void){} |
|
|
|
void tearDown(void){} |
|
|
|
|
|
|
|
|
|
|
|
void test_bomb_in_array(void){ |
|
|
|
/* arrange */ |
|
|
|
bool result; |
|
|
|
int array[] = {5, 9, 42, 6, 87, 95, 202, 13, 45 ,78}; |
|
|
|
int bomb = 42; |
|
|
|
int length = 10; |
|
|
|
|
|
|
|
/* act */ |
|
|
|
result = bomb_in_array(array, bomb, length); |
|
|
|
|
|
|
|
/* assert */ |
|
|
|
TEST_ASSERT_TRUE(result);//head collides with body |
|
|
|
} |
|
|
|
|
|
|
|
#endif // TEST |