aboutsummaryrefslogtreecommitdiff
path: root/tests/test_str.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_str.c')
-rw-r--r--tests/test_str.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_str.c b/tests/test_str.c
index 85c3b78..4991c1c 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);
}
}
@@ -242,7 +244,7 @@ void test_join_ex() {
};
for (size_t i = 0; i < sizeof(tc) / sizeof(*tc); i++) {
char *result;
- result = join_ex(tc[i].delim, "a", "b", "c", "d", "e", NULL);
+ result = join_ex((char *) tc[i].delim, "a", "b", "c", "d", "e", NULL);
STASIS_ASSERT(strcmp(result ? result : "", tc[i].expected) == 0, "failed to join array");
guard_free(result);
}