MCPcopy Create free account
hub / github.com/davisking/dlib / dotest3

Function dotest3

dlib/test/bsp.cpp:275–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

perform_testMethod · 0.85

Calls 7

print_spinnerFunction · 0.85
callfunctFunction · 0.85
bsp_connectFunction · 0.85
refFunction · 0.85
network_addressClass · 0.50
push_backMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected