| 2 | #include "util.h" |
| 3 | |
| 4 | static void test1(const char* tokens[]) |
| 5 | { |
| 6 | acl::token_tree tree; |
| 7 | |
| 8 | for (size_t i = 0; tokens[i] != NULL; i++) { |
| 9 | printf("add token=%s\r\n", tokens[i]); |
| 10 | tree.insert(tokens[i]); |
| 11 | } |
| 12 | |
| 13 | printf("======================================================\r\n"); |
| 14 | for (size_t i = 0; tokens[i] != NULL; i++) { |
| 15 | const acl::token_node* node = tree.find(tokens[i]); |
| 16 | if (node == NULL) { |
| 17 | printf("can't found %s\r\n", tokens[i]); |
| 18 | break; |
| 19 | } |
| 20 | printf("ok, find it, key=%s\r\n", node->get_key()); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | static void test2(void) |
| 25 | { |