Lines Matching refs:tree
50 cJSON *tree = NULL;
76 tree = parse_file(test_path);
77 TEST_ASSERT_NOT_NULL_MESSAGE(tree, "Failed to read of parse test.");
79 /* print the parsed tree */
80 actual = cJSON_Print(tree);
81 TEST_ASSERT_NOT_NULL_MESSAGE(actual, "Failed to print tree back to JSON.");
91 if (tree != NULL)
93 cJSON_Delete(tree);
137 cJSON *tree = NULL;
142 tree = cJSON_Parse(test6);
143 TEST_ASSERT_NULL_MESSAGE(tree, "Should fail to parse what is not JSON.");
151 if (tree != NULL)
153 cJSON_Delete(tree);
185 cJSON *tree = NULL;
187 tree = cJSON_Parse(test12);
188 TEST_ASSERT_NULL_MESSAGE(tree, "Should fail to parse incomplete JSON.");
192 if (tree != NULL)
194 cJSON_Delete(tree);
200 cJSON *tree = NULL;
218 tree = cJSON_ParseWithLength(test_13_wo_null, sizeof(test_13) - 1);
219 TEST_ASSERT_NOT_NULL_MESSAGE(tree, "Failed to parse valid json.");
221 if (tree != NULL)
223 cJSON_Delete(tree);
229 cJSON *tree = NULL;
244 tree = cJSON_ParseWithLength(test_14, sizeof(test_14) - 2);
245 TEST_ASSERT_NULL_MESSAGE(tree, "Should not continue after buffer_length is reached.");
247 if (tree != NULL)
249 cJSON_Delete(tree);