]> granicus.if.org Git - libexpat/commitdiff
Test XML declaration with missing value for 'standalone' attr
authorRhodri James <rhodri@kynesim.co.uk>
Fri, 26 May 2017 16:36:00 +0000 (17:36 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Sat, 22 Jul 2017 20:49:17 +0000 (22:49 +0200)
expat/tests/runtests.c

index 0bf33fd3b257d57f56f000f3431457566026c9d1..e813e39a96575040bd115f91f36eeb6045cec6bb 100644 (file)
@@ -1342,6 +1342,15 @@ START_TEST(test_xmldecl_missing_attr)
 }
 END_TEST
 
+START_TEST(test_xmldecl_missing_value)
+{
+    expect_failure("<?xml version='1.0' encoding='us-ascii' standalone?>\n"
+                   "<doc/>",
+                   XML_ERROR_XML_DECL,
+                   "Failed to report missing attribute value");
+}
+END_TEST
+
 /* Regression test for SF bug #584832. */
 static int XMLCALL
 UnknownEncodingHandler(void *UNUSED_P(data),const XML_Char *encoding,XML_Encoding *info)
@@ -10403,6 +10412,7 @@ make_suite(void)
     tcase_add_test(tc_basic, test_xmldecl_misplaced);
     tcase_add_test(tc_basic, test_xmldecl_invalid);
     tcase_add_test(tc_basic, test_xmldecl_missing_attr);
+    tcase_add_test(tc_basic, test_xmldecl_missing_value);
     tcase_add_test(tc_basic, test_unknown_encoding_internal_entity);
     tcase_add_test(tc_basic, test_unrecognised_encoding_internal_entity);
     tcase_add_test(tc_basic,