| 96 | } |
| 97 | |
| 98 | int main(int argc, char* argv[]) |
| 99 | { |
| 100 | int ch, n = 1, conn_timeout = 10, rw_timeout = 10; |
| 101 | acl::string addr("127.0.0.1:6379"), cmd; |
| 102 | bool slice_req = false; |
| 103 | |
| 104 | while ((ch = getopt(argc, argv, "hs:n:C:I:a:S")) > 0) |
| 105 | { |
| 106 | switch (ch) |
| 107 | { |
| 108 | case 'h': |
| 109 | usage(argv[0]); |
| 110 | return 0; |
| 111 | case 's': |
| 112 | addr = optarg; |
| 113 | break; |
| 114 | case 'n': |
| 115 | n = atoi(optarg); |
| 116 | break; |
| 117 | case 'C': |
| 118 | conn_timeout = atoi(optarg); |
| 119 | break; |
| 120 | case 'I': |
| 121 | rw_timeout = atoi(optarg); |
| 122 | break; |
| 123 | case 'a': |
| 124 | cmd = optarg; |
| 125 | break; |
| 126 | case 'S': |
| 127 | slice_req = true; |
| 128 | break; |
| 129 | default: |
| 130 | break; |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | acl::acl_cpp_init(); |
| 135 | acl::redis_client client(addr.c_str(), conn_timeout, rw_timeout); |
| 136 | client.set_slice_request(slice_req); |
| 137 | acl::redis_connection redis(&client); |
| 138 | |
| 139 | bool ret; |
| 140 | |
| 141 | if (cmd == "auth") |
| 142 | ret = test_auth(redis); |
| 143 | else if (cmd == "echo") |
| 144 | ret = test_echo(redis, n); |
| 145 | else if (cmd == "ping") |
| 146 | ret = test_ping(redis, n); |
| 147 | else if (cmd == "quit") |
| 148 | ret = test_quit(redis); |
| 149 | else if (cmd == "select") |
| 150 | ret = test_select(redis, n); |
| 151 | else if (cmd == "all") |
| 152 | { |
| 153 | ret = test_auth(redis) |
| 154 | && test_echo(redis, n) |
| 155 | && test_ping(redis, n) |
nothing calls this directly
no test coverage detected
searching dependent graphs…