From 7bb6261950a24e18d5bd35660a5ed3988f05ea66 Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Wed, 26 Jul 2017 18:06:46 +0100 Subject: [PATCH] Make test_nsalloc_long_namespace() robust vs allocation pattern changes --- expat/tests/runtests.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index a72d4092..b90174fb 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -11147,34 +11147,16 @@ START_TEST(test_nsalloc_long_namespace) "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ" ":e>"; int i; -#define MAX_ALLOC_COUNT 10 - int repeat = 0; +#define MAX_ALLOC_COUNT 40 for (i = 0; i < MAX_ALLOC_COUNT; i++) { - /* Repeat some counts to defeat cached allocations */ - if ((i == 4 && (repeat == 3 || repeat == 6)) || - (i == 7 && repeat == 11)) { - i -= 2; - repeat++; - } - else if ((i == 2 && repeat < 2) || - (i == 3 && (repeat == 2 || - repeat == 4 || - repeat == 5 || - repeat == 7 || - repeat == 8)) || - (i == 5 && (repeat == 9 || - repeat == 10)) || - (i == 6 && repeat == 12) || - (i == 7 && repeat == 13)) { - i--; - repeat++; - } allocation_count = i; if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR) break; - XML_ParserReset(parser, NULL); + /* See comment in test_nsalloc_xmlns() */ + nsalloc_teardown(); + nsalloc_setup(); } if (i == 0) fail("Parsing worked despite failing allocations");