From 0b1fbcfba5b2d2e2d78dd21fa9c8889e8cd5049f Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Wed, 26 Jul 2017 18:11:28 +0100 Subject: [PATCH] Make context reallocation tests robust vs allocation pattern changes --- expat/tests/runtests.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index 013a8059..cb96b2b2 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -11302,7 +11302,7 @@ END_TEST * returns normally it must have succeeded. */ static void -context_realloc_test(XML_Parser parser, const char *text) +context_realloc_test(const char *text) { ExtOption options[] = { { "foo", ""}, @@ -11320,7 +11320,9 @@ context_realloc_test(XML_Parser parser, const char *text) 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 reallocations"); @@ -11357,7 +11359,7 @@ START_TEST(test_nsalloc_realloc_long_context) "&en;" ""; - context_realloc_test(parser, text); + context_realloc_test(text); } END_TEST @@ -11389,7 +11391,7 @@ START_TEST(test_nsalloc_realloc_long_context_2) "&en;" ""; - context_realloc_test(parser, text); + context_realloc_test(text); } END_TEST @@ -11421,7 +11423,7 @@ START_TEST(test_nsalloc_realloc_long_context_3) "&en;" ""; - context_realloc_test(parser, text); + context_realloc_test(text); } END_TEST @@ -11453,7 +11455,7 @@ START_TEST(test_nsalloc_realloc_long_context_4) "&en;" ""; - context_realloc_test(parser, text); + context_realloc_test(text); } END_TEST @@ -11485,7 +11487,7 @@ START_TEST(test_nsalloc_realloc_long_context_5) "&en;" ""; - context_realloc_test(parser, text); + context_realloc_test(text); } END_TEST @@ -11516,7 +11518,7 @@ START_TEST(test_nsalloc_realloc_long_context_6) "&en;" ""; - context_realloc_test(parser, text); + context_realloc_test(text); } END_TEST @@ -11548,7 +11550,7 @@ START_TEST(test_nsalloc_realloc_long_context_7) "&en;" ""; - context_realloc_test(parser, text); + context_realloc_test(text); } END_TEST