@override
| 161 | protected: |
| 162 | // @override |
| 163 | void* run(void) |
| 164 | { |
| 165 | for (int i = min_; i < max_; i++) |
| 166 | { |
| 167 | lk_.lock(); |
| 168 | if (tbl_insert(db_, i)) |
| 169 | printf(">>insert ok: i=%d, affected: %d\r", |
| 170 | i, db_.affect_count()); |
| 171 | else |
| 172 | { |
| 173 | printf(">>insert error: i = %d\r\n", i); |
| 174 | abort(); |
| 175 | } |
| 176 | lk_.unlock(); |
| 177 | } |
| 178 | printf("\r\n"); |
| 179 | printf(">>insert total affect: %d\n", db_.affect_total_count()); |
| 180 | |
| 181 | int n = 0; |
| 182 | for (int i = min_; i < max_; i++) |
| 183 | { |
| 184 | lk_.lock(); |
| 185 | int ret = tbl_select(db_, i); |
| 186 | lk_.unlock(); |
| 187 | |
| 188 | if (ret >= 0) |
| 189 | { |
| 190 | n += ret; |
| 191 | printf(">>select ok: i=%d, ret=%d\r", i, ret); |
| 192 | } |
| 193 | else |
| 194 | { |
| 195 | printf(">>select error: i = %d\r\n", i); |
| 196 | abort(); |
| 197 | } |
| 198 | } |
| 199 | printf("\r\n"); |
| 200 | printf(">>select total: %d\r\n", n); |
| 201 | |
| 202 | for (int i = min_; i < max_; i++) |
| 203 | { |
| 204 | lk_.lock(); |
| 205 | if (tbl_delete(db_, i)) |
| 206 | printf(">>delete ok: %d, affected: %d\r", |
| 207 | i, (int) db_.affect_count()); |
| 208 | else |
| 209 | { |
| 210 | printf(">>delete error: i = %d\r\n", i); |
| 211 | abort(); |
| 212 | } |
| 213 | lk_.unlock(); |
| 214 | } |
| 215 | printf("\r\n"); |
| 216 | printf(">>delete total affected: %d\n", db_.affect_total_count()); |
| 217 | |
| 218 | return NULL; |
| 219 | } |
| 220 |
nothing calls this directly
no test coverage detected