Rename internal_hooks -> internal_configuration, cJSON_New_item -> create_item

This commit is contained in:
Max Bruckner
2018-01-31 22:22:53 +01:00
parent 3ebc06196a
commit 677f0cb1bb
12 changed files with 111 additions and 112 deletions

View File

@@ -48,12 +48,12 @@ static void assert_parse_string(const char *string, const char *expected)
parse_buffer buffer = { 0, 0, 0, 0, { 0, 0, 0 } };
buffer.content = (const unsigned char*)string;
buffer.length = strlen(string) + sizeof("");
buffer.hooks = global_hooks;
buffer.configuration = global_configuration;
TEST_ASSERT_TRUE_MESSAGE(parse_string(item, &buffer), "Couldn't parse string.");
assert_is_string(item);
TEST_ASSERT_EQUAL_STRING_MESSAGE(expected, item->valuestring, "The parsed result isn't as expected.");
global_hooks.deallocate(item->valuestring);
global_configuration.deallocate(item->valuestring);
item->valuestring = NULL;
}
@@ -62,7 +62,7 @@ static void assert_not_parse_string(const char * const string)
parse_buffer buffer = { 0, 0, 0, 0, { 0, 0, 0 } };
buffer.content = (const unsigned char*)string;
buffer.length = strlen(string) + sizeof("");
buffer.hooks = global_hooks;
buffer.configuration = global_configuration;
TEST_ASSERT_FALSE_MESSAGE(parse_string(item, &buffer), "Malformed string should not be accepted.");
assert_is_invalid(item);