From b4db9391540442f9708388731d5bcd6fc59b6f5c Mon Sep 17 00:00:00 2001 From: sanine Date: Wed, 31 Aug 2022 00:14:50 -0500 Subject: fix memory leaks in test --- src/channel.test.c | 4 +++- src/sound.test.c | 3 +++ src/test/mossrose-test.c | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/channel.test.c b/src/channel.test.c index 789756d..c0a7e73 100644 --- a/src/channel.test.c +++ b/src/channel.test.c @@ -18,7 +18,7 @@ lily_mock_t *mock_p_mutex_new = NULL; PMutex * mock_p_mutex_new_() { mock_p_mutex_new->n_calls += 1; - return p_mutex_new(); + return NULL; } @@ -481,4 +481,6 @@ void suite_channel() lily_run_test(test_channel_get_next_sample_panned); lily_mock_destroy(mock_p_mutex_new); + lily_mock_destroy(mock_p_mutex_trylock); + lily_mock_destroy(mock_p_mutex_unlock); } diff --git a/src/sound.test.c b/src/sound.test.c index 60dcdd1..01cb2dc 100644 --- a/src/sound.test.c +++ b/src/sound.test.c @@ -22,6 +22,9 @@ void test_sound_copy() lily_assert_memory_equal(dest.left, left, 3*sizeof(float)); lily_assert_not_null(dest.right); lily_assert_memory_equal(dest.right, right, 3*sizeof(float)); + + free(dest.left); + free(dest.right); } diff --git a/src/test/mossrose-test.c b/src/test/mossrose-test.c index e71fc2a..238eca1 100644 --- a/src/test/mossrose-test.c +++ b/src/test/mossrose-test.c @@ -4,7 +4,6 @@ int main() { - p_libsys_init(); RUN_TESTS() return 0; } -- cgit v1.2.1