test: fix issues in test to fix memleak
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Rick Barenthin 2022-07-30 22:58:55 +02:00 committed by Gitea
parent 6d84807cc8
commit ce694d1eed
2 changed files with 2 additions and 6 deletions

View File

@ -112,11 +112,7 @@ spec("hashtable") {
value *value = value_new(1337); value *value = value_new(1337);
check(value_hashtable_insert(hashtable, key, value) == 0); check(value_hashtable_insert(hashtable, key, value) == 0);
check(value != NULL, "value should not be NULL"); check(value != NULL, "value should not be NULL");
//value_destroy(&value); value_destroy(&value);
free(value);
free(value);
value_new(1234);
free(NULL);
} }
it("should return 0 with NULL as this param") { it("should return 0 with NULL as this param") {

View File

@ -135,7 +135,7 @@ spec("list") {
it("should return 0 with NULL as this param") { it("should return 0 with NULL as this param") {
value *value = value_new(1); value *value = value_new(1);
check(value_list_unshift(NULL, value) == 0, "return should not be 0"); 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") { it("should return 0 with NULL as valueElement param") {