• Home
  • Raw
  • Download

Lines Matching +full:json +full:- +full:buffer

2   Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
45 static void assert_not_array(const char *json) in assert_not_array() argument
47 parse_buffer buffer = { 0, 0, 0, 0, { 0, 0, 0 } }; in assert_not_array() local
48 buffer.content = (const unsigned char*)json; in assert_not_array()
49 buffer.length = strlen(json) + sizeof(""); in assert_not_array()
50 buffer.hooks = global_hooks; in assert_not_array()
52 TEST_ASSERT_FALSE(parse_array(item, &buffer)); in assert_not_array()
56 static void assert_parse_array(const char *json) in assert_parse_array() argument
58 parse_buffer buffer = { 0, 0, 0, 0, { 0, 0, 0 } }; in assert_parse_array() local
59 buffer.content = (const unsigned char*)json; in assert_parse_array()
60 buffer.length = strlen(json) + sizeof(""); in assert_parse_array()
61 buffer.hooks = global_hooks; in assert_parse_array()
63 TEST_ASSERT_TRUE(parse_array(item, &buffer)); in assert_parse_array()
82 assert_has_type(item->child, cJSON_Number); in parse_array_should_parse_arrays_with_one_element()
87 assert_has_type(item->child, cJSON_String); in parse_array_should_parse_arrays_with_one_element()
88 TEST_ASSERT_EQUAL_STRING("hello!", item->child->valuestring); in parse_array_should_parse_arrays_with_one_element()
93 TEST_ASSERT_NOT_NULL(item->child); in parse_array_should_parse_arrays_with_one_element()
94 assert_has_type(item->child, cJSON_Array); in parse_array_should_parse_arrays_with_one_element()
95 assert_has_no_child(item->child); in parse_array_should_parse_arrays_with_one_element()
100 assert_has_type(item->child, cJSON_NULL); in parse_array_should_parse_arrays_with_one_element()
108 TEST_ASSERT_NOT_NULL(item->child->next); in parse_array_should_parse_arrays_with_multiple_elements()
109 TEST_ASSERT_NOT_NULL(item->child->next->next); in parse_array_should_parse_arrays_with_multiple_elements()
110 TEST_ASSERT_NULL(item->child->next->next->next); in parse_array_should_parse_arrays_with_multiple_elements()
111 assert_has_type(item->child, cJSON_Number); in parse_array_should_parse_arrays_with_multiple_elements()
112 assert_has_type(item->child->next, cJSON_Number); in parse_array_should_parse_arrays_with_multiple_elements()
113 assert_has_type(item->child->next->next, cJSON_Number); in parse_array_should_parse_arrays_with_multiple_elements()
131 node = item->child; in parse_array_should_parse_arrays_with_multiple_elements()
136 (void)i++, node = node->next) in parse_array_should_parse_arrays_with_multiple_elements()
138 TEST_ASSERT_BITS(0xFF, expected_types[i], node->type); in parse_array_should_parse_arrays_with_multiple_elements()