Make test_nsalloc_realloc_long_prefix() robust vs allocation changes

This commit is contained in:
Rhodri James 2017-07-26 18:00:40 +01:00
parent b3853fee79
commit a74053cf48

View File

@ -10960,12 +10960,13 @@ START_TEST(test_nsalloc_realloc_long_prefix)
#define MAX_REALLOC_COUNT 12 #define MAX_REALLOC_COUNT 12
for (i = 0; i < MAX_REALLOC_COUNT; i++) { for (i = 0; i < MAX_REALLOC_COUNT; i++) {
/* Every reallocation bar the last is cached */ reallocation_count = i;
reallocation_count = (i == 0) ? 0 : 1;
if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
XML_TRUE) != XML_STATUS_ERROR) XML_TRUE) != XML_STATUS_ERROR)
break; break;
XML_ParserReset(parser, NULL); /* See comment in test_nsalloc_xmlns() */
nsalloc_teardown();
nsalloc_setup();
} }
if (i == 0) if (i == 0)
fail("Parsing worked despite failing reallocations"); fail("Parsing worked despite failing reallocations");