expat/tests runtests.c,1.46,1.47

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

Modified Files:
	runtests.c 
Log Message:
Added regression tests for SF bug #673791.

Index: runtests.c
===================================================================
RCS file: /cvsroot/expat/expat/tests/runtests.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- runtests.c	25 Jan 2003 04:57:44 -0000	1.46
+++ runtests.c	25 Jan 2003 06:55:25 -0000	1.47
@@ -1171,6 +1171,34 @@
 }
 END_TEST
 
+/* Regression test #1 for SF bug #673791. */
+START_TEST(test_ns_prefix_with_empty_uri_1)
+{
+    char *text =
+        "<doc xmlns:prefix='http://xml.libexpat.org/'>\n"
+        "  <e xmlns:prefix=''/>\n"
+        "</doc>";
+
+    expect_failure(text,
+                   XML_ERROR_SYNTAX,
+                   "Did not report re-setting namespace"
+                   " URI with prefix to ''.");
+}
+END_TEST
+
+/* Regression test #2 for SF bug #673791. */
+START_TEST(test_ns_prefix_with_empty_uri_2)
+{
+    char *text =
+        "<?xml version='1.0'?>\n"
+        "<docelem xmlns:pre=''/>";
+
+    expect_failure(text,
+                   XML_ERROR_SYNTAX,
+                   "Did not report setting namespace URI with prefix to ''.");
+}
+END_TEST
+
 START_TEST(test_ns_default_with_empty_uri)
 {
     char *text =
@@ -1238,6 +1266,8 @@
     tcase_add_test(tc_namespace, test_ns_tagname_overwrite_triplet);
     tcase_add_test(tc_namespace, test_start_ns_clears_start_element);
     tcase_add_test(tc_namespace, test_default_ns_from_ext_subset_and_ext_ge);
+    tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_1);
+    tcase_add_test(tc_namespace, test_ns_prefix_with_empty_uri_2);
     tcase_add_test(tc_namespace, test_ns_default_with_empty_uri);
 
     return s;
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.