| 135 | } |
| 136 | |
| 137 | void test_basicConcurrentRun() |
| 138 | { |
| 139 | auto t1 = makeShared<BasicTask>(); |
| 140 | auto t2 = makeShared<BasicTask>(); |
| 141 | auto t3 = makeShared<BasicTask>(); |
| 142 | |
| 143 | ConcurrentTask t; |
| 144 | |
| 145 | t.addTask(t1); |
| 146 | t.addTask(t2); |
| 147 | t.addTask(t3); |
| 148 | |
| 149 | QObject::connect(&t, &Task::finished, [&t, &t1, &t2, &t3] { |
| 150 | QVERIFY2(t.wasSuccessful(), "Task finished but was not successful when it should have been."); |
| 151 | QVERIFY(t1->wasSuccessful()); |
| 152 | QVERIFY(t2->wasSuccessful()); |
| 153 | QVERIFY(t3->wasSuccessful()); |
| 154 | }); |
| 155 | |
| 156 | t.start(); |
| 157 | QVERIFY2(QTest::qWaitFor([&]() { return t.isFinished(); }, 1000), "Task didn't finish as it should."); |
| 158 | } |
| 159 | |
| 160 | // Tests if starting new tasks after the 6 initial ones is working |
| 161 | void test_moreConcurrentRun() |
nothing calls this directly
no test coverage detected