| 204 | } |
| 205 | |
| 206 | static bool test_hdel(acl::redis_hash& redis, int n) |
| 207 | { |
| 208 | acl::string key, attr; |
| 209 | |
| 210 | for (int i = 0; i < n; i++) |
| 211 | { |
| 212 | key.format("%s_%d", __keypre.c_str(), i); |
| 213 | attr.format("attr1"); |
| 214 | |
| 215 | redis.clear(); |
| 216 | int ret = redis.hdel(key.c_str(), attr.c_str()); |
| 217 | if (ret < 0) |
| 218 | { |
| 219 | printf("hdel key: %s error: %s\r\n", |
| 220 | key.c_str(), redis.result_error()); |
| 221 | return false; |
| 222 | } |
| 223 | else if (i < 10) |
| 224 | printf("hdel ok, key: %s\r\n", key.c_str()); |
| 225 | } |
| 226 | |
| 227 | return true; |
| 228 | } |
| 229 | |
| 230 | static bool test_hincrby(acl::redis_hash& redis, int n) |
| 231 | { |