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

Function test_get

lib_acl_cpp/samples/redis/redis_string/redis_string.cpp:100–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100static bool test_get(acl::redis_string& redis, int n)
101{
102 acl::string key;
103 acl::string value;
104
105 for (int i = 0; i < n; i++)
106 {
107 key.format("%s_%d", __keypre.c_str(), i);
108 //key.format("key1_%s_%d", __keypre.c_str(), i);
109 value.clear();
110
111 redis.clear();
112 if (redis.get(key.c_str(), value) == false)
113 {
114 printf("get key: %s\r\n", key.c_str());
115 return false;
116 }
117 else if (i < 10)
118 printf("key: %s, value: %s, len: %d\r\n",
119 key.c_str(), value.c_str(),
120 (int) value.length());
121 }
122
123 return true;
124}
125
126static bool test_getset(acl::redis_string& redis, int n)
127{

Callers 1

mainFunction · 0.70

Calls 5

formatMethod · 0.45
c_strMethod · 0.45
clearMethod · 0.45
getMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…