From d701da0bd56e382c9a267f6a3aa998ecf8726adc Mon Sep 17 00:00:00 2001 From: "Fred L. Drake, Jr." Date: Thu, 25 Apr 2002 01:42:34 +0000 Subject: [PATCH] Make the organization slightly easier to discern. --- expat/tests/runtests.c | 49 ++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index ba91f79c..79e60e54 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -44,6 +44,11 @@ _xml_failure(const char *file, int line) #define xml_failure() _xml_failure(__FILE__, __LINE__) + +/* + * Character & encoding tests. + */ + START_TEST(test_nul_byte) { char text[] = "\0"; @@ -69,24 +74,6 @@ START_TEST(test_u0000_char) } END_TEST - -START_TEST(test_xmldecl_misplaced) -{ - char *text = - "\n" - "\n" - "&eee;"; - - if (!XML_Parse(parser, text, strlen(text), 1)) { - if (XML_GetErrorCode(parser) != XML_ERROR_MISPLACED_XML_PI) - xml_failure(); - } - else { - fail("expected XML_ERROR_MISPLACED_XML_PI with misplaced XML decl"); - } -} -END_TEST - START_TEST(test_bom_utf8) { /* This test is really just making sure we don't core on a UTF-8 BOM. */ @@ -311,6 +298,10 @@ START_TEST(test_latin1_umlauts) END_TEST +/* + * Attribute tests. + */ + /* Helpers used by the following test; this checks any "attr" and "refs" * attributes to make sure whitespace has been normalized. */ @@ -420,6 +411,28 @@ START_TEST(test_attr_whitespace_normalization) END_TEST +/* + * XML declaration tests. + */ + +START_TEST(test_xmldecl_misplaced) +{ + char *text = + "\n" + "\n" + "&eee;"; + + if (!XML_Parse(parser, text, strlen(text), 1)) { + if (XML_GetErrorCode(parser) != XML_ERROR_MISPLACED_XML_PI) + xml_failure(); + } + else { + fail("expected XML_ERROR_MISPLACED_XML_PI with misplaced XML decl"); + } +} +END_TEST + + /* * Namespaces tests. */ -- 2.40.0