From fe9251de69c7d083fb883ebbf54eb21c635dfbf3 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sun, 22 Sep 2024 00:33:46 +0200 Subject: [PATCH] tests: Resolve duplicate handler accumulate_char_data Handler accumulate_characters does the exact same thing and is used many times more throughout the test suite. --- expat/tests/handlers.c | 6 ------ expat/tests/handlers.h | 3 --- expat/tests/misc_tests.c | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/expat/tests/handlers.c b/expat/tests/handlers.c index 58df1d0a..19d2590a 100644 --- a/expat/tests/handlers.c +++ b/expat/tests/handlers.c @@ -1882,12 +1882,6 @@ accumulate_entity_decl(void *userData, const XML_Char *entityName, CharData_AppendXMLChars(storage, XCS("\n"), 1); } -void XMLCALL -accumulate_char_data(void *userData, const XML_Char *s, int len) { - CharData *const storage = (CharData *)userData; - CharData_AppendXMLChars(storage, s, len); -} - void XMLCALL accumulate_start_element(void *userData, const XML_Char *name, const XML_Char **atts) { diff --git a/expat/tests/handlers.h b/expat/tests/handlers.h index f46e6d1d..1865bc2d 100644 --- a/expat/tests/handlers.h +++ b/expat/tests/handlers.h @@ -569,9 +569,6 @@ extern void XMLCALL accumulate_entity_decl( const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName); -extern void XMLCALL accumulate_char_data(void *userData, const XML_Char *s, - int len); - extern void XMLCALL accumulate_start_element(void *userData, const XML_Char *name, const XML_Char **atts); diff --git a/expat/tests/misc_tests.c b/expat/tests/misc_tests.c index 2ee9320b..bf2983b4 100644 --- a/expat/tests/misc_tests.c +++ b/expat/tests/misc_tests.c @@ -447,7 +447,7 @@ START_TEST(test_misc_general_entities_support) { XML_SetExternalEntityRefHandler(parser, external_entity_failer__if_not_xml_ge); XML_SetEntityDeclHandler(parser, accumulate_entity_decl); - XML_SetCharacterDataHandler(parser, accumulate_char_data); + XML_SetCharacterDataHandler(parser, accumulate_characters); if (_XML_Parse_SINGLE_BYTES(parser, doc, (int)strlen(doc), XML_TRUE) != XML_STATUS_OK) {