Lines Matching +full:copy +full:- +full:item
2 Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
4 Permission is hereby granted, free of charge, to any person obtaining a copy
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
28 void reset(cJSON *item);
29 void reset(cJSON *item) { in reset() argument
30 if ((item != NULL) && (item->child != NULL)) in reset()
32 cJSON_Delete(item->child); in reset()
34 if ((item->valuestring != NULL) && !(item->type & cJSON_IsReference)) in reset()
36 global_hooks.deallocate(item->valuestring); in reset()
38 if ((item->string != NULL) && !(item->type & cJSON_StringIsConst)) in reset()
40 global_hooks.deallocate(item->string); in reset()
43 memset(item, 0, sizeof(cJSON)); in reset()
103 #define assert_has_type(item, item_type) TEST_ASSERT_BITS_MESSAGE(0xFF, item_type, item->type, "Ite… argument
104 #define assert_has_no_reference(item) TEST_ASSERT_BITS_MESSAGE(cJSON_IsReference, 0, item->type, "I… argument
105 #define assert_has_no_const_string(item) TEST_ASSERT_BITS_MESSAGE(cJSON_StringIsConst, 0, item->typ… argument
106 #define assert_has_valuestring(item) TEST_ASSERT_NOT_NULL_MESSAGE(item->valuestring, "Valuestring i… argument
107 #define assert_has_no_valuestring(item) TEST_ASSERT_NULL_MESSAGE(item->valuestring, "Valuestring is… argument
108 #define assert_has_string(item) TEST_ASSERT_NOT_NULL_MESSAGE(item->string, "String is NULL") argument
109 #define assert_has_no_string(item) TEST_ASSERT_NULL_MESSAGE(item->string, "String is not NULL.") argument
110 #define assert_not_in_list(item) \ argument
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… argument
114 #define assert_has_no_child(item) TEST_ASSERT_NULL_MESSAGE(item->child, "Item has a child.") argument
115 #define assert_is_invalid(item) \ argument
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)