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

Function test_setbit

lib_acl_cpp/samples/redis/redis_string/redis_string.cpp:355–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353}
354
355static bool test_setbit(acl::redis_string& redis, int n)
356{
357 acl::string key;
358 unsigned off = 5;
359
360 for (int i = 0; i < n; i++)
361 {
362 key.format("bit_%s_%d", __keypre.c_str(), i);
363
364 redis.clear();
365 if (redis.setbit_(key.c_str(), off, 1) == false)
366 {
367 printf("setbit error: %s, key: %s, off: %u\r\n",
368 redis.result_error(), key.c_str(), off);
369 return false;
370 }
371 else if (i >= 10)
372 continue;
373
374 printf("setbit ok, key: %s, off: %d\r\n", key.c_str(), off);
375 }
376
377 return true;
378}
379
380static bool test_getbit(acl::redis_string& redis, int n)
381{

Callers 1

mainFunction · 0.85

Calls 5

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