forked from qt-creator/qt-creator
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:
@@ -439,12 +439,7 @@ void tst_Async::taskTree()
|
|||||||
};
|
};
|
||||||
|
|
||||||
TaskTree tree(root);
|
TaskTree tree(root);
|
||||||
|
QVERIFY(tree.runBlocking(1000));
|
||||||
QEventLoop eventLoop;
|
|
||||||
connect(&tree, &TaskTree::done, &eventLoop, &QEventLoop::quit);
|
|
||||||
tree.start();
|
|
||||||
eventLoop.exec();
|
|
||||||
|
|
||||||
QCOMPARE(value, 16);
|
QCOMPARE(value, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -581,12 +576,7 @@ void tst_Async::mapReduce()
|
|||||||
QFETCH(QList<double>, results);
|
QFETCH(QList<double>, results);
|
||||||
|
|
||||||
TaskTree tree(root);
|
TaskTree tree(root);
|
||||||
|
QVERIFY(tree.runBlocking(1000));
|
||||||
QEventLoop eventLoop;
|
|
||||||
connect(&tree, &TaskTree::done, &eventLoop, &QEventLoop::quit);
|
|
||||||
tree.start();
|
|
||||||
eventLoop.exec();
|
|
||||||
|
|
||||||
QCOMPARE(s_results, results);
|
QCOMPARE(s_results, results);
|
||||||
QCOMPARE(s_sum, sum);
|
QCOMPARE(s_sum, sum);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user