From ce694d1eed93a66a1947d269b5073016006cce3a Mon Sep 17 00:00:00 2001 From: Rick Barenthin Date: Sat, 30 Jul 2022 22:58:55 +0200 Subject: [PATCH] test: fix issues in test to fix memleak --- tests/library/hashtable/test_hashtable.c | 6 +----- tests/library/list/test_list.c | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/library/hashtable/test_hashtable.c b/tests/library/hashtable/test_hashtable.c index 9b7c76b..0bd3047 100644 --- a/tests/library/hashtable/test_hashtable.c +++ b/tests/library/hashtable/test_hashtable.c @@ -112,11 +112,7 @@ spec("hashtable") { value *value = value_new(1337); check(value_hashtable_insert(hashtable, key, value) == 0); check(value != NULL, "value should not be NULL"); - //value_destroy(&value); - free(value); - free(value); - value_new(1234); - free(NULL); + value_destroy(&value); } it("should return 0 with NULL as this param") { diff --git a/tests/library/list/test_list.c b/tests/library/list/test_list.c index 08aa488..e63718d 100644 --- a/tests/library/list/test_list.c +++ b/tests/library/list/test_list.c @@ -135,7 +135,7 @@ spec("list") { it("should return 0 with NULL as this param") { value *value = value_new(1); check(value_list_unshift(NULL, value) == 0, "return should not be 0"); - //value_destroy(&value); + value_destroy(&value); } it("should return 0 with NULL as valueElement param") {