diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2015-07-19 15:42:00 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2015-08-03 22:30:20 +0100 |
commit | 093e64c448108483fb1c8f5bccc13d12b547550c (patch) | |
tree | b995acf0043f3ad3db9d89028e5e71fd98e6a136 /test | |
parent | 0b624c7fba92d74858746328888548d28b55f84a (diff) | |
download | libnslayout-093e64c448108483fb1c8f5bccc13d12b547550c.tar.gz libnslayout-093e64c448108483fb1c8f5bccc13d12b547550c.tar.bz2 |
Add nslayout_layout_destroy basic API testing.
Diffstat (limited to 'test')
-rw-r--r-- | test/assert-tests.c | 13 | ||||
-rw-r--r-- | test/basic-layout-tests.c | 13 |
2 files changed, 20 insertions, 6 deletions
diff --git a/test/assert-tests.c b/test/assert-tests.c index 4fca036..1b97814 100644 --- a/test/assert-tests.c +++ b/test/assert-tests.c @@ -22,16 +22,27 @@ START_TEST (test_nslayout_layout_create_aborts1) } END_TEST +/* TODO: Test for each individual param being NULL. */ +START_TEST (test_nslayout_layout_destroy_aborts1) +{ + (void) nslayout_layout_destroy(NULL); +} +END_TEST + void nslayout_assert_suite(SRunner *sr) { Suite *s = suite_create("libnslayout: API Assert tests"); - TCase *tc_assert = tcase_create("Creation/Destruction"); + TCase *tc_assert = tcase_create("Creation/Destruction"); tcase_add_test_raise_signal( tc_assert, test_nslayout_layout_create_aborts1, SIGABRT); + tcase_add_test_raise_signal( + tc_assert, + test_nslayout_layout_destroy_aborts1, + SIGABRT); suite_add_tcase(s, tc_assert); srunner_add_suite(sr, s); diff --git a/test/basic-layout-tests.c b/test/basic-layout-tests.c index 84611a9..6dec991 100644 --- a/test/basic-layout-tests.c +++ b/test/basic-layout-tests.c @@ -52,11 +52,15 @@ START_TEST (test_nslayout_layout_create_ok) nslayout_test_callback, &pw, &layout); - fail_unless(error == NSLAYOUT_OK, + fail_unless(error == NSLAYOUT_OK, "Unable to create layout"); - fail_unless(layout != NULL, + fail_unless(layout != NULL, "Returned OK but str was still NULL"); + error = nslayout_layout_destroy(layout); + fail_unless(error == NSLAYOUT_OK, + "Unable to destroy layout"); + css_err = css_select_ctx_destroy(css_ctx); ck_assert(css_err == CSS_OK); @@ -68,10 +72,9 @@ END_TEST void nslayout_basic_layout_suite(SRunner *sr) { Suite *s = suite_create("libnslayout: basic layout tests"); - TCase *tc_layout_basic = tcase_create("Creation/Destruction"); + TCase *tc_layout_basic = tcase_create("Creation/Destruction"); - tcase_add_test(tc_layout_basic, - test_nslayout_layout_create_ok); + tcase_add_test(tc_layout_basic, test_nslayout_layout_create_ok); suite_add_tcase(s, tc_layout_basic); srunner_add_suite(sr, s); |