Lines Matching refs:item
68 cJSON *item = NULL;
71 item = cJSON_Parse("{\"one\":1, \"Two\":2, \"tHree\":3}");
76 found = cJSON_GetObjectItem(item, NULL);
79 found = cJSON_GetObjectItem(item, "one");
80 TEST_ASSERT_NOT_NULL_MESSAGE(found, "Failed to find first item.");
83 found = cJSON_GetObjectItem(item, "tWo");
84 TEST_ASSERT_NOT_NULL_MESSAGE(found, "Failed to find first item.");
87 found = cJSON_GetObjectItem(item, "three");
88 TEST_ASSERT_NOT_NULL_MESSAGE(found, "Failed to find item.");
91 found = cJSON_GetObjectItem(item, "four");
94 cJSON_Delete(item);
99 cJSON *item = NULL;
102 item = cJSON_Parse("{\"one\":1, \"Two\":2, \"tHree\":3}");
107 found = cJSON_GetObjectItemCaseSensitive(item, NULL);
110 found = cJSON_GetObjectItemCaseSensitive(item, "one");
111 TEST_ASSERT_NOT_NULL_MESSAGE(found, "Failed to find first item.");
114 found = cJSON_GetObjectItemCaseSensitive(item, "Two");
115 TEST_ASSERT_NOT_NULL_MESSAGE(found, "Failed to find first item.");
118 found = cJSON_GetObjectItemCaseSensitive(item, "tHree");
119 TEST_ASSERT_NOT_NULL_MESSAGE(found, "Failed to find item.");
122 found = cJSON_GetObjectItemCaseSensitive(item, "One");
125 cJSON_Delete(item);
155 cJSON item[1];
158 item->type = cJSON_False;
159 item->type |= cJSON_StringIsConst;
162 TEST_ASSERT_FALSE(cJSON_IsInvalid(item));
165 item->type = cJSON_False | cJSON_StringIsConst;
168 TEST_ASSERT_TRUE(cJSON_IsFalse(item));
169 TEST_ASSERT_TRUE(cJSON_IsBool(item));
171 item->type = cJSON_True | cJSON_StringIsConst;
174 TEST_ASSERT_TRUE(cJSON_IsTrue(item));
175 TEST_ASSERT_TRUE(cJSON_IsBool(item));
177 item->type = cJSON_NULL | cJSON_StringIsConst;
180 TEST_ASSERT_TRUE(cJSON_IsNull(item));
182 item->type = cJSON_Number | cJSON_StringIsConst;
185 TEST_ASSERT_TRUE(cJSON_IsNumber(item));
187 item->type = cJSON_String | cJSON_StringIsConst;
190 TEST_ASSERT_TRUE(cJSON_IsString(item));
192 item->type = cJSON_Array | cJSON_StringIsConst;
195 TEST_ASSERT_TRUE(cJSON_IsArray(item));
197 item->type = cJSON_Object | cJSON_StringIsConst;
200 TEST_ASSERT_TRUE(cJSON_IsObject(item));
202 item->type = cJSON_Raw | cJSON_StringIsConst;
205 TEST_ASSERT_TRUE(cJSON_IsRaw(item));
274 TEST_ASSERT_TRUE_MESSAGE((list[1].prev == NULL) && (list[1].next == NULL), "Didn't set pointers of detached item to NULL.");
279 TEST_ASSERT_TRUE_MESSAGE((list[0].prev == NULL) && (list[0].next == NULL), "Didn't set pointers of detached item to NULL.");
284 TEST_ASSERT_TRUE_MESSAGE((list[3].prev == NULL) && (list[3].next == NULL), "Didn't set pointers of detached item to NULL.");
287 /* detach single item (list[2]) */
288 TEST_ASSERT_TRUE_MESSAGE(cJSON_DetachItemViaPointer(parent, &list[2]) == &list[2], "Failed to detach single item.");
289 TEST_ASSERT_TRUE_MESSAGE((list[2].prev == NULL) && (list[2].next == NULL), "Didn't set pointers of detached item to NULL.");
352 TEST_ASSERT_TRUE_MESSAGE(flag, "add item to object failed");
364 cJSON *item = cJSON_CreateString("item");
386 TEST_ASSERT_FALSE(cJSON_PrintPreallocated(item, NULL, 1, true));
390 TEST_ASSERT_NULL(cJSON_GetObjectItem(NULL, "item"));
391 TEST_ASSERT_NULL(cJSON_GetObjectItem(item, NULL));
392 TEST_ASSERT_NULL(cJSON_GetObjectItemCaseSensitive(NULL, "item"));
393 TEST_ASSERT_NULL(cJSON_GetObjectItemCaseSensitive(item, NULL));
394 TEST_ASSERT_FALSE(cJSON_HasObjectItem(NULL, "item"));
395 TEST_ASSERT_FALSE(cJSON_HasObjectItem(item, NULL));
412 cJSON_AddItemToArray(NULL, item);
413 cJSON_AddItemToArray(item, NULL);
414 cJSON_AddItemToObject(item, "item", NULL);
415 cJSON_AddItemToObject(item, NULL, item);
416 cJSON_AddItemToObject(NULL, "item", item);
417 cJSON_AddItemToObjectCS(item, "item", NULL);
418 cJSON_AddItemToObjectCS(item, NULL, item);
419 cJSON_AddItemToObjectCS(NULL, "item", item);
420 cJSON_AddItemReferenceToArray(NULL, item);
421 cJSON_AddItemReferenceToArray(item, NULL);
422 cJSON_AddItemReferenceToObject(item, "item", NULL);
423 cJSON_AddItemReferenceToObject(item, NULL, item);
424 cJSON_AddItemReferenceToObject(NULL, "item", item);
425 TEST_ASSERT_NULL(cJSON_DetachItemViaPointer(NULL, item));
426 TEST_ASSERT_NULL(cJSON_DetachItemViaPointer(item, NULL));
429 TEST_ASSERT_NULL(cJSON_DetachItemFromObject(NULL, "item"));
430 TEST_ASSERT_NULL(cJSON_DetachItemFromObject(item, NULL));
431 TEST_ASSERT_NULL(cJSON_DetachItemFromObjectCaseSensitive(NULL, "item"));
432 TEST_ASSERT_NULL(cJSON_DetachItemFromObjectCaseSensitive(item, NULL));
433 cJSON_DeleteItemFromObject(NULL, "item");
434 cJSON_DeleteItemFromObject(item, NULL);
435 cJSON_DeleteItemFromObjectCaseSensitive(NULL, "item");
436 cJSON_DeleteItemFromObjectCaseSensitive(item, NULL);
438 TEST_ASSERT_FALSE(cJSON_InsertItemInArray(array, 1, item));
439 TEST_ASSERT_FALSE(cJSON_InsertItemInArray(NULL, 0, item));
440 TEST_ASSERT_FALSE(cJSON_InsertItemInArray(item, 0, NULL));
441 TEST_ASSERT_FALSE(cJSON_ReplaceItemViaPointer(NULL, item, item));
442 TEST_ASSERT_FALSE(cJSON_ReplaceItemViaPointer(item, NULL, item));
443 TEST_ASSERT_FALSE(cJSON_ReplaceItemViaPointer(item, item, NULL));
444 TEST_ASSERT_FALSE(cJSON_ReplaceItemInArray(item, 0, NULL));
445 TEST_ASSERT_FALSE(cJSON_ReplaceItemInArray(NULL, 0, item));
446 TEST_ASSERT_FALSE(cJSON_ReplaceItemInObject(NULL, "item", item));
447 TEST_ASSERT_FALSE(cJSON_ReplaceItemInObject(item, NULL, item));
448 TEST_ASSERT_FALSE(cJSON_ReplaceItemInObject(item, "item", NULL));
449 TEST_ASSERT_FALSE(cJSON_ReplaceItemInObjectCaseSensitive(NULL, "item", item));
450 TEST_ASSERT_FALSE(cJSON_ReplaceItemInObjectCaseSensitive(item, NULL, item));
451 TEST_ASSERT_FALSE(cJSON_ReplaceItemInObjectCaseSensitive(item, "item", NULL));
453 TEST_ASSERT_FALSE(cJSON_Compare(item, NULL, false));
454 TEST_ASSERT_FALSE(cJSON_Compare(NULL, item, false));
465 cJSON_Delete(item);
655 const char *reference_valuestring = "reference item should be freed by yourself";