| 14 | }; |
| 15 | |
| 16 | static void test_token_tree_c(int max) |
| 17 | { |
| 18 | ACL_TOKEN* tree = acl_token_tree_create(NULL); |
| 19 | |
| 20 | for (int i = 0; tokens[i] != NULL; i++) { |
| 21 | acl_token_tree_add(tree, tokens[i], ACL_TOKEN_F_STOP, NULL); |
| 22 | } |
| 23 | |
| 24 | acl::meter_time(__FUNCTION__, __LINE__, "begin\t"); |
| 25 | |
| 26 | int j = 0; |
| 27 | for (int i = 0; i < max; i++) { |
| 28 | ACL_TOKEN* token = acl_token_tree_word_match(tree, tokens[j]); |
| 29 | if (token == NULL) { |
| 30 | printf("find error, key=%s\r\n", tokens[j]); |
| 31 | break; |
| 32 | } |
| 33 | if (tokens[++j] == NULL) { |
| 34 | j = 0; |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | acl::meter_time(__FUNCTION__, __LINE__, "end\t\t"); |
| 39 | |
| 40 | acl_token_tree_destroy(tree); |
| 41 | } |
| 42 | |
| 43 | static void test_token_tree_cpp(int max) |
| 44 | { |
no test coverage detected
searching dependent graphs…