| 48 | } |
| 49 | |
| 50 | static bool test_del(acl::redis& cmd, int n) |
| 51 | { |
| 52 | acl::string key; |
| 53 | |
| 54 | for (int i = 0; i < n; i++) |
| 55 | { |
| 56 | key.format("%s_%d", __keypre.c_str(), i); |
| 57 | cmd.clear(); |
| 58 | int ret = cmd.del_one(key.c_str()); |
| 59 | if (ret < 0) |
| 60 | { |
| 61 | printf("del key: %s error: %s\r\n", key.c_str(), |
| 62 | cmd.result_error()); |
| 63 | return false; |
| 64 | } |
| 65 | else if (i < 10) |
| 66 | printf("del ok, key: %s\r\n", key.c_str()); |
| 67 | } |
| 68 | |
| 69 | return true; |
| 70 | } |
| 71 | |
| 72 | static bool test_expire(acl::redis& cmd, int n) |
| 73 | { |