| 353 | } |
| 354 | |
| 355 | static bool test_setbit(acl::redis_string& redis, int n) |
| 356 | { |
| 357 | acl::string key; |
| 358 | unsigned off = 5; |
| 359 | |
| 360 | for (int i = 0; i < n; i++) |
| 361 | { |
| 362 | key.format("bit_%s_%d", __keypre.c_str(), i); |
| 363 | |
| 364 | redis.clear(); |
| 365 | if (redis.setbit_(key.c_str(), off, 1) == false) |
| 366 | { |
| 367 | printf("setbit error: %s, key: %s, off: %u\r\n", |
| 368 | redis.result_error(), key.c_str(), off); |
| 369 | return false; |
| 370 | } |
| 371 | else if (i >= 10) |
| 372 | continue; |
| 373 | |
| 374 | printf("setbit ok, key: %s, off: %d\r\n", key.c_str(), off); |
| 375 | } |
| 376 | |
| 377 | return true; |
| 378 | } |
| 379 | |
| 380 | static bool test_getbit(acl::redis_string& redis, int n) |
| 381 | { |