From d0815e2b02b4f110fa140dd124cc0f5f236be05a Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 7 Jul 2025 17:40:51 -0400 Subject: Test for ini_getall() --- tests/test_ini.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/test_ini.c b/tests/test_ini.c index e4a7808..af47ddf 100644 --- a/tests/test_ini.c +++ b/tests/test_ini.c @@ -195,6 +195,23 @@ void test_ini_getval_wrappers() { ini_free(&ini); } +void test_ini_getall() { + const char *filename = "ini_open.ini"; + struct INIFILE *ini = NULL; + const char *data = "[default]\nhello=world!\nthis=is a test\nx=1\ny=0\n"; + + stasis_testing_write_ascii(filename, data); + ini = ini_open(filename); + STASIS_ASSERT_FATAL(ini != NULL, "failed to open ini file"); + + const struct INIData *d = NULL; + for (size_t i = 0; (d = ini_getall(ini, "default")) != NULL; i++) { + STASIS_ASSERT(d->key != NULL, "INIData key should not be NULL"); + STASIS_ASSERT(d->value != NULL, "INIData key should not be NULL"); + } + ini_free(&ini); +} + int main(int argc, char *argv[]) { STASIS_TEST_BEGIN_MAIN(); STASIS_TEST_FUNC *tests[] = { @@ -204,6 +221,7 @@ int main(int argc, char *argv[]) { test_ini_has_key, test_ini_setval_getval, test_ini_getval_wrappers, + test_ini_getall, }; STASIS_TEST_RUN(tests); STASIS_TEST_END_MAIN(); -- cgit From 1209bdcc6e6131d12fc0923d771e14d9d65635e2 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 7 Jul 2025 19:08:35 -0400 Subject: Fix leak in artifactory test --- tests/test_artifactory.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/test_artifactory.c b/tests/test_artifactory.c index 4af7eec..202a67c 100644 --- a/tests/test_artifactory.c +++ b/tests/test_artifactory.c @@ -116,6 +116,7 @@ int main(int argc, char *argv[]) { // Skip this suite if we're not configured to use it if (jfrt_auth_init(&gauth)) { SYSERROR("%s", "Not configured to test Artifactory. Skipping."); + guard_free(basedir); return STASIS_TEST_SUITE_SKIP; } guard_free(basedir); -- cgit From 5692c689a7b1da67724fc5c3c9bb3f3f1d7df0c9 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 8 Jul 2025 13:55:52 -0400 Subject: Enable debug messages in RT --- tests/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/setup.sh b/tests/setup.sh index 7e38cf9..41d8d49 100644 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -78,7 +78,7 @@ teardown_workspace() { install_stasis() { pushd "$BUILD_DIR" - if ! cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" -DCMAKE_BUILD_TYPE=Debug "${TOPDIR}"/../..; then + if ! cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" -DCMAKE_BUILD_TYPE=Debug -DDEBUG_MESSAGES=ON "${TOPDIR}"/../..; then echo "cmake failed" >&2 return 1 fi -- cgit From 1e572f3a653ddd6385a0ea49cacfbf2f3a32ce87 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 8 Jul 2025 14:27:45 -0400 Subject: Increase lines_on_error from 100 to 1000 * Debug messages are chatty --- tests/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/setup.sh b/tests/setup.sh index 41d8d49..bce2fbd 100644 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -109,7 +109,7 @@ STASIS_TEST_RESULT_SKIP=0 run_command() { local logfile="$(mktemp).log" local cmd="${@}" - local lines_on_error=100 + local lines_on_error=1000 /bin/echo "Testing: $cmd " $cmd &>"$logfile" -- cgit