summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorfdrake <fdrake>2003-11-02 08:12:46 +0000
committerfdrake <fdrake>2003-11-02 08:12:46 +0000
commit534cc198e4acc8762d8d30ddc668abf04421199a (patch)
tree2ba37e2c3c954353bca626df28878cfa18960d83 /tests
parent5a6efac4e7768f501dc8164cf169e60f67ee710c (diff)
downloadlibexpat-534cc198e4acc8762d8d30ddc668abf04421199a.tar.gz
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
Diffstat (limited to 'tests')
-rw-r--r--tests/runtests.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/runtests.c b/tests/runtests.c
index ac968a9..7df109a 100644
--- a/tests/runtests.c
+++ b/tests/runtests.c
@@ -952,6 +952,24 @@ START_TEST(test_empty_ns_without_namespaces)
}
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 @@ make_suite(void)
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,