tests: Fix memory leaks in Character tests

This commit is contained in:
Sebastian Krzyszkowiak 2022-07-29 17:08:01 +02:00
parent 67b6a763c3
commit 1d569e9913
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF

View file

@ -76,6 +76,8 @@ static void character_spritesheet_stops(void** state) {
assert_int_equal(character->pos, 2); assert_int_equal(character->pos, 2);
AnimateCharacter(game, character, 0.1, 1.0); AnimateCharacter(game, character, 0.1, 1.0);
assert_int_equal(character->pos, 2); assert_int_equal(character->pos, 2);
DestroyCharacter(game, character);
} }
static void character_spritesheet_reversed_stops(void** state) { static void character_spritesheet_reversed_stops(void** state) {
@ -93,6 +95,8 @@ static void character_spritesheet_reversed_stops(void** state) {
assert_int_equal(character->pos, 0); assert_int_equal(character->pos, 0);
AnimateCharacter(game, character, 0.1, 1.0); AnimateCharacter(game, character, 0.1, 1.0);
assert_int_equal(character->pos, 0); assert_int_equal(character->pos, 0);
DestroyCharacter(game, character);
} }
int test_character(void) { int test_character(void) {