aboutsummaryrefslogtreecommitdiff
path: root/tests/test_utils.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2024-08-07 13:52:10 -0400
committerGitHub <noreply@github.com>2024-08-07 13:52:10 -0400
commit1d5e5f26014ceefd824382acec732f326d8d6ce2 (patch)
tree2d329c1a76e1bb5a13a84659465a60d2c6e99cd2 /tests/test_utils.c
parent202e69c8951a38187489c66e994dd593755d62cb (diff)
downloadstasis-1d5e5f26014ceefd824382acec732f326d8d6ce2.tar.gz
Refactor ini getter and setter usage (#19)
* Add handler for space-delimited lists * This needs attention, however. The INI writer has no way to know a list with spaces is a list; this happens in the value conversion functions. * Add type_hint member to INIData structure. At some point support with be added for all INIVAL_TYPE_* defines. Right now it's only used with arrays. * Zero out line buffer in ini_open after each iteration * Do not strip raw INI data. Let the conversion functions handle it * Add spaces to key value pairs in rendered INI output. * Add ini_getvar_TYPE() functions * These replace the functionality of static conv_TYPE() functions in delivery.c * Add support for missing types: U/CHAR, U/SHORT, STRLIST * ini_getval: expand template variables immediately before processing the output * Strip leading space to avoid issues with string comparisons against the result * ini_getval: Return copies, not the original. * This forces one to use ini_setval to replace/append values to the data array(s). It's safer this way. * fix_tox_conf(): Use ini_getval and ini_setval instead of modifying the original pointers directly * Tests: Free resources * Replace ini_getval(), ini_getval_required() and conv_*() usage * Now using ini_getval_TYPE() functions and ini_setval() * Remove unused helper functions and variables * download() returns long, not int * actions: update apt cache
Diffstat (limited to 'tests/test_utils.c')
-rw-r--r--tests/test_utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test_utils.c b/tests/test_utils.c
index 4b19604..9090b05 100644
--- a/tests/test_utils.c
+++ b/tests/test_utils.c
@@ -71,6 +71,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);
remove(result);
guard_free(result);
@@ -106,6 +107,7 @@ void test_xml_pretty_print_in_place() {
STASIS_ASSERT(false, "failed to consume formatted xml file contents");
}
STASIS_ASSERT(strcmp(expected, buf) == 0, "xml file was not reformatted");
+ fclose(fp);
}
void test_path_store() {