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

Function dotest2

dlib/test/bsp.cpp:191–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189
190 template <unsigned long id>
191 void dotest2()
192 {
193 dlog << LINFO << "start dotest2()";
194 print_spinner();
195 bool error_occurred = false;
196 {
197 thread_function t1(callfunct(test2_job<id>, 12345, error_occurred));
198 thread_function t2(callfunct(test2_job<id>, 12346, error_occurred));
199 thread_function t3(callfunct(test2_job<id>, 12347, error_occurred));
200
201 // wait a little bit for the threads to start up
202 dlib::sleep(200);
203
204 try
205 {
206 std::vector<network_address> hosts;
207 hosts.push_back("127.0.0.1:12345");
208 hosts.push_back("127.0.0.1:12346");
209 hosts.push_back("127.0.0.1:12347");
210 bsp_connect(hosts, test2_job<id>);
211 }
212 catch (std::exception& e)
213 {
214 dlog << LERROR << "error during bsp_context: " << e.what();
215 DLIB_TEST(false);
216 }
217
218 }
219 DLIB_TEST(error_occurred == false);
220 }
221
222// ----------------------------------------------------------------------------------------
223

Callers

nothing calls this directly

Calls 6

print_spinnerFunction · 0.85
callfunctFunction · 0.85
bsp_connectFunction · 0.85
sleepFunction · 0.50
push_backMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected