| 98 | } |
| 99 | |
| 100 | static bool test_get(acl::redis_string& redis, int n) |
| 101 | { |
| 102 | acl::string key; |
| 103 | acl::string value; |
| 104 | |
| 105 | for (int i = 0; i < n; i++) |
| 106 | { |
| 107 | key.format("%s_%d", __keypre.c_str(), i); |
| 108 | //key.format("key1_%s_%d", __keypre.c_str(), i); |
| 109 | value.clear(); |
| 110 | |
| 111 | redis.clear(); |
| 112 | if (redis.get(key.c_str(), value) == false) |
| 113 | { |
| 114 | printf("get key: %s\r\n", key.c_str()); |
| 115 | return false; |
| 116 | } |
| 117 | else if (i < 10) |
| 118 | printf("key: %s, value: %s, len: %d\r\n", |
| 119 | key.c_str(), value.c_str(), |
| 120 | (int) value.length()); |
| 121 | } |
| 122 | |
| 123 | return true; |
| 124 | } |
| 125 | |
| 126 | static bool test_getset(acl::redis_string& redis, int n) |
| 127 | { |