From 4722c718d048b8c43c98a9dbb6a153c0ae314f3d Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Thu, 27 Jul 2017 13:48:08 +0100 Subject: [PATCH] Make test_alloc_notation() robust vs allocation pattern changes --- expat/tests/runtests.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index b8864124..0ef00280 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -9211,15 +9211,9 @@ START_TEST(test_alloc_notation) "\n" "]>\n"; int i; -#define MAX_ALLOC_COUNT 10 - int repeat = 0; +#define MAX_ALLOC_COUNT 20 for (i = 0; i < MAX_ALLOC_COUNT; i++) { - /* Repeat some counts to allow for cached allocations */ - if ((i == 2 && repeat < 4) || (i == 3)) { - i--; - repeat++; - } allocation_count = i; dummy_handler_flags = 0; XML_SetNotationDeclHandler(parser, dummy_notation_decl_handler); @@ -9227,7 +9221,9 @@ START_TEST(test_alloc_notation) 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 succeeded despite allocation failures");