parse_value: Use parse_buffer

This commit is contained in:
Max Bruckner
2017-03-14 10:15:57 +01:00
parent 0f98214e71
commit fd0320cf54
3 changed files with 75 additions and 23 deletions

View File

@@ -44,7 +44,11 @@ static void assert_is_value(cJSON *value_item, int type)
static void assert_parse_value(const char *string, int type)
{
TEST_ASSERT_NOT_NULL(parse_value(item, (const unsigned char*)string, &error_pointer, &global_hooks));
parse_buffer buffer;
buffer.content = (const unsigned char*) string;
buffer.length = strlen(string) + sizeof("");
buffer.offset = 0;
TEST_ASSERT_NOT_NULL(parse_value(item, &buffer, &error_pointer, &global_hooks));
assert_is_value(item, type);
}