| 179 | } |
| 180 | |
| 181 | int main(int argc, char* argv[]) |
| 182 | { |
| 183 | int ch, conn_timeout = 10, rw_timeout = 10; |
| 184 | acl::string addr("127.0.0.1:6379"); |
| 185 | bool slice_req = false; |
| 186 | |
| 187 | while ((ch = getopt(argc, argv, "hs:C:I:S")) > 0) |
| 188 | { |
| 189 | switch (ch) |
| 190 | { |
| 191 | case 'h': |
| 192 | usage(argv[0]); |
| 193 | return 0; |
| 194 | case 's': |
| 195 | addr = optarg; |
| 196 | break; |
| 197 | case 'C': |
| 198 | conn_timeout = atoi(optarg); |
| 199 | break; |
| 200 | case 'I': |
| 201 | rw_timeout = atoi(optarg); |
| 202 | break; |
| 203 | case 'S': |
| 204 | slice_req = true; |
| 205 | break; |
| 206 | default: |
| 207 | break; |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | acl::acl_cpp_init(); |
| 212 | acl::redis_client client(addr.c_str(), conn_timeout, rw_timeout); |
| 213 | client.set_slice_request(slice_req); |
| 214 | client.set_slice_respond(false); |
| 215 | acl::redis_transaction redis(&client); |
| 216 | |
| 217 | bool ret; |
| 218 | |
| 219 | ret = test_multi(redis) && test_run_cmds(redis) |
| 220 | && test_exec(redis) && get_results(redis); |
| 221 | |
| 222 | printf("all cmds %s\r\n", ret ? "ok" : "failed"); |
| 223 | |
| 224 | #ifdef WIN32 |
| 225 | printf("enter any key to exit\r\n"); |
| 226 | getchar(); |
| 227 | #endif |
| 228 | return 0; |
| 229 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…