MCPcopy Create free account
hub / github.com/KDAB/GammaRay / threading

Method threading

tests/test_connections.cpp:237–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237void TestMain::threading()
238{
239 TestWaiter waiter;
240 const int timeouts = 10;
241 // some testers to be run in the main thread
242 // with varying timeouts
243 TestConnections tester1(TestConnections::NoEventLoop, timeouts, 10);
244 waiter.addTester(&tester1);
245 TestConnections tester2(TestConnections::Delete, timeouts, 11);
246 waiter.addTester(&tester2);
247 TestConnections tester3(TestConnections::DeleteLater, timeouts, 12);
248 waiter.addTester(&tester3);
249 TestConnections tester4(TestConnections::Stack, timeouts, 13);
250 waiter.addTester(&tester4);
251 TestConnections tester5(TestConnections::SetParent, timeouts, 14);
252 waiter.addTester(&tester5);
253 // now some threads
254 TestThread thread1(TestConnections::NoEventLoop, timeouts, 10);
255 waiter.addThread(&thread1);
256 TestThread thread2(TestConnections::Delete, timeouts, 11);
257 waiter.addThread(&thread2);
258 TestThread thread3(TestConnections::DeleteLater, timeouts, 12);
259 waiter.addThread(&thread3);
260 TestThread thread4(TestConnections::Stack, timeouts, 13);
261 waiter.addThread(&thread4);
262 TestThread thread5(TestConnections::SetParent, timeouts, 13);
263 waiter.addThread(&thread5);
264
265 waiter.startThreadsAndWaitForFinished();
266}
267
268// END TestMain
269

Callers

nothing calls this directly

Calls 3

addTesterMethod · 0.80
addThreadMethod · 0.80

Tested by

no test coverage detected