expat/tests runtests.c,1.33,1.34

"Fred L. Drake" <[email protected]>
Newsgroups gmane.text.xml.expat.cvs
Message-ID <[email protected]>
Update of /cvsroot/expat/expat/tests
In directory usw-pr-cvs1:/tmp/cvs-serv29299

Modified Files:
	runtests.c 
Log Message:
Added regression test.
Closes SF bug #600479.


Index: runtests.c
===================================================================
RCS file: /cvsroot/expat/expat/tests/runtests.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- runtests.c	24 Aug 2002 19:53:59 -0000	1.33
+++ runtests.c	27 Aug 2002 17:06:19 -0000	1.34
@@ -210,6 +210,18 @@
 }
 END_TEST
 
+/* Regression test for SF bug #600479.
+   XXX There should be a test that exercises all legal XML Unicode
+   characters as PCDATA and attribute value content, and XML Name
+   characters as part of element and attribute names.
+*/
+START_TEST(test_utf8_false_rejection)
+{
+    char *text = "<doc>\xEF\xBA\xBF</doc>";
+    run_character_check(text, "\xEF\xBA\xBF");
+}
+END_TEST
+
 /* Regression test for SF bug #477667.
    This test assures that any 8-bit character followed by a 7-bit
    character will not be mistakenly interpreted as a valid UTF-8
@@ -424,7 +436,7 @@
 }
 
 static void
-check_attr_contains_normalized_whitespace(void *userdata,
+check_attr_contains_normalized_whitespace(void *userData,
                                           const XML_Char *name,
                                           const XML_Char **atts)
 {
@@ -558,7 +570,7 @@
                        const XML_Char *publicId)
 {
     char *text = (char *)XML_GetUserData(parser);
-    XML_Parser *extparser;
+    XML_Parser extparser;
 
     extparser = XML_ExternalEntityParserCreate(parser, context, NULL);
     if (extparser == NULL)
@@ -780,6 +792,7 @@
     tcase_add_test(tc_basic, test_french_charref_decimal);
     tcase_add_test(tc_basic, test_french_latin1);
     tcase_add_test(tc_basic, test_french_utf8);
+    tcase_add_test(tc_basic, test_utf8_false_rejection);
     tcase_add_test(tc_basic, test_line_count);
     tcase_add_test(tc_basic, test_really_long_lines);
     tcase_add_test(tc_basic, test_end_element_events);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.