mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
parser: Construct error pointer from buffer offset
This commit is contained in:
@@ -30,8 +30,6 @@
|
||||
|
||||
static cJSON item[1];
|
||||
|
||||
static const unsigned char *error_pointer = NULL;
|
||||
|
||||
static void assert_is_object(cJSON *object_item)
|
||||
{
|
||||
TEST_ASSERT_NOT_NULL_MESSAGE(object_item, "Item is NULL.");
|
||||
@@ -59,7 +57,7 @@ static void assert_not_object(const char *json)
|
||||
parsebuffer.length = strlen(json) + sizeof("");
|
||||
parsebuffer.offset = 0;
|
||||
|
||||
TEST_ASSERT_FALSE(parse_object(item, &parsebuffer, &error_pointer, &global_hooks));
|
||||
TEST_ASSERT_FALSE(parse_object(item, &parsebuffer, &global_hooks));
|
||||
assert_is_invalid(item);
|
||||
reset(item);
|
||||
}
|
||||
@@ -71,7 +69,7 @@ static void assert_parse_object(const char *json)
|
||||
parsebuffer.length = strlen(json) + sizeof("");
|
||||
parsebuffer.offset = 0;
|
||||
|
||||
TEST_ASSERT_TRUE(parse_object(item, &parsebuffer, &error_pointer, &global_hooks));
|
||||
TEST_ASSERT_TRUE(parse_object(item, &parsebuffer, &global_hooks));
|
||||
assert_is_object(item);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user