MCPcopy Create free account
hub / github.com/acl-dev/acl / test_strlen

Function test_strlen

lib_acl_cpp/samples/redis/redis_string/redis_string.cpp:153–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153static bool test_strlen(acl::redis_string& redis, int n)
154{
155 acl::string key;
156
157 for (int i = 0; i < n; i++)
158 {
159 key.format("%s_%d", __keypre.c_str(), i);
160
161 redis.clear();
162 int ret = redis.get_strlen(key.c_str());
163 if (ret < 0)
164 {
165 printf("str_len error: %s, key: %s\r\n",
166 redis.result_error(), key.c_str());
167 return false;
168 }
169 else if (i < 10)
170 printf("key: %s's value's length: %d\r\n",
171 key.c_str(), ret);
172 }
173
174 return true;
175}
176
177static bool test_mset(acl::redis_string& redis, int n)
178{

Callers 1

mainFunction · 0.85

Calls 5

get_strlenMethod · 0.80
result_errorMethod · 0.80
formatMethod · 0.45
c_strMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…