From 32c257274779be588be2728379ec9f8283c2421b Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Thu, 27 Jul 2017 14:06:41 +0100 Subject: [PATCH] Make test_alloc_pi_in_epilog() robust vs allocation pattern changes --- expat/tests/runtests.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index cf9b490b..3ac3ce5f 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -9508,26 +9508,18 @@ START_TEST(test_alloc_pi_in_epilog) "\n" ""; int i; -#define MAX_ALLOC_COUNT 10 - int repeat = 0; +#define MAX_ALLOC_COUNT 15 for (i = 0; i < MAX_ALLOC_COUNT; i++) { - /* Repeat certain counts to allow for cached allocations */ - if (i == 3 && repeat == 1) { - i -= 2; - repeat++; - } - else if (i == 2 && repeat < 4 && repeat != 1) { - i--; - repeat++; - } allocation_count = i; XML_SetProcessingInstructionHandler(parser, dummy_pi_handler); dummy_handler_flags = 0; if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR) break; - XML_ParserReset(parser, NULL); + /* See comment in test_alloc_parse_xdecl() */ + alloc_teardown(); + alloc_setup(); } if (i == 0) fail("Parse completed despite failing allocator"); -- 2.40.0