Lines Matching defs:array
33 cJSON array[1];
38 memset(array, 0, sizeof(array));
41 /* create array */
42 array[0].child = &elements[0];
52 cJSON_ArrayForEach(element_pointer, array)
54 TEST_ASSERT_TRUE_MESSAGE(element_pointer == &elements[i], "Not iterating over array properly");
61 cJSON *array = NULL;
63 cJSON_ArrayForEach(element, array);
130 cJSON *array = NULL;
132 array = cJSON_Parse("[1]");
134 found = cJSON_GetObjectItem(array, "name");
137 cJSON_Delete(array);
142 cJSON *array = NULL;
144 array = cJSON_Parse("[1]");
146 found = cJSON_GetObjectItemCaseSensitive(array, "name");
149 cJSON_Delete(array);
299 cJSON *array = NULL;
308 array = cJSON_CreateArray();
309 TEST_ASSERT_NOT_NULL(array);
311 cJSON_AddItemToArray(array, beginning);
312 cJSON_AddItemToArray(array, middle);
313 cJSON_AddItemToArray(array, end);
318 TEST_ASSERT_TRUE(cJSON_ReplaceItemViaPointer(array, beginning, &(replacements[0])));
322 TEST_ASSERT_TRUE(array->child == &(replacements[0]));
325 TEST_ASSERT_TRUE(cJSON_ReplaceItemViaPointer(array, middle, &(replacements[1])));
331 TEST_ASSERT_TRUE(cJSON_ReplaceItemViaPointer(array, end, &(replacements[2])));
336 cJSON_free(array);
365 cJSON *array = cJSON_CreateArray();
367 cJSON *item2 = cJSON_CreateString("corrupted array item3");
371 add_item_to_array(array, item1);
372 add_item_to_array(array, item2);
437 TEST_ASSERT_FALSE(cJSON_InsertItemInArray(array, 0, NULL));
438 TEST_ASSERT_FALSE(cJSON_InsertItemInArray(array, 1, item));
464 cJSON_Delete(array);
585 cJSON *array = cJSON_CreateArray();
591 flag = cJSON_AddItemToArray(array, array);
592 TEST_ASSERT_FALSE_MESSAGE(flag, "add an array to itself should fail");
595 cJSON_Delete(array);
628 cJSON *array = cJSON_AddArrayToObject(root, "rd");
632 cJSON_AddItemToArray(array, item1);
637 cJSON_AddItemToArray(array, item2);
643 cJSON_DeleteItemFromArray(array, 0);