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

Function test_setrange

lib_acl_cpp/samples/redis/redis_string/redis_string.cpp:301–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301static bool test_setrange(acl::redis_string& redis, int n)
302{
303 acl::string key, value;
304 unsigned int off = 5;
305 int ret;
306
307 for (int i = 0; i < n; i++)
308 {
309 key.format("%s_%d", __keypre.c_str(), i);
310 value.format("range_value_%s", key.c_str());
311
312 redis.clear();
313 ret = redis.setrange(key.c_str(), off, value.c_str());
314 if (ret < 0)
315 {
316 printf("setrange error: %s, key: %s, off: %u, value: %s\r\n",
317 redis.result_error(), key.c_str(), off, value.c_str());
318 return false;
319 }
320 else if (i < 10)
321 printf("setrange ok, key: %s, off: %u, value: %s\r\n",
322 key.c_str(), off, value.c_str());
323 }
324
325 return true;
326}
327
328static bool test_getrange(acl::redis_string& redis, int n)
329{

Callers 1

mainFunction · 0.85

Calls 5

setrangeMethod · 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…