| 365 | |
| 366 | |
| 367 | void dotest4() |
| 368 | { |
| 369 | dlog << LINFO << "start dotest4()"; |
| 370 | print_spinner(); |
| 371 | bool error_occurred = false; |
| 372 | { |
| 373 | dlib::pipe<unsigned short> ports(5); |
| 374 | thread_function t1(callfunct(test4_job, 0, error_occurred, ports)); |
| 375 | thread_function t2(callfunct(test4_job, 0, error_occurred, ports)); |
| 376 | thread_function t3(callfunct(test4_job, 0, error_occurred, ports)); |
| 377 | |
| 378 | |
| 379 | try |
| 380 | { |
| 381 | std::vector<network_address> hosts; |
| 382 | unsigned short port; |
| 383 | ports.dequeue(port); hosts.push_back(network_address("127.0.0.1",port)); dlog << LINFO << "PORT: " << port; |
| 384 | ports.dequeue(port); hosts.push_back(network_address("127.0.0.1",port)); dlog << LINFO << "PORT: " << port; |
| 385 | ports.dequeue(port); hosts.push_back(network_address("127.0.0.1",port)); dlog << LINFO << "PORT: " << port; |
| 386 | int result = 0; |
| 387 | const int expected = 1+2+3 + 0+2+3 + 0+1+3 + 0+1+2; |
| 388 | bsp_connect(hosts, test4_job_driver, dlib::ref(result)); |
| 389 | |
| 390 | dlog << LINFO << "result: " << result; |
| 391 | dlog << LINFO << "should be: " << expected; |
| 392 | DLIB_TEST(result == expected); |
| 393 | } |
| 394 | catch (std::exception& e) |
| 395 | { |
| 396 | dlog << LERROR << "error during bsp_context: " << e.what(); |
| 397 | DLIB_TEST(false); |
| 398 | } |
| 399 | |
| 400 | } |
| 401 | DLIB_TEST(error_occurred == false); |
| 402 | } |
| 403 | |
| 404 | // ---------------------------------------------------------------------------------------- |
| 405 |
no test coverage detected