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

Function test_getrange

lib_acl_cpp/samples/redis/redis_string/redis_string.cpp:328–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326}
327
328static bool test_getrange(acl::redis_string& redis, int n)
329{
330 acl::string key, value;
331 int start = 5, end = 10;
332
333 for (int i = 0; i < n; i++)
334 {
335 key.format("%s_%d", __keypre.c_str(), i);
336 value.clear();
337
338 redis.clear();
339 if (redis.getrange(key, start, end, value) == false)
340 {
341 printf("getrange error: %s, key: %s, start: %d, end: %d\r\n",
342 redis.result_error(), key.c_str(), start, end);
343 return false;
344 }
345 else if (i >= 10)
346 continue;
347
348 printf("getrange ok, key: %s, start: %d, end: %d, value: %s\r\n",
349 key.c_str(), start, end, value.c_str());
350 }
351
352 return true;
353}
354
355static bool test_setbit(acl::redis_string& redis, int n)
356{

Callers 1

mainFunction · 0.85

Calls 5

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