From 5d75b0ae62ae5a9a0e5a1c24c4da84798e12a5f1 Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Mon, 24 Apr 2017 18:40:35 +0100 Subject: [PATCH] Test invalid character reference is faulted --- expat/tests/runtests.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index dedaa587..2e3b8e07 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -4991,6 +4991,19 @@ START_TEST(test_param_entity_with_trailing_cr) #undef PARAM_ENTITY_CORE_VALUE END_TEST +START_TEST(test_invalid_character_entity) +{ + const char *text = + "\n" + "]>\n" + "&entity;"; + + expect_failure(text, XML_ERROR_BAD_CHAR_REF, + "Out of range character reference not faulted"); +} +END_TEST + /* * Namespaces tests. @@ -8578,6 +8591,7 @@ make_suite(void) tcase_add_test(tc_basic, test_skipped_null_loaded_ext_entity); tcase_add_test(tc_basic, test_skipped_unloaded_ext_entity); tcase_add_test(tc_basic, test_param_entity_with_trailing_cr); + tcase_add_test(tc_basic, test_invalid_character_entity); suite_add_tcase(s, tc_namespace); tcase_add_checked_fixture(tc_namespace,