summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/thread/qpromise/tst_qpromise.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2023-08-01 11:01:42 -0700
committerThiago Macieira <thiago.macieira@intel.com>2023-08-02 12:36:18 -0700
commit4a5f3c8b930d319ce2ecc802a0868164f18034db (patch)
tree43992b6fe4c68cc13772ad1d6eb7c47fb5aa6425 /tests/auto/corelib/thread/qpromise/tst_qpromise.cpp
parentf44072ca437bc943ac45e4bee69720499a0f8843 (diff)
CMake: remove check for cxx11_future
Everyone must have this by now. This test was 1193 ms of CMake time. Since this was a PUBLIC feature, I've left it around with a constant condition. Change-Id: Ifbf974a4d10745b099b1fffd177754538bbff245 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/corelib/thread/qpromise/tst_qpromise.cpp')
-rw-r--r--tests/auto/corelib/thread/qpromise/tst_qpromise.cpp42
1 files changed, 0 insertions, 42 deletions
diff --git a/tests/auto/corelib/thread/qpromise/tst_qpromise.cpp b/tests/auto/corelib/thread/qpromise/tst_qpromise.cpp
index 1002361005..d332dbc5e4 100644
--- a/tests/auto/corelib/thread/qpromise/tst_qpromise.cpp
+++ b/tests/auto/corelib/thread/qpromise/tst_qpromise.cpp
@@ -86,7 +86,6 @@ do { \
QFAIL("Test case " #test "(" #__VA_ARGS__ ") failed"); \
} while (false)
-#if QT_CONFIG(cxx11_future)
// std::thread-like wrapper that ensures that the thread is joined at the end of
// a scope to prevent potential std::terminate
struct ThreadWrapper
@@ -103,7 +102,6 @@ struct ThreadWrapper
t->wait();
}
};
-#endif
void tst_QPromise::promise()
{
@@ -344,9 +342,6 @@ void tst_QPromise::progress()
void tst_QPromise::addInThread()
{
-#if !QT_CONFIG(cxx11_future)
- QSKIP("This test requires QThread::create");
-#else
const auto testAddResult = [] (auto promise, const auto &result) {
promise.start();
auto f = promise.future();
@@ -362,14 +357,10 @@ void tst_QPromise::addInThread()
RUN_TEST_FUNC(testAddResult, QPromise<int>(), 42);
RUN_TEST_FUNC(testAddResult, QPromise<QString>(), u8"42");
RUN_TEST_FUNC(testAddResult, QPromise<CopyOnlyType>(), CopyOnlyType{99});
-#endif
}
void tst_QPromise::addInThreadMoveOnlyObject()
{
-#if !QT_CONFIG(cxx11_future)
- QSKIP("This test requires QThread::create");
-#else
QPromise<MoveOnlyType> promise;
promise.start();
auto f = promise.future();
@@ -381,14 +372,10 @@ void tst_QPromise::addInThreadMoveOnlyObject()
// Iterators wait for result first
for (auto& result : f)
QCOMPARE(result, MoveOnlyType{-11});
-#endif
}
void tst_QPromise::reportFromMultipleThreads()
{
-#if !QT_CONFIG(cxx11_future)
- QSKIP("This test requires QThread::create");
-#else
QPromise<int> promise;
auto f = promise.future();
promise.start();
@@ -407,14 +394,10 @@ void tst_QPromise::reportFromMultipleThreads()
QVERIFY(std::find(expected.begin(), expected.end(), actual) != expected.end());
expected.removeOne(actual);
}
-#endif
}
void tst_QPromise::reportFromMultipleThreadsByMovedPromise()
{
-#if !QT_CONFIG(cxx11_future)
- QSKIP("This test requires QThread::create");
-#else
QPromise<int> initialPromise;
auto f = initialPromise.future();
{
@@ -441,14 +424,10 @@ void tst_QPromise::reportFromMultipleThreadsByMovedPromise()
QVERIFY(std::find(expected.begin(), expected.end(), actual) != expected.end());
expected.removeOne(actual);
}
-#endif
}
void tst_QPromise::doNotCancelWhenFinished()
{
-#if !QT_CONFIG(cxx11_future)
- QSKIP("This test requires QThread::create");
-#else
const auto testFinishedPromise = [] (auto promise) {
auto f = promise.future();
promise.start();
@@ -467,15 +446,11 @@ void tst_QPromise::doNotCancelWhenFinished()
RUN_TEST_FUNC(testFinishedPromise, QPromise<QString>());
RUN_TEST_FUNC(testFinishedPromise, QPromise<CopyOnlyType>());
RUN_TEST_FUNC(testFinishedPromise, QPromise<MoveOnlyType>());
-#endif
}
#ifndef QT_NO_EXCEPTIONS
void tst_QPromise::cancelWhenDestroyed()
{
-#if !QT_CONFIG(cxx11_future)
- QSKIP("This test requires QThread::create");
-#else
QPromise<int> initialPromise;
auto f = initialPromise.future();
@@ -503,15 +478,11 @@ void tst_QPromise::cancelWhenDestroyed()
QVERIFY(std::find(expected.begin(), expected.end(), actual) != expected.end());
expected.removeOne(actual);
}
-#endif
}
#endif
void tst_QPromise::cancelWhenReassigned()
{
-#if !QT_CONFIG(cxx11_future)
- QSKIP("This test requires QThread::create");
-#else
QPromise<int> promise;
auto f = promise.future();
promise.start();
@@ -525,7 +496,6 @@ void tst_QPromise::cancelWhenReassigned()
QCOMPARE(f.isFinished(), true);
QCOMPARE(f.isCanceled(), true);
-#endif
}
template <typename T>
@@ -640,9 +610,6 @@ void tst_QPromise::continuationsRunWhenFinished()
void tst_QPromise::finishWhenSwapped()
{
-#if !QT_CONFIG(cxx11_future)
- QSKIP("This test requires QThread::create");
-#else
QPromise<int> promise1;
auto f1 = promise1.future();
promise1.start();
@@ -677,15 +644,11 @@ void tst_QPromise::finishWhenSwapped()
QCOMPARE(f2.resultAt(0), 1);
QCOMPARE(f2.resultAt(1), 2);
-#endif
}
template <typename T>
void testCancelWhenMoved()
{
-#if !QT_CONFIG(cxx11_future)
- QSKIP("This test requires QThread::create");
-#else
QPromise<T> promise1;
auto f1 = promise1.future();
promise1.start();
@@ -711,7 +674,6 @@ void testCancelWhenMoved()
// Future #2 is explicitly finished inside thread
QCOMPARE(f2.isFinished(), true);
QCOMPARE(f2.isCanceled(), false);
-#endif
}
void tst_QPromise::cancelWhenMoved()
@@ -753,9 +715,6 @@ void tst_QPromise::waitUntilResumed()
void tst_QPromise::waitUntilCanceled()
{
-#if !QT_CONFIG(cxx11_future)
- QSKIP("This test requires QThread::create");
-#else
QPromise<int> promise;
promise.start();
auto f = promise.future();
@@ -776,7 +735,6 @@ void tst_QPromise::waitUntilCanceled()
f.waitForFinished();
QCOMPARE(f.resultCount(), 0);
-#endif
}
// Below is a quick and dirty hack to make snippets a part of a test suite