|
|
@ -38,4 +38,18 @@ void test_moving_down(void){ |
|
|
|
TEST_ASSERT_TRUE(result); |
|
|
|
} |
|
|
|
|
|
|
|
void test_moving_left(void){ |
|
|
|
/* arrange */ |
|
|
|
bool result; |
|
|
|
Snake snake = {-1, 3, {8 + 16 * 6, 7 + 16 * 6, 6 + 16 * 6}}; |
|
|
|
Snake expected = {-1, 3, {7 + 16 * 6, 8 + 16 * 6, 7 + 16 * 6}}; |
|
|
|
|
|
|
|
/* act */ |
|
|
|
move_snake(&snake); |
|
|
|
result = memcmp(&snake, &expected, sizeof(Snake)) == 0; |
|
|
|
|
|
|
|
/* assert */ |
|
|
|
TEST_ASSERT_TRUE(result); |
|
|
|
} |
|
|
|
|
|
|
|
#endif // TEST |