|
@ -34,4 +34,17 @@ void test_no_collision(void){ |
|
|
TEST_ASSERT_FALSE(result);//head collides with body |
|
|
TEST_ASSERT_FALSE(result);//head collides with body |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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}}; |
|
|
|
|
|
|
|
|
|
|
|
/* act */ |
|
|
|
|
|
result = check_if_dead(&snake); |
|
|
|
|
|
|
|
|
|
|
|
/* assert */ |
|
|
|
|
|
TEST_ASSERT_TRUE(result);//head collides with body |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
#endif // TEST |
|
|
#endif // TEST |