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

index bf07eb610cb8ff07c2b555641fc6b168e135e914..91a9cd6ee226aacf6f75a0e7b7748854b5fdf13e 100644 (file)
@@ -6706,6 +6706,14 @@ START_TEST(test_short_doctype)
 }
 END_TEST
 
+START_TEST(test_short_doctype_2)
+{
+    const char *text = "<!DOCTYPE doc PUBLIC></doc>";
+    expect_failure(text, XML_ERROR_SYNTAX,
+                   "DOCTYPE without Public ID not rejected");
+}
+END_TEST
+
 /*
  * Namespaces tests.
  */
@@ -12190,6 +12198,7 @@ make_suite(void)
     tcase_add_test(tc_basic, test_entity_public_utf16_be);
     tcase_add_test(tc_basic, test_entity_public_utf16_le);
     tcase_add_test(tc_basic, test_short_doctype);
+    tcase_add_test(tc_basic, test_short_doctype_2);
 
     suite_add_tcase(s, tc_namespace);
     tcase_add_checked_fixture(tc_namespace,