| 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(){ |
nothing calls this directly
no test coverage detected