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

Function test_token_tree_c

lib_acl_cpp/samples/benchmark/token_tree/main.cpp:16–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14};
15
16static 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
43static void test_token_tree_cpp(int max)
44{

Callers 1

mainFunction · 0.85

Calls 5

acl_token_tree_createFunction · 0.85
acl_token_tree_addFunction · 0.85
meter_timeFunction · 0.85
acl_token_tree_destroyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…