MCPcopy Create free account
hub / github.com/acl-dev/acl / test_json_data

Function test_json_data

lib_acl/samples/json/json1/main.cpp:174–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174static void test_json_data(const char* data)
175{
176 ACL_JSON* json = acl_json_alloc();
177 const char* ptr = data;
178 char buf[2];
179 ACL_VSTRING *tmp;
180
181 json->flag |= ACL_JSON_FLAG_PART_WORD;
182
183 if (1) {
184 while (*ptr)
185 {
186 buf[0] = *ptr++;
187 buf[1] = 0;
188 acl_json_update(json, buf);
189 /*
190 if (json->finish)
191 break;
192 */
193 }
194 }
195 else
196 acl_json_update(json, data);
197
198 test_json_foreach1(json);
199 test_json_foreach2(json);
200 test_json_find1(json);
201 test_json_find2(json);
202
203 tmp = acl_vstring_alloc(128);
204 acl_json_build(json, tmp);
205 printf(">>>source: |%s|\r\n", data);
206 printf(">>>result: |%s|\r\n", acl_vstring_str(tmp));
207 acl_vstring_free(tmp);
208 acl_json_free(json);
209}
210
211static void test_json_build(void)
212{

Callers 2

test_json_defaultFunction · 0.85
test_json_fileFunction · 0.85

Calls 10

acl_json_allocFunction · 0.85
acl_json_updateFunction · 0.85
test_json_foreach1Function · 0.85
test_json_foreach2Function · 0.85
test_json_find1Function · 0.85
test_json_find2Function · 0.85
acl_vstring_allocFunction · 0.85
acl_json_buildFunction · 0.85
acl_vstring_freeFunction · 0.85
acl_json_freeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…