| 3 | static acl::string __keypre("test_key"); |
| 4 | |
| 5 | static bool test_del(acl::redis_key& redis, int n) |
| 6 | { |
| 7 | acl::string key; |
| 8 | |
| 9 | for (int i = 0; i < n; i++) |
| 10 | { |
| 11 | key.format("%s_%d", __keypre.c_str(), i); |
| 12 | redis.clear(); |
| 13 | int ret = redis.del_one(key.c_str()); |
| 14 | if (ret < 0) |
| 15 | { |
| 16 | printf("del key: %s error: %s\r\n", |
| 17 | key.c_str(), redis.result_error()); |
| 18 | return false; |
| 19 | } |
| 20 | else if (i < 10) |
| 21 | printf("del ok, key: %s, ret: %d\r\n", key.c_str(), ret); |
| 22 | } |
| 23 | |
| 24 | return true; |
| 25 | } |
| 26 | |
| 27 | static bool test_expire(acl::redis_key& redis, int n) |
| 28 | { |