Lines Matching refs:item

28 void reset(cJSON *item);
29 void reset(cJSON *item) {
30 if ((item != NULL) && (item->child != NULL))
32 cJSON_Delete(item->child);
34 if ((item->valuestring != NULL) && !(item->type & cJSON_IsReference))
36 global_hooks.deallocate(item->valuestring);
38 if ((item->string != NULL) && !(item->type & cJSON_StringIsConst))
40 global_hooks.deallocate(item->string);
43 memset(item, 0, sizeof(cJSON));
103 #define assert_has_type(item, item_type) TEST_ASSERT_BITS_MESSAGE(0xFF, item_type, item->type, "Item doesn't have expected type.")
104 #define assert_has_no_reference(item) TEST_ASSERT_BITS_MESSAGE(cJSON_IsReference, 0, item->type, "Item should not have a string as reference.")
105 #define assert_has_no_const_string(item) TEST_ASSERT_BITS_MESSAGE(cJSON_StringIsConst, 0, item->type, "Item should not have a const string.")
106 #define assert_has_valuestring(item) TEST_ASSERT_NOT_NULL_MESSAGE(item->valuestring, "Valuestring is NULL.")
107 #define assert_has_no_valuestring(item) TEST_ASSERT_NULL_MESSAGE(item->valuestring, "Valuestring is not NULL.")
108 #define assert_has_string(item) TEST_ASSERT_NOT_NULL_MESSAGE(item->string, "String is NULL")
109 #define assert_has_no_string(item) TEST_ASSERT_NULL_MESSAGE(item->string, "String is not NULL.")
110 #define assert_not_in_list(item) \
111 TEST_ASSERT_NULL_MESSAGE(item->next, "Linked list next pointer is not NULL.");\
112 TEST_ASSERT_NULL_MESSAGE(item->prev, "Linked list previous pointer is not NULL.")
113 #define assert_has_child(item) TEST_ASSERT_NOT_NULL_MESSAGE(item->child, "Item doesn't have a child.")
114 #define assert_has_no_child(item) TEST_ASSERT_NULL_MESSAGE(item->child, "Item has a child.")
115 #define assert_is_invalid(item) \
116 assert_has_type(item, cJSON_Invalid);\
117 assert_not_in_list(item);\
118 assert_has_no_child(item);\
119 assert_has_no_string(item);\
120 assert_has_no_valuestring(item)