summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-08-08 22:13:23 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2016-08-08 22:13:23 (GMT)
commit958fb6aa5ea5ca93c5b099633ba72ee509a47547 (patch)
tree092b32edd7616b1a67701ea52bef9a53161487b3
parent4448fa6cbf9aade05d02f5e04b9137d4c775a79a (diff)
downloadnetsurf-958fb6aa5ea5ca93c5b099633ba72ee509a47547.tar.gz
netsurf-958fb6aa5ea5ca93c5b099633ba72ee509a47547.tar.bz2
add url databse write output to unit test
-rw-r--r--test/nsoption.c2
-rw-r--r--test/urldbtest.c21
2 files changed, 19 insertions, 4 deletions
diff --git a/test/nsoption.c b/test/nsoption.c
index 0385bf9..cd1213b 100644
--- a/test/nsoption.c
+++ b/test/nsoption.c
@@ -592,7 +592,7 @@ static nserror failing_init_cb(struct nsoption_s *defaults)
}
/**
- * Test default initialisation waith failing callback
+ * Test default initialisation with failing callback
*/
START_TEST(nsoption_api_init_failcb_test)
{
diff --git a/test/urldbtest.c b/test/urldbtest.c
index 457f117..2a50dac 100644
--- a/test/urldbtest.c
+++ b/test/urldbtest.c
@@ -373,7 +373,7 @@ END_TEST
TCase *urldb_original_case_create(void)
{
TCase *tc;
- tc = tcase_create("Original urldb tests");
+ tc = tcase_create("Original_tests");
/* ensure corestrings are initialised and finalised for every test */
tcase_add_checked_fixture(tc,
@@ -388,18 +388,33 @@ TCase *urldb_original_case_create(void)
START_TEST(urldb_session_test)
{
nserror res;
+ char *outnam;
+
+ /* writing output requires options initialising */
+ res = nsoption_init(NULL, NULL, NULL);
+ ck_assert_int_eq(res, NSERROR_OK);
res = urldb_load(test_urldb_path);
ck_assert_int_eq(res, NSERROR_OK);
+ /* write database out */
+ outnam = tmpnam(NULL);
+ res = urldb_save(outnam);
+ ck_assert_int_eq(res, NSERROR_OK);
+
urldb_destroy();
+
+ /* finalise options */
+ res = nsoption_finalise(NULL, NULL);
+ ck_assert_int_eq(res, NSERROR_OK);
+
}
END_TEST
TCase *urldb_session_case_create(void)
{
TCase *tc;
- tc = tcase_create("Full session");
+ tc = tcase_create("Full_session");
/* ensure corestrings are initialised and finalised for every test */
tcase_add_checked_fixture(tc,
@@ -426,7 +441,7 @@ END_TEST
TCase *urldb_api_case_create(void)
{
TCase *tc;
- tc = tcase_create("API checks");
+ tc = tcase_create("API_checks");
tcase_add_test_raise_signal(tc,
urldb_api_add_host_assert_test,