cJSON.c: Pass allocation functions through internal functions
This is the first step in removing the global allocator functions. Every internal function now only accesses its locally available set of allocators.
This commit is contained in:
@@ -37,7 +37,7 @@ static void assert_print_number(const char *expected, double input)
|
||||
memset(item, 0, sizeof(item));
|
||||
cJSON_SetNumberValue(item, input);
|
||||
|
||||
TEST_ASSERT_NOT_NULL_MESSAGE(print_number(item, &buffer), "Failed to print number.");
|
||||
TEST_ASSERT_NOT_NULL_MESSAGE(print_number(item, &buffer, &global_hooks), "Failed to print number.");
|
||||
TEST_ASSERT_EQUAL_STRING_MESSAGE(expected, buffer.buffer, "Printed number is not as expected.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user