| 66 | } |
| 67 | |
| 68 | static void test_htable(int max) |
| 69 | { |
| 70 | ACL_HTABLE* htable = acl_htable_create(100, 0); |
| 71 | |
| 72 | for (int i = 0; tokens[i] != NULL; i++) { |
| 73 | acl_htable_enter(htable, tokens[i], (void*) tokens[i]); |
| 74 | } |
| 75 | |
| 76 | acl::meter_time(__FUNCTION__, __LINE__, "begin\t"); |
| 77 | |
| 78 | int j = 0; |
| 79 | for (int i = 0; i < max; i++) { |
| 80 | const char* value = (const char*) acl_htable_find(htable, tokens[j]); |
| 81 | if (value == NULL) { |
| 82 | printf("find error, key=%s\r\n", tokens[j]); |
| 83 | break; |
| 84 | } |
| 85 | if (tokens[++j] == NULL) { |
| 86 | j = 0; |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | acl::meter_time(__FUNCTION__, __LINE__, "end\t"); |
| 91 | acl_htable_free(htable, NULL); |
| 92 | } |
| 93 | |
| 94 | static void test_stdmap(int max) |
| 95 | { |
no test coverage detected
searching dependent graphs…