From 71e8442db937626dd21c8f54017c9be9b3ee8e17 Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Thu, 9 Mar 2017 17:05:50 +0000 Subject: [PATCH] Extend NotStandalone tests to also exclude external entity handlers --- expat/tests/runtests.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index b4567080..c328c35b 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -1470,6 +1470,12 @@ START_TEST(test_not_standalone_handler_reject) XML_SetNotStandaloneHandler(parser, reject_not_standalone_handler); expect_failure(text, XML_ERROR_NOT_STANDALONE, "NotStandalone handler failed to reject"); + + /* Try again but without external entity handling */ + XML_ParserReset(parser, NULL); + XML_SetNotStandaloneHandler(parser, reject_not_standalone_handler); + expect_failure(text, XML_ERROR_NOT_STANDALONE, + "NotStandalone handler failed to reject"); } END_TEST @@ -1496,6 +1502,11 @@ START_TEST(test_not_standalone_handler_accept) XML_SetExternalEntityRefHandler(parser, external_entity_loader); XML_SetNotStandaloneHandler(parser, accept_not_standalone_handler); run_ext_character_check(text, &test_data, ""); + + /* Repeat wtihout the external entity handler */ + XML_ParserReset(parser, NULL); + XML_SetNotStandaloneHandler(parser, accept_not_standalone_handler); + run_character_check(text, ""); } END_TEST