Test parsing a zero-length string
@@ -1926,6 +1926,17 @@ START_TEST(test_ext_entity_ref_parameter)
}
END_TEST
+/* Test the parsing of an empty string */
+START_TEST(test_empty_parse)
+{
+ if (XML_Parse(parser, NULL, 0, XML_FALSE) == XML_STATUS_ERROR)
+ fail("Parsing empty string faulted");
+ if (XML_Parse(parser, NULL, 0, XML_TRUE) != XML_STATUS_ERROR)
+ fail("Parsing final empty string not faulted");
+ if (XML_GetErrorCode(parser) != XML_ERROR_NO_ELEMENTS)
+ fail("Parsing final empty string faulted for wrong reason");
+}
+END_TEST
/*
* Namespaces tests.
@@ -2931,6 +2942,7 @@ make_suite(void)
tcase_add_test(tc_basic, test_explicit_encoding);
tcase_add_test(tc_basic, test_user_parameters);
tcase_add_test(tc_basic, test_ext_entity_ref_parameter);
+ tcase_add_test(tc_basic, test_empty_parse);
suite_add_tcase(s, tc_namespace);
tcase_add_checked_fixture(tc_namespace,
