aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2025-07-08 15:50:20 -0400
committerGitHub <noreply@github.com>2025-07-08 15:50:20 -0400
commitd90493618ce34a732c5411d1670be57d4dd9db4e (patch)
tree99719cf91d7faaf8ad37ef70d3baaaf3ce316176 /tests
parente90140a7628d24edef090e548179c64170d3338b (diff)
parent1e572f3a653ddd6385a0ea49cacfbf2f3a32ce87 (diff)
downloadstasis-d90493618ce34a732c5411d1670be57d4dd9db4e.tar.gz
Merge pull request #116 from jhunkeler/breakdown
Breakdown & Bug fixes
Diffstat (limited to 'tests')
-rw-r--r--tests/setup.sh4
-rw-r--r--tests/test_artifactory.c1
-rw-r--r--tests/test_ini.c18
3 files changed, 21 insertions, 2 deletions
diff --git a/tests/setup.sh b/tests/setup.sh
index 7e38cf9..bce2fbd 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
@@ -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"
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);
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();