MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / test_basicConcurrentRun

Method test_basicConcurrentRun

tests/Task_test.cpp:80–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78 }
79
80 void test_basicConcurrentRun(){
81 BasicTask t1;
82 BasicTask t2;
83 BasicTask t3;
84
85 ConcurrentTask t;
86
87 t.addTask(&t1);
88 t.addTask(&t2);
89 t.addTask(&t3);
90
91 QObject::connect(&t, &Task::finished, [&]{
92 QVERIFY2(t.wasSuccessful(), "Task finished but was not successful when it should have been.");
93 QVERIFY(t1.wasSuccessful());
94 QVERIFY(t2.wasSuccessful());
95 QVERIFY(t3.wasSuccessful());
96 });
97
98 t.start();
99 QVERIFY2(QTest::qWaitFor([&]() {
100 return t.isFinished();
101 }, 1000), "Task didn't finish as it should.");
102 }
103
104 // Tests if starting new tasks after the 6 initial ones is working
105 void test_moreConcurrentRun(){

Callers

nothing calls this directly

Calls 4

addTaskMethod · 0.80
wasSuccessfulMethod · 0.80
isFinishedMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected