From 771bc86bb130b130df6fd5f4a897cc5686c84e32 Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Wed, 26 Jul 2017 18:08:40 +0100 Subject: [PATCH] Make test_nsalloc_less_long_namespace() robust vs allocation changes --- expat/tests/runtests.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index b90174fb..fa4e9744 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -11222,33 +11222,16 @@ START_TEST(test_nsalloc_less_long_namespace) "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678" ":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 == 5)) || - (i == 7 && repeat == 10)) { - i -= 2; - repeat++; - } - else if ((i == 2 && repeat < 2) || - (i == 3 && (repeat == 2 || - repeat == 4 || - repeat == 6)) || - (i == 4 && repeat == 7) || - (i == 5 && (repeat == 8 || - repeat == 9)) || - (i == 6 && (repeat == 11 || 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"); -- 2.40.0