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

Function test_del

lib_acl_cpp/samples/redis/redis_key/redis_key.cpp:5–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3static acl::string __keypre("test_key");
4
5static bool test_del(acl::redis_key& redis, int n)
6{
7 acl::string key;
8
9 for (int i = 0; i < n; i++)
10 {
11 key.format("%s_%d", __keypre.c_str(), i);
12 redis.clear();
13 int ret = redis.del_one(key.c_str());
14 if (ret < 0)
15 {
16 printf("del key: %s error: %s\r\n",
17 key.c_str(), redis.result_error());
18 return false;
19 }
20 else if (i < 10)
21 printf("del ok, key: %s, ret: %d\r\n", key.c_str(), ret);
22 }
23
24 return true;
25}
26
27static bool test_expire(acl::redis_key& redis, int n)
28{

Callers 1

mainFunction · 0.70

Calls 5

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