diff options
author | sanine <sanine.not@pm.me> | 2022-08-31 00:14:50 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-08-31 00:14:50 -0500 |
commit | b4db9391540442f9708388731d5bcd6fc59b6f5c (patch) | |
tree | c711b9d0316ca057c51faee92b71e3b4094f4076 /src | |
parent | 26952167e940e900cd0e1fa7452c4f163640cbe3 (diff) |
fix memory leaks in test
Diffstat (limited to 'src')
-rw-r--r-- | src/channel.test.c | 4 | ||||
-rw-r--r-- | src/sound.test.c | 3 | ||||
-rw-r--r-- | src/test/mossrose-test.c | 1 |
3 files changed, 6 insertions, 2 deletions
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; } |