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

Function test_getbit

lib_acl_cpp/samples/redis/redis_string/redis_string.cpp:380–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378}
379
380static bool test_getbit(acl::redis_string& redis, int n)
381{
382 acl::string key;
383 unsigned off = 5;
384 int bit;
385
386 for (int i = 0; i < n; i++)
387 {
388 key.format("bit_%s_%d", __keypre.c_str(), i);
389
390 redis.clear();
391 if (redis.getbit(key.c_str(), off, bit) == false)
392 {
393 printf("getbit error: %s, key: %s, off: %u\r\n",
394 redis.result_error(), key.c_str(), off);
395 return false;
396 }
397 else if (i >= 10)
398 continue;
399
400 printf("getbit ok, key: %s, off: %d, bit: %d\r\n",
401 key.c_str(), off, bit);
402 }
403
404 return true;
405}
406
407static bool test_bitcount(acl::redis_string& redis, int n)
408{

Callers 1

mainFunction · 0.85

Calls 5

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