Browse Source

Test wall_collision

remotes/origin/David
David Moeller 11 months ago
parent
commit
819208c1e9
  1. 13
      test/Snake/test_collision.c

13
test/Snake/test_collision.c

@ -34,4 +34,17 @@ void test_no_collision(void){
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
Loading…
Cancel
Save