diff options
Diffstat (limited to 'tests/interpretation.c')
-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); |