diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_environment.c | 2 | ||||
-rw-r--r-- | tests/test_str.c | 8 | ||||
-rw-r--r-- | tests/test_utils.c | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/tests/test_environment.c b/tests/test_environment.c index 43c3672..4f36883 100644 --- a/tests/test_environment.c +++ b/tests/test_environment.c @@ -20,7 +20,7 @@ void test_runtime_copy_empty() { char **empty_env = calloc(1, sizeof(empty_env)); RuntimeEnv *env = runtime_copy(empty_env); STASIS_ASSERT(env->num_inuse == 0, "copied array isn't empty"); - GENERIC_ARRAY_FREE(empty_env); + guard_array_free(empty_env); runtime_free(env); } diff --git a/tests/test_str.c b/tests/test_str.c index 3aea50b..ad0c07a 100644 --- a/tests/test_str.c +++ b/tests/test_str.c @@ -79,7 +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); + guard_array_free(result); } const struct testcase tc_bad[] = { @@ -95,7 +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); + guard_array_free(result); } } @@ -206,7 +206,7 @@ void test_split() { for (size_t i = 0; i < sizeof(tc) / sizeof(*tc); i++) { char **result = split((char *) tc[i].data, tc[i].delim, tc[i].max_split); STASIS_ASSERT(strcmp_array((const char **) result, tc[i].expected) == 0, "Split failed"); - GENERIC_ARRAY_FREE(result); + guard_array_free(result); } } @@ -289,7 +289,7 @@ void test_strdeldup() { for (size_t i = 0; i < sizeof(tc) / sizeof(*tc); i++) { char **result = strdeldup(tc[i].data); STASIS_ASSERT(strcmp_array((const char **) result, tc[i].expected) == 0, "incorrect number of duplicates removed"); - GENERIC_ARRAY_FREE(result); + guard_array_free(result); } } diff --git a/tests/test_utils.c b/tests/test_utils.c index 8f0a667..0e2eb7b 100644 --- a/tests/test_utils.c +++ b/tests/test_utils.c @@ -72,7 +72,7 @@ void test_fix_tox_conf() { char **lines = file_readlines(result, 0, 0, NULL); STASIS_ASSERT(strstr_array(lines, expected) != NULL, "{posargs} not found in result"); - GENERIC_ARRAY_FREE(lines); + guard_array_free(lines); remove(result); guard_free(result); @@ -283,15 +283,15 @@ void test_file_readlines() { for (i = 0; result[i] != NULL; i++); STASIS_ASSERT(num_chars(data, '\n') == i, "incorrect number of lines in data"); STASIS_ASSERT(strcmp(result[3], "see?\n") == 0, "last line in data is incorrect'"); - GENERIC_ARRAY_FREE(result); + guard_array_free(result); result = file_readlines(filename, 0, 0, file_readlines_callback_modify); STASIS_ASSERT(strcmp(result[3], "xxx?\n") == 0, "last line should be: 'xxx?\\n'"); - GENERIC_ARRAY_FREE(result); + guard_array_free(result); result = file_readlines(filename, 0, 0, file_readlines_callback_get_specific_line); STASIS_ASSERT(strcmp(result[0], "see?\n") == 0, "the first record of the result is not the last line of the file 'see?\\n'"); - GENERIC_ARRAY_FREE(result); + guard_array_free(result); remove(filename); } |