mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-09-02 21:49:54 +00:00
Change name from Configuration to Context
This commit is contained in:
+5
-5
@@ -421,7 +421,7 @@ static void *failing_realloc(void *pointer, size_t size, void *userdata)
|
||||
static void ensure_should_fail_on_failed_realloc(void)
|
||||
{
|
||||
printbuffer buffer = {NULL, 10, 0, 0, false, {256, false, true, true, {malloc_wrapper, free_wrapper, failing_realloc}, NULL, 0 } };
|
||||
buffer.configuration.userdata = &buffer;
|
||||
buffer.context.userdata = &buffer;
|
||||
buffer.buffer = (unsigned char*)malloc(100);
|
||||
TEST_ASSERT_NOT_NULL(buffer.buffer);
|
||||
|
||||
@@ -431,10 +431,10 @@ static void ensure_should_fail_on_failed_realloc(void)
|
||||
static void skip_utf8_bom_should_skip_bom(void)
|
||||
{
|
||||
const unsigned char string[] = "\xEF\xBB\xBF{}";
|
||||
parse_buffer buffer = { 0, 0, 0, 0, default_configuration };
|
||||
parse_buffer buffer = { 0, 0, 0, 0, default_context };
|
||||
buffer.content = string;
|
||||
buffer.length = sizeof(string);
|
||||
buffer.configuration = global_configuration;
|
||||
buffer.context = global_context;
|
||||
|
||||
TEST_ASSERT_TRUE(skip_utf8_bom(&buffer) == &buffer);
|
||||
TEST_ASSERT_EQUAL_UINT(3U, (unsigned int)buffer.offset);
|
||||
@@ -443,10 +443,10 @@ static void skip_utf8_bom_should_skip_bom(void)
|
||||
static void skip_utf8_bom_should_not_skip_bom_if_not_at_beginning(void)
|
||||
{
|
||||
const unsigned char string[] = " \xEF\xBB\xBF{}";
|
||||
parse_buffer buffer = { 0, 0, 0, 0, default_configuration };
|
||||
parse_buffer buffer = { 0, 0, 0, 0, default_context };
|
||||
buffer.content = string;
|
||||
buffer.length = sizeof(string);
|
||||
buffer.configuration = global_configuration;
|
||||
buffer.context = global_context;
|
||||
buffer.offset = 1;
|
||||
|
||||
TEST_ASSERT_NULL(skip_utf8_bom(&buffer));
|
||||
|
||||
Reference in New Issue
Block a user