[Expat-checkins] expat/tests runtests.c,1.54,1.55

Fred L. Drake fdrake at users.sourceforge.net
Sun Nov 2 03:12:49 EST 2003


Update of /cvsroot/expat/expat/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv23590

Modified Files:
	runtests.c 
Log Message:
added regression test for SF bug #824420:
in non-namespace mode, Expat reported the use of an unbound namespace
when encountering an element that looks like it has a namespace prefix
(were namespaces enabled) and there's a definition for that prefix in
the DTD


Index: runtests.c
===================================================================
RCS file: /cvsroot/expat/expat/tests/runtests.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- runtests.c	16 Oct 2003 04:51:11 -0000	1.54
+++ runtests.c	2 Nov 2003 08:12:46 -0000	1.55
@@ -952,6 +952,24 @@
 }
 END_TEST
 
+/* Regression test for SF bug #824420.
+   Checks that an xmlns:prefix attribute set in an attribute's default
+   value isn't misinterpreted.
+*/
+START_TEST(test_ns_in_attribute_default_without_namespaces)
+{
+    char *text =
+        "<!DOCTYPE e:element [\n"
+        "  <!ATTLIST e:element\n"
+        "    xmlns:e CDATA 'http://example.com/'>\n"
+        "      ]>\n"
+        "<e:element/>";
+
+    if (XML_Parse(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
+        xml_failure(parser);
+}
+END_TEST
+
 
 /*
  * Namespaces tests.
@@ -1349,6 +1367,7 @@
     tcase_add_test(tc_basic, test_ext_entity_set_encoding);
     tcase_add_test(tc_basic, test_dtd_default_handling);
     tcase_add_test(tc_basic, test_empty_ns_without_namespaces);
+    tcase_add_test(tc_basic, test_ns_in_attribute_default_without_namespaces);
 
     suite_add_tcase(s, tc_namespace);
     tcase_add_checked_fixture(tc_namespace,





More information about the Expat-checkins mailing list