Make test_nsalloc_realloc_longer_prefix_count() robust.
Remove test's vulnerability to changing memory allocation patterns
This commit is contained in:
parent
a74053cf48
commit
c2084de48d
@ -11038,12 +11038,13 @@ START_TEST(test_nsalloc_realloc_longer_prefix)
|
||||
#define MAX_REALLOC_COUNT 12
|
||||
|
||||
for (i = 0; i < MAX_REALLOC_COUNT; i++) {
|
||||
/* Every reallocation bar the last is cached */
|
||||
reallocation_count = (i == 0) ? 0 : 1;
|
||||
reallocation_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 reallocations");
|
||||
|
Loading…
Reference in New Issue
Block a user