From f0acaecc6340e6c594296e890fefce5ed865c5ed Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Tue, 16 May 2023 23:26:40 +0200 Subject: [PATCH] tst_Async: Reuse TaskTree:runBlocking() Change-Id: Ia5dd76bed15014d920e44f51de1774323be0b9a6 Reviewed-by: Qt CI Bot Reviewed-by: Marcus Tillmanns Reviewed-by: --- tests/auto/utils/async/tst_async.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tests/auto/utils/async/tst_async.cpp b/tests/auto/utils/async/tst_async.cpp index bf7cae7eff1..4a496f93a00 100644 --- a/tests/auto/utils/async/tst_async.cpp +++ b/tests/auto/utils/async/tst_async.cpp @@ -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, 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); }