tst_Async: Reuse TaskTree:runBlocking()

Change-Id: Ia5dd76bed15014d920e44f51de1774323be0b9a6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2023-05-16 23:26:40 +02:00
parent 6a8e8f5fbd
commit f0acaecc63

View File

@@ -439,12 +439,7 @@ void tst_Async::taskTree()
};
TaskTree tree(root);
QEventLoop eventLoop;
connect(&tree, &TaskTree::done, &eventLoop, &QEventLoop::quit);
tree.start();
eventLoop.exec();
QVERIFY(tree.runBlocking(1000));
QCOMPARE(value, 16);
}
@@ -581,12 +576,7 @@ void tst_Async::mapReduce()
QFETCH(QList<double>, results);
TaskTree tree(root);
QEventLoop eventLoop;
connect(&tree, &TaskTree::done, &eventLoop, &QEventLoop::quit);
tree.start();
eventLoop.exec();
QVERIFY(tree.runBlocking(1000));
QCOMPARE(s_results, results);
QCOMPARE(s_sum, sum);
}