MCPcopy Index your code
hub / github.com/DaveGamble/cJSON / parse_test_file

Function parse_test_file

tests/json_patch_tests.c:32–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30#include "../cJSON_Utils.h"
31
32static cJSON *parse_test_file(const char * const filename)
33{
34 char *file = NULL;
35 cJSON *json = NULL;
36
37 file = read_file(filename);
38 TEST_ASSERT_NOT_NULL_MESSAGE(file, "Failed to read file.");
39
40 json = cJSON_Parse(file);
41 TEST_ASSERT_NOT_NULL_MESSAGE(json, "Failed to parse test json.");
42 TEST_ASSERT_TRUE_MESSAGE(cJSON_IsArray(json), "Json is not an array.");
43
44 free(file);
45
46 return json;
47}
48
49static cJSON_bool test_apply_patch(const cJSON * const test)
50{

Calls 3

cJSON_ParseFunction · 0.85
cJSON_IsArrayFunction · 0.85
read_fileFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…