diff options
Diffstat (limited to 'tests/auto/qtconcurrentmap')
-rw-r--r-- | tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp b/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp index f8c4a36c90..43075f1912 100644 --- a/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp +++ b/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp @@ -43,7 +43,6 @@ #include <qdebug.h> #include <QThread> -#include <QMutex> #include <QtTest/QtTest> @@ -77,7 +76,6 @@ private slots: void stlContainers(); void qFutureAssignmentLeak(); void stressTest(); - void persistentResultTest(); public slots: void throttling(); }; @@ -2418,47 +2416,6 @@ void tst_QtConcurrentMap::stressTest() } } -struct LockedCounter -{ - LockedCounter(QMutex *mutex, QAtomicInt *ai) - : mtx(mutex), - ref(ai) {} - - typedef int result_type; - int operator()(int x) - { - QMutexLocker locker(mtx); - ref->ref(); - return ++x; - } - - QMutex *mtx; - QAtomicInt *ref; -}; - -// The Thread engine holds the last reference -// to the QFuture, so this should not leak -// or fail. -void tst_QtConcurrentMap::persistentResultTest() -{ - QFuture<void> voidFuture; - QMutex mtx; - QAtomicInt ref; - LockedCounter lc(&mtx, &ref); - QList<int> list; - { - list << 1 << 2 << 3; - mtx.lock(); - QFuture<int> future = QtConcurrent::mapped(list - ,lc); - voidFuture = future; - } - QCOMPARE(int(ref), 0); - mtx.unlock(); // Unblock - voidFuture.waitForFinished(); - QCOMPARE(int(ref), 3); -} - QTEST_MAIN(tst_QtConcurrentMap) #else |