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

Function test_getset

lib_acl_cpp/samples/redis/redis_string/redis_string.cpp:126–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126static bool test_getset(acl::redis_string& redis, int n)
127{
128 acl::string key;
129 acl::string value;
130 acl::string result;
131
132 for (int i = 0; i < n; i++)
133 {
134 key.format("%s_%d", __keypre.c_str(), i);
135 value.format("getset_%s", key.c_str());
136 result.clear();
137
138 redis.clear();
139 if (redis.getset(key.c_str(), value.c_str(), result) == false)
140 {
141 printf("getset error: %s, key: %s\r\n",
142 redis.result_error(), key.c_str());
143 return false;
144 }
145 else if (i < 10)
146 printf("getset: key: %s, old value: %s\r\n",
147 key.c_str(), result.c_str());
148 }
149
150 return true;
151}
152
153static bool test_strlen(acl::redis_string& redis, int n)
154{

Callers 1

mainFunction · 0.85

Calls 5

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