{
XML_Memory_Handling_Suite memsuite = { duff_allocator, realloc, free };
unsigned int i;
+#define MAX_ALLOC_COUNT 10
/* Try several levels of allocation */
- for (i = 0; i < 10; i++) {
+ for (i = 0; i < MAX_ALLOC_COUNT; i++) {
allocation_count = i;
parser = XML_ParserCreate_MM("us-ascii", &memsuite, NULL);
if (parser != NULL)
}
if (i == 0)
fail("Parser ignored failing allocator");
- else if (i == 10)
- fail("Parser not created with allocation count 10");
+ else if (i == MAX_ALLOC_COUNT)
+ fail("Parser not created with max allocation count");
}
+#undef MAX_ALLOC_COUNT
END_TEST
/* Test that freeing a NULL parser doesn't cause an explosion.