diff options
| -rw-r--r-- | tests/test_ini.c | 2 | ||||
| -rw-r--r-- | tests/test_str.c | 2 | 
2 files changed, 4 insertions, 0 deletions
| diff --git a/tests/test_ini.c b/tests/test_ini.c index 2579e21..e4a7808 100644 --- a/tests/test_ini.c +++ b/tests/test_ini.c @@ -86,11 +86,13 @@ void test_ini_setval_getval() {      STASIS_ASSERT(ini_getval(ini, "default", "a", INIVAL_TYPE_STR, render_mode, &val) == 0, "failed to get value");      STASIS_ASSERT(strcmp(val.as_char_p, "a") != 0, "unexpected value loaded from modified variable");      STASIS_ASSERT(strcmp(val.as_char_p, "changed") == 0, "unexpected value loaded from modified variable"); +    guard_free(val.as_char_p);      STASIS_ASSERT(ini_setval(&ini, INI_SETVAL_APPEND, "default", "a", " twice") == 0, "failed to set value");      STASIS_ASSERT(ini_getval(ini, "default", "a", INIVAL_TYPE_STR, render_mode, &val) == 0, "failed to get value");      STASIS_ASSERT(strcmp(val.as_char_p, "changed") != 0, "unexpected value loaded from modified variable");      STASIS_ASSERT(strcmp(val.as_char_p, "changed twice") == 0, "unexpected value loaded from modified variable"); +    guard_free(val.as_char_p);      ini_free(&ini);      remove(filename);  } diff --git a/tests/test_str.c b/tests/test_str.c index 85c3b78..f8aa1e9 100644 --- a/tests/test_str.c +++ b/tests/test_str.c @@ -79,6 +79,7 @@ void test_strdup_array_and_strcmp_array() {      for (size_t outer = 0; outer < sizeof(tc) / sizeof(*tc); outer++) {          char **result = strdup_array((char **) tc[outer].data);          STASIS_ASSERT(strcmp_array((const char **) result, tc[outer].expected) == 0, "array members were different"); +        GENERIC_ARRAY_FREE(result);      }      const struct testcase tc_bad[] = { @@ -94,6 +95,7 @@ void test_strdup_array_and_strcmp_array() {      for (size_t outer = 0; outer < sizeof(tc_bad) / sizeof(*tc_bad); outer++) {          char **result = strdup_array((char **) tc_bad[outer].data);          STASIS_ASSERT(strcmp_array((const char **) result, tc_bad[outer].expected) != 0, "array members were identical"); +        GENERIC_ARRAY_FREE(result);      }  } | 
