| 36 | #endif |
| 37 | |
| 38 | static void test_json_benchmark(int max) |
| 39 | { |
| 40 | cJSON *json; |
| 41 | |
| 42 | ACL_METER_TIME("-------------bat begin--------------"); |
| 43 | |
| 44 | for (int i = 0; i < max; i++) |
| 45 | { |
| 46 | const char* ptr = default_data; |
| 47 | json = cJSON_Parse(ptr); |
| 48 | if (json == NULL) |
| 49 | { |
| 50 | printf("parse error: %s\r\n", ptr); |
| 51 | break; |
| 52 | } |
| 53 | cJSON_Delete(json); |
| 54 | } |
| 55 | |
| 56 | ACL_METER_TIME("-------------bat end--------------"); |
| 57 | } |
| 58 | |
| 59 | static int benchmark_max = 100; |
| 60 |
no test coverage detected
searching dependent graphs…