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

Function test_ttl

lib_acl_cpp/samples/redis/redis/redis.cpp:93–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93static bool test_ttl(acl::redis& cmd, int n)
94{
95 acl::string key;
96 int ttl;
97
98 for (int i = 0; i < n; i++)
99 {
100 key.format("%s_%d", __keypre.c_str(), i);
101 cmd.clear();
102 if ((ttl = cmd.ttl(key.c_str())) < 0)
103 {
104 printf("get ttl key: %s error: %s\r\n", key.c_str(),
105 cmd.result_error());
106 return false;
107 }
108 else if (i < 10)
109 printf("ttl ok, key: %s, ttl: %d\r\n",
110 key.c_str(), ttl);
111 }
112
113 return true;
114}
115
116static bool test_exists(acl::redis& cmd, int n)
117{

Callers 1

mainFunction · 0.70

Calls 5

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