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

Function test_expire

lib_acl_cpp/samples/redis/redis/redis.cpp:72–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72static bool test_expire(acl::redis& cmd, int n)
73{
74 acl::string key;
75
76 for (int i = 0; i < n; i++)
77 {
78 key.format("%s_%d", __keypre.c_str(), i);
79 cmd.clear();
80 if (cmd.expire(key.c_str(), 100) < 0)
81 {
82 printf("expire key: %s error: %s\r\n", key.c_str(),
83 cmd.result_error());
84 return false;
85 }
86 else if (i < 10)
87 printf("expire ok, key: %s\r\n", key.c_str());
88 }
89
90 return true;
91}
92
93static bool test_ttl(acl::redis& cmd, int n)
94{

Callers 1

mainFunction · 0.70

Calls 5

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