diff options
author | pommicket <pommicket@gmail.com> | 2025-09-15 22:00:24 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-09-15 22:00:24 -0400 |
commit | 2fc802b267092ad647672bcbfcd31f0117eec27c (patch) | |
tree | 9b45ae643adfba9e23e761599d5d8240f6ed3180 /tests | |
parent | b93385c0fded8d6c232267a8bd9293153baea777 (diff) |
Switch back to `pom_error` for typed get functions
Diffstat (limited to 'tests')
-rw-r--r-- | tests/interpretation.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/interpretation.c b/tests/interpretation.c index bdae290..26846a1 100644 --- a/tests/interpretation.c +++ b/tests/interpretation.c @@ -26,9 +26,10 @@ void test_interpretation(void) { if (strstr(conf_path, "uint.pom")) { uint64_t val, val2; while ((key = pom_conf_next_key(bad, &iter))) { - if (!pom_conf_get_uint(bad, key, &val)) { + if (!(error = pom_conf_get_uint(bad, key, &val))) { test_fail("Key %s should be rejected as a uint", key); } + free(error); } while ((key = pom_conf_next_key(good, &iter))) { const pom_conf *section = pom_conf_section(good, key); @@ -49,9 +50,10 @@ void test_interpretation(void) { } else if (strstr(conf_path, "int.pom")) { int64_t val, val2; while ((key = pom_conf_next_key(bad, &iter))) { - if (!pom_conf_get_int(bad, key, &val)) { + if (!(error = pom_conf_get_int(bad, key, &val))) { test_fail("Key %s should be rejected as an int", key); } + free(error); } while ((key = pom_conf_next_key(good, &iter))) { const pom_conf *section = pom_conf_section(good, key); @@ -72,9 +74,10 @@ void test_interpretation(void) { } else if (strstr(conf_path, "float.pom")) { double val, val2; while ((key = pom_conf_next_key(bad, &iter))) { - if (!pom_conf_get_float(bad, key, &val)) { + if (!(error = pom_conf_get_float(bad, key, &val))) { test_fail("Key %s should be rejected as a float", key); } + free(error); } while ((key = pom_conf_next_key(good, &iter))) { const pom_conf *section = pom_conf_section(good, key); @@ -95,9 +98,10 @@ void test_interpretation(void) { } else if (strstr(conf_path, "bool.pom")) { bool val, val2; while ((key = pom_conf_next_key(bad, &iter))) { - if (!pom_conf_get_bool(bad, key, &val)) { + if (!(error = pom_conf_get_bool(bad, key, &val))) { test_fail("Key %s should be rejected as a bool", key); } + free(error); } while ((key = pom_conf_next_key(good, &iter))) { const pom_conf *section = pom_conf_section(good, key); |