settings: Add destructor that wipes contents

This commit is contained in:
Tobias Brunner
2021-10-04 11:30:03 +02:00
parent 57faf886db
commit f3a5b54ab3
3 changed files with 46 additions and 5 deletions
+12 -1
View File
@@ -201,6 +201,13 @@ START_TEST(test_set_default_str)
}
END_TEST
START_TEST(test_destroy_clear)
{
/* just the most basic test as we can't reliably verify it works */
settings->destroy_clear(settings);
}
END_TEST
START_SETUP(setup_bool_config)
{
create_settings(chunk_from_str(
@@ -838,7 +845,6 @@ START_TEST(test_order_section)
}
END_TEST
START_TEST(test_load_string)
{
char *content =
@@ -1654,6 +1660,11 @@ Suite *settings_suite_create()
tcase_add_test(tc, test_set_default_str);
suite_add_tcase(s, tc);
tc = tcase_create("destroy_clear");
tcase_add_checked_fixture(tc, setup_base_config, NULL);
tcase_add_test(tc, test_destroy_clear);
suite_add_tcase(s, tc);
tc = tcase_create("get/set_bool");
tcase_add_checked_fixture(tc, setup_bool_config, teardown_config);
tcase_add_test(tc, test_get_bool);