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

Function test_json_foreach1

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

Source from the content-addressed store, hash-verified

43}
44
45static void test_json_foreach1(ACL_JSON* json)
46{
47 ACL_ITER iter;
48
49 printf("------------ in %s ------------\r\n", __FUNCTION__);
50
51 acl_foreach(iter, json)
52 {
53 const ACL_JSON_NODE* node = (const ACL_JSON_NODE*) iter.data;
54 print_json_node(json, node);
55 }
56
57 ACL_FILE* fp = acl_fopen("./json.txt", "w");
58 acl_assert(fp);
59 ACL_VSTRING* buf = acl_json_build(json, NULL);
60 acl_fwrite(acl_vstring_str(buf), ACL_VSTRING_LEN(buf), 1, fp);
61 acl_fclose(fp);
62 acl_vstring_free(buf);
63 printf("\r\n");
64}
65
66static void test_json_foreach2(ACL_JSON* json)
67{

Callers 1

test_json_dataFunction · 0.85

Calls 5

acl_fopenFunction · 0.85
acl_json_buildFunction · 0.85
acl_fwriteFunction · 0.85
acl_fcloseFunction · 0.85
acl_vstring_freeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…