diff options
Diffstat (limited to 'async/autotests/asynctest.cpp')
-rw-r--r-- | async/autotests/asynctest.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
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: | |||
37 | ~AsyncTest() | 37 | ~AsyncTest() |
38 | {} | 38 | {} |
39 | 39 | ||
40 | private: | ||
41 | template<typename T> | ||
42 | bool waitForFuture(const Async::Future<T> &f) | ||
43 | { | ||
44 | QEventLoop eventLoop; | ||
45 | Async::FutureWatcher<T> watcher; | ||
46 | connect(&watcher, &Async::FutureWatcher<T>::futureReady, | ||
47 | &eventLoop, &QEventLoop::quit); | ||
48 | watcher.setFuture(f); | ||
49 | eventLoop.exec(); | ||
50 | return true; | ||
51 | } | ||
52 | |||
53 | private Q_SLOTS: | 40 | private Q_SLOTS: |
54 | void testSyncPromises(); | 41 | void testSyncPromises(); |
55 | void testAsyncPromises(); | 42 | void testAsyncPromises(); |
@@ -100,7 +87,7 @@ void AsyncTest::testAsyncPromises() | |||
100 | 87 | ||
101 | Async::Future<int> future = job.exec(); | 88 | Async::Future<int> future = job.exec(); |
102 | 89 | ||
103 | QVERIFY(waitForFuture<int>(future)); | 90 | future.waitForFinished(); |
104 | QCOMPARE(future.value(), 42); | 91 | QCOMPARE(future.value(), 42); |
105 | } | 92 | } |
106 | 93 | ||