From 8618af7252260e1c283de20bc4cfd64d63b68770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Sun, 14 Dec 2014 13:11:47 +0100 Subject: Async: bring back synchronous Future::waitForFinished() --- async/autotests/asynctest.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'async/autotests') diff --git a/async/autotests/asynctest.cpp b/async/autotests/asynctest.cpp index 000bb2a..ffbce9e 100644 --- a/async/autotests/asynctest.cpp +++ b/async/autotests/asynctest.cpp @@ -37,19 +37,6 @@ public: ~AsyncTest() {} -private: - template - bool waitForFuture(const Async::Future &f) - { - QEventLoop eventLoop; - Async::FutureWatcher watcher; - connect(&watcher, &Async::FutureWatcher::futureReady, - &eventLoop, &QEventLoop::quit); - watcher.setFuture(f); - eventLoop.exec(); - return true; - } - private Q_SLOTS: void testSyncPromises(); void testAsyncPromises(); @@ -100,7 +87,7 @@ void AsyncTest::testAsyncPromises() Async::Future future = job.exec(); - QVERIFY(waitForFuture(future)); + future.waitForFinished(); QCOMPARE(future.value(), 42); } -- cgit v1.2.3