| 1023 | } |
| 1024 | |
| 1025 | void |
| 1026 | hstest_thread::test_11(int test_num) |
| 1027 | { |
| 1028 | const int keep_connection = arg.sh.conf.get_int("keep_connection", 1); |
| 1029 | const int tablesize = arg.sh.conf.get_int("tablesize", 0); |
| 1030 | unsigned int seed = arg.id; |
| 1031 | seed ^= arg.sh.conf.get_int("seed_xor", 0); |
| 1032 | std::string err; |
| 1033 | hstcpcli_ptr cli; |
| 1034 | for (size_t i = 0; i < arg.sh.loop; ++i) { |
| 1035 | if (cli.get() == 0) { |
| 1036 | cli = hstcpcli_i::create(arg.sh.arg); |
| 1037 | cli->request_buf_open_index(0, "hstest", "hstest_table1", "", "v"); |
| 1038 | /* pst_num, db, table, index, retflds */ |
| 1039 | if (cli->request_send() != 0) { |
| 1040 | fprintf(stderr, "reuqest_send: %s\n", cli->get_error().c_str()); |
| 1041 | return; |
| 1042 | } |
| 1043 | size_t num_flds = 0; |
| 1044 | if (cli->response_recv(num_flds) != 0) { |
| 1045 | fprintf(stderr, "reuqest_recv: %s\n", cli->get_error().c_str()); |
| 1046 | return; |
| 1047 | } |
| 1048 | cli->response_buf_remove(); |
| 1049 | } |
| 1050 | for (size_t j = 0; j < arg.sh.pipe; ++j) { |
| 1051 | char buf[256]; |
| 1052 | int k = 0, v = 0, len = 0; |
| 1053 | { |
| 1054 | k = rand_r(&seed); |
| 1055 | v = rand_r(&seed); /* unused */ |
| 1056 | if (tablesize != 0) { |
| 1057 | k &= tablesize; |
| 1058 | } |
| 1059 | len = snprintf(buf, sizeof(buf), "%d", k); |
| 1060 | } |
| 1061 | const string_ref key(buf, len); |
| 1062 | const string_ref op("=", 1); |
| 1063 | cli->request_buf_exec_generic(0, op, &key, 1, 1, 0, string_ref(), 0, 0); |
| 1064 | } |
| 1065 | if (cli->request_send() != 0) { |
| 1066 | fprintf(stderr, "reuqest_send: %s\n", cli->get_error().c_str()); |
| 1067 | return; |
| 1068 | } |
| 1069 | size_t read_cnt = 0; |
| 1070 | for (size_t j = 0; j < arg.sh.pipe; ++j) { |
| 1071 | size_t num_flds = 0; |
| 1072 | if (cli->response_recv(num_flds) != 0) { |
| 1073 | fprintf(stderr, "reuqest_recv: %s\n", cli->get_error().c_str()); |
| 1074 | return; |
| 1075 | } |
| 1076 | { |
| 1077 | ++read_cnt; |
| 1078 | ++io_success_count; |
| 1079 | arg.sh.increment_count(); |
| 1080 | { |
| 1081 | ++op_success_count; |
| 1082 | } |
nothing calls this directly
no test coverage detected