]> granicus.if.org Git - libexpat/commitdiff
Test public notation with no system ID
authorRhodri James <rhodri@kynesim.co.uk>
Fri, 10 Mar 2017 18:21:15 +0000 (18:21 +0000)
committerSebastian Pipping <sebastian@pipping.org>
Sat, 22 Jul 2017 19:46:16 +0000 (21:46 +0200)
expat/tests/runtests.c

index 1bd2a1b25806b12df233f40fe5e3e6f0ca913247..8ebfc8ef7ce400679c460b8b9d56d20f4b62aa7e 100644 (file)
@@ -4180,6 +4180,25 @@ START_TEST(test_dtd_stop_processing)
 }
 END_TEST
 
+/* Test public notations with no system ID */
+START_TEST(test_public_notation_no_sysid)
+{
+    const char *text =
+        "<!DOCTYPE doc [\n"
+        "<!NOTATION note PUBLIC 'foo'>\n"
+        "<!ELEMENT doc EMPTY>\n"
+        "]>\n<doc/>";
+
+    dummy_handler_flags = 0;
+    XML_SetNotationDeclHandler(parser, dummy_notation_decl_handler);
+    if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+                                XML_TRUE) == XML_STATUS_ERROR)
+        xml_failure(parser);
+    if (dummy_handler_flags != DUMMY_NOTATION_DECL_HANDLER_FLAG)
+        fail("Notation declaration handler not called");
+}
+END_TEST
+
 
 /*
  * Namespaces tests.
@@ -7163,6 +7182,7 @@ make_suite(void)
     tcase_add_test(tc_basic, test_attribute_enum_value);
     tcase_add_test(tc_basic, test_predefined_entity_redefinition);
     tcase_add_test(tc_basic, test_dtd_stop_processing);
+    tcase_add_test(tc_basic, test_public_notation_no_sysid);
 
     suite_add_tcase(s, tc_namespace);
     tcase_add_checked_fixture(tc_namespace,