| 43 | } |
| 44 | |
| 45 | static 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 | |
| 66 | static void test_json_foreach2(ACL_JSON* json) |
| 67 | { |
no test coverage detected
searching dependent graphs…