From 3e89ab4c4bb7443cc5db68c1279c656ed3fe4d61 Mon Sep 17 00:00:00 2001 From: "Fred L. Drake, Jr." Date: Tue, 13 Nov 2001 05:04:02 +0000 Subject: [PATCH] Update to work with check 0.8. --- expat/tests/runtests.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index 1cb48890..60fab4fe 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -11,6 +11,8 @@ static void basic_setup(void) { parser = XML_ParserCreate("us-ascii"); + if (parser == NULL) + fail("Parser not created."); } static void @@ -26,9 +28,6 @@ START_TEST(test_nul_byte) { char *text = "\0"; - if (parser == NULL) - fail("Parser not created."); - /* test that a NUL byte (in US-ASCII data) is an error */ if (XML_Parse(parser, text, 12, 1)) fail("Parser did not report error on NUL-byte."); @@ -42,9 +41,6 @@ START_TEST(test_u0000_char) { char *text = ""; - if (parser == NULL) - fail("Parser not created."); - /* test that a NUL byte (in US-ASCII data) is an error */ if (XML_Parse(parser, text, strlen(text), 1)) fail("Parser did not report error on NUL-byte."); @@ -61,9 +57,6 @@ START_TEST(test_xmldecl_misplaced) "\n" "&eee;"; - if (parser == NULL) - fail("Parser not created."); - if (!XML_Parse(parser, text, strlen(text), 1)) { fail_unless(XML_GetErrorCode(parser) == XML_ERROR_MISPLACED_XML_PI, "wrong error when XML declaration is misplaced"); @@ -83,12 +76,12 @@ make_basic_suite(void) TCase *tc_xmldecl = tcase_create("XML declaration"); suite_add_tcase(s, tc_nulls); - tcase_set_fixture(tc_nulls, basic_setup, basic_teardown); + tcase_add_checked_fixture(tc_nulls, basic_setup, basic_teardown); tcase_add_test(tc_nulls, test_nul_byte); tcase_add_test(tc_nulls, test_u0000_char); suite_add_tcase(s, tc_xmldecl); - tcase_set_fixture(tc_xmldecl, basic_setup, basic_teardown); + tcase_add_checked_fixture(tc_xmldecl, basic_setup, basic_teardown); tcase_add_test(tc_xmldecl, test_xmldecl_misplaced); return s; @@ -99,16 +92,16 @@ int main(int argc, char *argv[]) { int nf; - int verbosity = CRNORMAL; + int verbosity = CK_NORMAL; Suite *s = make_basic_suite(); SRunner *sr = srunner_create(s); if (argc >= 2) { char *opt = argv[1]; if (strcmp(opt, "-v") == 0 || strcmp(opt, "--verbose") == 0) - verbosity = CRVERBOSE; + verbosity = CK_VERBOSE; else if (strcmp(opt, "-q") == 0 || strcmp(opt, "--quiet") == 0) - verbosity = CRSILENT; + verbosity = CK_SILENT; } srunner_run_all(sr, verbosity); nf = srunner_ntests_failed(sr); -- 2.40.0