From 2bce62a3189fc7d6822dc0ee7c07d274cda2f193 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Fri, 13 Nov 2020 14:09:15 +0100 Subject: Conditionally disable code snippets that depend on cxx11_future MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTBUG-88392 Change-Id: Ida215253fdcad66a5a67084d3ff6781583101859 Reviewed-by: Tony Sarajärvi --- tests/auto/corelib/thread/qpromise/snippet_qpromise.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/auto/corelib/thread') diff --git a/tests/auto/corelib/thread/qpromise/snippet_qpromise.cpp b/tests/auto/corelib/thread/qpromise/snippet_qpromise.cpp index 65a0921616..fec23c1e81 100644 --- a/tests/auto/corelib/thread/qpromise/snippet_qpromise.cpp +++ b/tests/auto/corelib/thread/qpromise/snippet_qpromise.cpp @@ -71,6 +71,7 @@ public: void snippet_QPromise::basicExample() { +#if QT_CONFIG(cxx11_future) //! [basic] QPromise promise; QFuture future = promise.future(); @@ -88,10 +89,12 @@ void snippet_QPromise::basicExample() QCOMPARE(future.result(), 42); thread->wait(); +#endif } void snippet_QPromise::multithreadExample() { +#if QT_CONFIG(cxx11_future) //! [multithread_init] QSharedPointer> sharedPromise(new QPromise()); QFuture future = sharedPromise->future(); @@ -133,10 +136,12 @@ void snippet_QPromise::multithreadExample() for (auto& t : threads) t->wait(); sharedPromise->finish(); +#endif } void snippet_QPromise::suspendExample() { +#if QT_CONFIG(cxx11_future) //! [suspend_start] // Create promise and future QPromise promise; @@ -194,4 +199,5 @@ void snippet_QPromise::suspendExample() QList expected(100); std::iota(expected.begin(), expected.end(), 0); QCOMPARE(future.results(), expected); +#endif } -- cgit v1.2.3