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

Function test_hdel

lib_acl_cpp/samples/redis/redis_hash/redis_hash.cpp:206–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206static bool test_hdel(acl::redis_hash& redis, int n)
207{
208 acl::string key, attr;
209
210 for (int i = 0; i < n; i++)
211 {
212 key.format("%s_%d", __keypre.c_str(), i);
213 attr.format("attr1");
214
215 redis.clear();
216 int ret = redis.hdel(key.c_str(), attr.c_str());
217 if (ret < 0)
218 {
219 printf("hdel key: %s error: %s\r\n",
220 key.c_str(), redis.result_error());
221 return false;
222 }
223 else if (i < 10)
224 printf("hdel ok, key: %s\r\n", key.c_str());
225 }
226
227 return true;
228}
229
230static bool test_hincrby(acl::redis_hash& redis, int n)
231{

Callers 1

mainFunction · 0.85

Calls 5

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