From 819208c1e918231b110f60009eee50262b58889e Mon Sep 17 00:00:00 2001 From: David Moeller Date: Thu, 25 Jan 2024 10:04:07 +0100 Subject: [PATCH] Test wall_collision --- test/Snake/test_collision.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/Snake/test_collision.c b/test/Snake/test_collision.c index d0edd61..b70676d 100644 --- a/test/Snake/test_collision.c +++ b/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 \ No newline at end of file