| 273 | |
| 274 | |
| 275 | void dotest3() |
| 276 | { |
| 277 | dlog << LINFO << "start dotest3()"; |
| 278 | print_spinner(); |
| 279 | bool error_occurred = false; |
| 280 | { |
| 281 | dlib::pipe<unsigned short> ports(5); |
| 282 | thread_function t1(callfunct(test3_job, 12345, error_occurred, ports)); |
| 283 | thread_function t2(callfunct(test3_job, 0, error_occurred, ports)); |
| 284 | thread_function t3(callfunct(test3_job, 12347, error_occurred, ports)); |
| 285 | |
| 286 | |
| 287 | try |
| 288 | { |
| 289 | std::vector<network_address> hosts; |
| 290 | unsigned short port; |
| 291 | ports.dequeue(port); hosts.push_back(network_address("127.0.0.1",port)); dlog << LINFO << "PORT: " << port; |
| 292 | ports.dequeue(port); hosts.push_back(network_address("127.0.0.1",port)); dlog << LINFO << "PORT: " << port; |
| 293 | ports.dequeue(port); hosts.push_back(network_address("127.0.0.1",port)); dlog << LINFO << "PORT: " << port; |
| 294 | int result = 0; |
| 295 | const int expected = 1+2+3 + 0+2+3 + 0+1+3 + 0+1+2; |
| 296 | bsp_connect(hosts, test3_job_driver, dlib::ref(result)); |
| 297 | |
| 298 | dlog << LINFO << "result: " << result; |
| 299 | dlog << LINFO << "should be: " << expected; |
| 300 | DLIB_TEST(result == expected); |
| 301 | } |
| 302 | catch (std::exception& e) |
| 303 | { |
| 304 | dlog << LERROR << "error during bsp_context: " << e.what(); |
| 305 | DLIB_TEST(false); |
| 306 | } |
| 307 | |
| 308 | } |
| 309 | DLIB_TEST(error_occurred == false); |
| 310 | } |
| 311 | |
| 312 | // ---------------------------------------------------------------------------------------- |
| 313 |
no test coverage detected