]> granicus.if.org Git - libexpat/commitdiff
Test Entity declaration marked PUBLIC with no ID
authorRhodri James <rhodri@kynesim.co.uk>
Tue, 20 Jun 2017 13:40:26 +0000 (14:40 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Sat, 22 Jul 2017 20:49:21 +0000 (22:49 +0200)
expat/tests/runtests.c

index e340475043af586f86c2f372673a80e31c2875b7..31a66a484a518343c9b5e94d83834771a9d74c6a 100644 (file)
@@ -6730,6 +6730,18 @@ START_TEST(test_long_doctype)
 }
 END_TEST
 
+START_TEST(test_bad_entity)
+{
+    const char *text =
+        "<!DOCTYPE doc [\n"
+        "  <!ENTITY foo PUBLIC>\n"
+        "]>\n"
+        "<doc/>";
+    expect_failure(text, XML_ERROR_SYNTAX,
+                   "ENTITY without Public ID is not rejected");
+}
+END_TEST
+
 /*
  * Namespaces tests.
  */
@@ -12217,6 +12229,7 @@ make_suite(void)
     tcase_add_test(tc_basic, test_short_doctype_2);
     tcase_add_test(tc_basic, test_short_doctype_3);
     tcase_add_test(tc_basic, test_long_doctype);
+    tcase_add_test(tc_basic, test_bad_entity);
 
     suite_add_tcase(s, tc_namespace);
     tcase_add_checked_fixture(tc_namespace,