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

Function test_set

lib_acl_cpp/samples/redis/redis/redis.cpp:5–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3static acl::string __keypre("test_key");
4
5static bool test_set(acl::redis& cmd, int n)
6{
7 acl::string key, val;
8
9 for (int i = 0; i < n; i++)
10 {
11 key.format("%s_%d", __keypre.c_str(), i);
12 val.format("val_%s", key.c_str());
13 cmd.clear();
14 if (cmd.set(key, val) == false)
15 {
16 printf("set key: %s error: %s\r\n", key.c_str(),
17 cmd.result_error());
18 return false;
19 }
20 else if (i < 10)
21 printf("set key: %s ok\r\n", key.c_str());
22 }
23
24 return true;
25}
26
27static bool test_get(acl::redis& cmd, int n)
28{

Callers 1

mainFunction · 0.70

Calls 5

result_errorMethod · 0.80
formatMethod · 0.45
c_strMethod · 0.45
clearMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…