From 454f53885be4115957becd1f83f6e5e0eaa88f9d Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Mon, 6 Feb 2017 16:35:04 +0000 Subject: [PATCH] Ensure unparsed entity handler gets set This adds test coverage for an obsolete handler that is supported only for backwards compatibility. While it is supported, we should test it. --- expat/tests/runtests.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index a5e30ee7..9c175eea 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -182,6 +182,18 @@ static void XMLCALL dummy_end_cdata_handler(void *UNUSED_P(userData)) {} +/* This handler is obsolete, but while the code exists we should + * ensure that dealing with the handler is covered by tests. + */ +static void XMLCALL +dummy_unparsed_entity_decl_handler(void *UNUSED_P(userData), + const XML_Char *UNUSED_P(entityName), + const XML_Char *UNUSED_P(base), + const XML_Char *UNUSED_P(systemId), + const XML_Char *UNUSED_P(publicId), + const XML_Char *UNUSED_P(notationName)) +{} + /* * Character & encoding tests. @@ -2662,6 +2674,9 @@ START_TEST(test_alloc_dtd_default_handling) XML_SetCdataSectionHandler(parser, dummy_start_cdata_handler, dummy_end_cdata_handler); + XML_SetUnparsedEntityDeclHandler( + parser, + dummy_unparsed_entity_decl_handler); CharData_Init(&storage); XML_SetUserData(parser, &storage); XML_SetCharacterDataHandler(parser, accumulate_characters); -- 2.40.0