|
|
@ -12,7 +12,7 @@ void tearDown(void){} |
|
|
|
void test_self_collision(void){ |
|
|
|
/* arrange */ |
|
|
|
bool result; |
|
|
|
Snake snake = {{1, 0}, 5, {6 + 16 * 6, 6 + 16 * 7, 7 + 16 * 7, 7 + 16 * 6, 6 + 16 * 6}}; |
|
|
|
Snake snake = {1, 5, {6 + 16 * 6, 6 + 16 * 7, 7 + 16 * 7, 7 + 16 * 6, 6 + 16 * 6}}; |
|
|
|
|
|
|
|
/* act */ |
|
|
|
result = check_if_dead(&snake); |
|
|
@ -38,7 +38,7 @@ void test_no_collision(void){ |
|
|
|
void test_wall_collision(void){ |
|
|
|
/* arrange */ |
|
|
|
bool result; |
|
|
|
Snake snake = {{1, 0}, 4, {0 + 16 * 6, 1 + 16 * 6, 2 + 16 * 6, 3 + 16 * 6}}; |
|
|
|
Snake snake = {-1, 4, {0 + 16 * 6, 1 + 16 * 6, 2 + 16 * 6, 3 + 16 * 6}}; |
|
|
|
|
|
|
|
/* act */ |
|
|
|
result = check_if_dead(&snake); |
|
|
|