summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-02-03 14:17:26 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-05 17:49:16 +0100
commit96501b0a18f4f70048403dccc4cb42dd71db8f9d (patch)
treeec4b95139854d1116ad75467c3c08df39fafeb27 /tests
parentc8156cab81690526adffa22214657fc1c6563b8b (diff)
Move QtConcurrent into its own module
Task-number: QTBUG-20892 Change-Id: I614500aafb6428915509983608bbb0ade4e4f016 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/auto.pro4
-rw-r--r--tests/auto/concurrent/concurrent.pro (renamed from tests/auto/corelib/concurrent/concurrent.pro)3
-rw-r--r--tests/auto/concurrent/qfuture/.gitignore (renamed from tests/auto/corelib/concurrent/qfuture/.gitignore)0
-rw-r--r--tests/auto/concurrent/qfuture/qfuture.pro (renamed from tests/auto/corelib/concurrent/qfuture/qfuture.pro)2
-rw-r--r--tests/auto/concurrent/qfuture/tst_qfuture.cpp (renamed from tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp)0
-rw-r--r--tests/auto/concurrent/qfuturesynchronizer/qfuturesynchronizer.pro (renamed from tests/auto/corelib/concurrent/qfuturesynchronizer/qfuturesynchronizer.pro)2
-rw-r--r--tests/auto/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp (renamed from tests/auto/corelib/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp)4
-rw-r--r--tests/auto/concurrent/qfuturewatcher/.gitignore (renamed from tests/auto/corelib/concurrent/qfuturewatcher/.gitignore)0
-rw-r--r--tests/auto/concurrent/qfuturewatcher/qfuturewatcher.pro (renamed from tests/auto/corelib/concurrent/qfuturewatcher/qfuturewatcher.pro)2
-rw-r--r--tests/auto/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp (renamed from tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp)5
-rw-r--r--tests/auto/concurrent/qtconcurrentfilter/.gitignore (renamed from tests/auto/corelib/concurrent/qtconcurrentfilter/.gitignore)0
-rw-r--r--tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro (renamed from tests/auto/corelib/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro)2
-rw-r--r--tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp (renamed from tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp)0
-rw-r--r--tests/auto/concurrent/qtconcurrentiteratekernel/.gitignore (renamed from tests/auto/corelib/concurrent/qtconcurrentiteratekernel/.gitignore)0
-rw-r--r--tests/auto/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro (renamed from tests/auto/corelib/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro)2
-rw-r--r--tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp (renamed from tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp)0
-rw-r--r--tests/auto/concurrent/qtconcurrentmap/.gitignore (renamed from tests/auto/corelib/concurrent/qtconcurrentmap/.gitignore)0
-rw-r--r--tests/auto/concurrent/qtconcurrentmap/functions.h (renamed from tests/auto/corelib/concurrent/qtconcurrentmap/functions.h)0
-rw-r--r--tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro (renamed from tests/auto/corelib/concurrent/qtconcurrentmap/qtconcurrentmap.pro)2
-rw-r--r--tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp (renamed from tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp)0
-rw-r--r--tests/auto/concurrent/qtconcurrentresultstore/qtconcurrentresultstore.pro (renamed from tests/auto/corelib/concurrent/qtconcurrentresultstore/qtconcurrentresultstore.pro)2
-rw-r--r--tests/auto/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp (renamed from tests/auto/corelib/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp)0
-rw-r--r--tests/auto/concurrent/qtconcurrentrun/.gitignore (renamed from tests/auto/corelib/concurrent/qtconcurrentrun/.gitignore)0
-rw-r--r--tests/auto/concurrent/qtconcurrentrun/qtconcurrentrun.pro (renamed from tests/auto/corelib/concurrent/qtconcurrentrun/qtconcurrentrun.pro)2
-rw-r--r--tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp (renamed from tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp)0
-rw-r--r--tests/auto/concurrent/qtconcurrentthreadengine/.gitignore (renamed from tests/auto/corelib/concurrent/qtconcurrentthreadengine/.gitignore)0
-rw-r--r--tests/auto/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro (renamed from tests/auto/corelib/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro)2
-rw-r--r--tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp (renamed from tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp)0
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp82
-rw-r--r--tests/auto/corelib/corelib.pro2
-rw-r--r--tests/auto/corelib/thread/qthreadpool/.gitignore (renamed from tests/auto/corelib/concurrent/qthreadpool/.gitignore)0
-rw-r--r--tests/auto/corelib/thread/qthreadpool/qthreadpool.pro (renamed from tests/auto/corelib/concurrent/qthreadpool/qthreadpool.pro)0
-rw-r--r--tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp (renamed from tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp)0
-rw-r--r--tests/auto/corelib/thread/thread.pro1
34 files changed, 71 insertions, 48 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 4f81c43553..1796fa2db9 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -10,6 +10,7 @@ SUBDIRS += \
testlib \
tools \
xml \
+ concurrent \
other \
widgets \
@@ -21,3 +22,6 @@ cross_compile: SUBDIRS -= tools
mac {
network.CONFIG += no_check_target
}
+
+!contains(QT_CONFIG, concurrent): SUBDIRS -= concurrent
+
diff --git a/tests/auto/corelib/concurrent/concurrent.pro b/tests/auto/concurrent/concurrent.pro
index 6541b0ce42..15368aef64 100644
--- a/tests/auto/corelib/concurrent/concurrent.pro
+++ b/tests/auto/concurrent/concurrent.pro
@@ -8,6 +8,5 @@ SUBDIRS=\
qtconcurrentmap \
qtconcurrentresultstore \
qtconcurrentrun \
- qtconcurrentthreadengine \
- qthreadpool
+ qtconcurrentthreadengine
diff --git a/tests/auto/corelib/concurrent/qfuture/.gitignore b/tests/auto/concurrent/qfuture/.gitignore
index 77c055c874..77c055c874 100644
--- a/tests/auto/corelib/concurrent/qfuture/.gitignore
+++ b/tests/auto/concurrent/qfuture/.gitignore
diff --git a/tests/auto/corelib/concurrent/qfuture/qfuture.pro b/tests/auto/concurrent/qfuture/qfuture.pro
index 517871ab5d..a4c706129d 100644
--- a/tests/auto/corelib/concurrent/qfuture/qfuture.pro
+++ b/tests/auto/concurrent/qfuture/qfuture.pro
@@ -1,5 +1,5 @@
CONFIG += testcase parallel_test
TARGET = tst_qfuture
-QT = core-private testlib
+QT = concurrent-private testlib concurrent
SOURCES = tst_qfuture.cpp
DEFINES += QT_STRICT_ITERATORS
diff --git a/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp b/tests/auto/concurrent/qfuture/tst_qfuture.cpp
index 3610f8f2d4..3610f8f2d4 100644
--- a/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp
+++ b/tests/auto/concurrent/qfuture/tst_qfuture.cpp
diff --git a/tests/auto/corelib/concurrent/qfuturesynchronizer/qfuturesynchronizer.pro b/tests/auto/concurrent/qfuturesynchronizer/qfuturesynchronizer.pro
index b36560b4ba..331a8e3c05 100644
--- a/tests/auto/corelib/concurrent/qfuturesynchronizer/qfuturesynchronizer.pro
+++ b/tests/auto/concurrent/qfuturesynchronizer/qfuturesynchronizer.pro
@@ -1,4 +1,4 @@
CONFIG += testcase parallel_test
TARGET = tst_qfuturesynchronizer
-QT = core testlib
+QT = core testlib concurrent
SOURCES = tst_qfuturesynchronizer.cpp
diff --git a/tests/auto/corelib/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp b/tests/auto/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp
index 5bf6d1d1f3..012c90de18 100644
--- a/tests/auto/corelib/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp
+++ b/tests/auto/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp
@@ -41,8 +41,8 @@
#include <QtTest>
-#include <QtCore/qfuturesynchronizer.h>
-#include <QtCore/qfuture.h>
+#include <QtConcurrent/qfuturesynchronizer.h>
+#include <QtConcurrent/qfuture.h>
class tst_QFutureSynchronizer : public QObject
{
diff --git a/tests/auto/corelib/concurrent/qfuturewatcher/.gitignore b/tests/auto/concurrent/qfuturewatcher/.gitignore
index 1d778431c5..1d778431c5 100644
--- a/tests/auto/corelib/concurrent/qfuturewatcher/.gitignore
+++ b/tests/auto/concurrent/qfuturewatcher/.gitignore
diff --git a/tests/auto/corelib/concurrent/qfuturewatcher/qfuturewatcher.pro b/tests/auto/concurrent/qfuturewatcher/qfuturewatcher.pro
index ae98fed3d9..3b8ebda4a4 100644
--- a/tests/auto/corelib/concurrent/qfuturewatcher/qfuturewatcher.pro
+++ b/tests/auto/concurrent/qfuturewatcher/qfuturewatcher.pro
@@ -1,4 +1,4 @@
CONFIG += testcase parallel_test
TARGET = tst_qfuturewatcher
-QT = core-private testlib
+QT = concurrent-private testlib concurrent
SOURCES = tst_qfuturewatcher.cpp
diff --git a/tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp b/tests/auto/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp
index 5a86d97d4e..fe3eb378d5 100644
--- a/tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp
+++ b/tests/auto/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp
@@ -42,10 +42,7 @@
#include <QDebug>
#include <QtTest/QtTest>
-#include <qfuture.h>
-#include <qfuturewatcher.h>
-#include <qtconcurrentrun.h>
-#include <qtconcurrentmap.h>
+#include <QtConcurrent>
#include <private/qfutureinterface_p.h>
using namespace QtConcurrent;
diff --git a/tests/auto/corelib/concurrent/qtconcurrentfilter/.gitignore b/tests/auto/concurrent/qtconcurrentfilter/.gitignore
index f93d27e009..f93d27e009 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentfilter/.gitignore
+++ b/tests/auto/concurrent/qtconcurrentfilter/.gitignore
diff --git a/tests/auto/corelib/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro b/tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro
index f783455b2e..eb0c054f6f 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro
+++ b/tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro
@@ -1,6 +1,6 @@
CONFIG += testcase parallel_test
TARGET = tst_qtconcurrentfilter
-QT = core testlib
+QT = core testlib concurrent
SOURCES = tst_qtconcurrentfilter.cpp
DEFINES += QT_STRICT_ITERATORS
diff --git a/tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp b/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp
index 971a6992ff..971a6992ff 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp
+++ b/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp
diff --git a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/.gitignore b/tests/auto/concurrent/qtconcurrentiteratekernel/.gitignore
index ac5dec4db6..ac5dec4db6 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/.gitignore
+++ b/tests/auto/concurrent/qtconcurrentiteratekernel/.gitignore
diff --git a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro b/tests/auto/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro
index e876c86725..4cfebc0e3d 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro
+++ b/tests/auto/concurrent/qtconcurrentiteratekernel/qtconcurrentiteratekernel.pro
@@ -1,4 +1,4 @@
CONFIG += testcase parallel_test
TARGET = tst_qtconcurrentiteratekernel
-QT = core testlib
+QT = core testlib concurrent
SOURCES = tst_qtconcurrentiteratekernel.cpp
diff --git a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp b/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
index 46562b5eb0..46562b5eb0 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
+++ b/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
diff --git a/tests/auto/corelib/concurrent/qtconcurrentmap/.gitignore b/tests/auto/concurrent/qtconcurrentmap/.gitignore
index f1c563e979..f1c563e979 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentmap/.gitignore
+++ b/tests/auto/concurrent/qtconcurrentmap/.gitignore
diff --git a/tests/auto/corelib/concurrent/qtconcurrentmap/functions.h b/tests/auto/concurrent/qtconcurrentmap/functions.h
index f5963db904..f5963db904 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentmap/functions.h
+++ b/tests/auto/concurrent/qtconcurrentmap/functions.h
diff --git a/tests/auto/corelib/concurrent/qtconcurrentmap/qtconcurrentmap.pro b/tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro
index b4f5cbc565..199e5ad4d6 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentmap/qtconcurrentmap.pro
+++ b/tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro
@@ -1,5 +1,5 @@
CONFIG += testcase parallel_test
TARGET = tst_qtconcurrentmap
-QT = core testlib
+QT = core testlib concurrent
SOURCES = tst_qtconcurrentmap.cpp
DEFINES += QT_STRICT_ITERATORS
diff --git a/tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
index 960511d87b..960511d87b 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
+++ b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
diff --git a/tests/auto/corelib/concurrent/qtconcurrentresultstore/qtconcurrentresultstore.pro b/tests/auto/concurrent/qtconcurrentresultstore/qtconcurrentresultstore.pro
index e93fc587a7..2c04f75025 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentresultstore/qtconcurrentresultstore.pro
+++ b/tests/auto/concurrent/qtconcurrentresultstore/qtconcurrentresultstore.pro
@@ -1,5 +1,5 @@
CONFIG += testcase parallel_test
TARGET = tst_qtconcurrentresultstore
-QT = core-private testlib
+QT = core-private testlib concurrent
SOURCES = tst_qtconcurrentresultstore.cpp
DEFINES += QT_STRICT_ITERATORS
diff --git a/tests/auto/corelib/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp b/tests/auto/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp
index 236d0b62e3..236d0b62e3 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp
+++ b/tests/auto/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp
diff --git a/tests/auto/corelib/concurrent/qtconcurrentrun/.gitignore b/tests/auto/concurrent/qtconcurrentrun/.gitignore
index d7a8334ec4..d7a8334ec4 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentrun/.gitignore
+++ b/tests/auto/concurrent/qtconcurrentrun/.gitignore
diff --git a/tests/auto/corelib/concurrent/qtconcurrentrun/qtconcurrentrun.pro b/tests/auto/concurrent/qtconcurrentrun/qtconcurrentrun.pro
index d4f130fecd..03d77b33a2 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentrun/qtconcurrentrun.pro
+++ b/tests/auto/concurrent/qtconcurrentrun/qtconcurrentrun.pro
@@ -1,4 +1,4 @@
CONFIG += testcase parallel_test
TARGET = tst_qtconcurrentrun
-QT = core testlib
+QT = core testlib concurrent
SOURCES = tst_qtconcurrentrun.cpp
diff --git a/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp b/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp
index 86e3433c12..86e3433c12 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp
+++ b/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp
diff --git a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/.gitignore b/tests/auto/concurrent/qtconcurrentthreadengine/.gitignore
index a2e2896246..a2e2896246 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/.gitignore
+++ b/tests/auto/concurrent/qtconcurrentthreadengine/.gitignore
diff --git a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro b/tests/auto/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro
index 536ccc3ea5..f6ddd33504 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro
+++ b/tests/auto/concurrent/qtconcurrentthreadengine/qtconcurrentthreadengine.pro
@@ -1,4 +1,4 @@
CONFIG += testcase parallel_test
TARGET = tst_qtconcurrentthreadengine
-QT = core testlib
+QT = core testlib concurrent
SOURCES = tst_qtconcurrentthreadengine.cpp
diff --git a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp b/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp
index 9722887c7d..9722887c7d 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp
+++ b/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp
diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
index ade17863d9..7daed397d5 100644
--- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
@@ -47,7 +47,6 @@
#include <qtextdocument.h>
#include <time.h>
#include <qprocess.h>
-#include <QtConcurrentMap>
#include <QThreadPool>
class tst_QTextCodec : public QObject
@@ -55,9 +54,7 @@ class tst_QTextCodec : public QObject
Q_OBJECT
private slots:
-#ifndef QT_NO_CONCURRENT
void threadSafety();
-#endif
void toUnicode_data();
void toUnicode();
@@ -1939,48 +1936,75 @@ void tst_QTextCodec::toLocal8Bit()
}
#endif
-static QByteArray loadAndConvert(const QByteArray &codecName)
+class LoadAndConvert: public QRunnable
{
- QTextCodec *c = QTextCodec::codecForName(codecName);
- if (!c) {
- qWarning() << "WARNING" << codecName << "not found?";
- return QByteArray();
+public:
+ LoadAndConvert(const QByteArray &source, QByteArray *destination)
+ : codecName(source), target(destination)
+ {}
+ QByteArray codecName;
+ QByteArray *target;
+ void run()
+ {
+ QTextCodec *c = QTextCodec::codecForName(codecName);
+ if (!c) {
+ qWarning() << "WARNING" << codecName << "not found?";
+ return;
+ }
+ QString str = QString::fromLatin1(codecName);
+ QByteArray b = c->fromUnicode(str);
+ c->toUnicode(b);
+ *target = codecName;
}
- QString str = QString::fromLatin1(codecName);
- QByteArray b = c->fromUnicode(str);
- c->toUnicode(b);
- return codecName;
-}
+};
-static int loadAndConvertMIB(int mib)
+class LoadAndConvertMIB: public QRunnable
{
- QTextCodec *c = QTextCodec::codecForMib(mib);
- if (!c) {
- qWarning() << "WARNING" << mib << "not found?";
- return 0;
+public:
+ LoadAndConvertMIB(int mib, int *target)
+ : mib(mib), target(target)
+ {}
+ int mib;
+ int *target;
+ void run()
+ {
+ QTextCodec *c = QTextCodec::codecForMib(mib);
+ if (!c) {
+ qWarning() << "WARNING" << mib << "not found?";
+ return;
+ }
+ QString str = QString::number(mib);
+ QByteArray b = c->fromUnicode(str);
+ c->toUnicode(b);
+ *target = mib;
}
- QString str = QString::number(mib);
- QByteArray b = c->fromUnicode(str);
- c->toUnicode(b);
- return mib;
-}
+};
-#ifndef QT_NO_CONCURRENT
void tst_QTextCodec::threadSafety()
{
QList<QByteArray> codecList = QTextCodec::availableCodecs();
QList<int> mibList = QTextCodec::availableMibs();
QThreadPool::globalInstance()->setMaxThreadCount(12);
- QFuture<QByteArray> res = QtConcurrent::mapped(codecList, loadAndConvert);
+ QVector<QByteArray> res;
+ res.resize(codecList.size());
+ for (int i = 0; i < codecList.size(); ++i) {
+ QThreadPool::globalInstance()->start(new LoadAndConvert(codecList.at(i), &res[i]));
+ }
- QFuture<int> res2 = QtConcurrent::mapped(mibList, loadAndConvertMIB);
+ QVector<int> res2;
+ res2.resize(mibList.size());
+ for (int i = 0; i < mibList.size(); ++i) {
+ QThreadPool::globalInstance()->start(new LoadAndConvertMIB(mibList.at(i), &res2[i]));
+ }
+
+ // wait for all threads to finish working
+ QThreadPool::globalInstance()->waitForDone();
- QCOMPARE(res.results(), codecList);
- QCOMPARE(res2.results(), mibList);
+ QCOMPARE(res.toList(), codecList);
+ QCOMPARE(res2.toList(), mibList);
}
-#endif
void tst_QTextCodec::invalidNames()
{
diff --git a/tests/auto/corelib/corelib.pro b/tests/auto/corelib/corelib.pro
index be12fdab62..4f284ac21e 100644
--- a/tests/auto/corelib/corelib.pro
+++ b/tests/auto/corelib/corelib.pro
@@ -2,7 +2,6 @@ TEMPLATE=subdirs
SUBDIRS=\
animation \
codecs \
- concurrent \
global \
io \
itemmodels \
@@ -14,4 +13,3 @@ SUBDIRS=\
tools \
xml
-!contains(QT_CONFIG, concurrent): SUBDIRS -= concurrent
diff --git a/tests/auto/corelib/concurrent/qthreadpool/.gitignore b/tests/auto/corelib/thread/qthreadpool/.gitignore
index 16105821a2..16105821a2 100644
--- a/tests/auto/corelib/concurrent/qthreadpool/.gitignore
+++ b/tests/auto/corelib/thread/qthreadpool/.gitignore
diff --git a/tests/auto/corelib/concurrent/qthreadpool/qthreadpool.pro b/tests/auto/corelib/thread/qthreadpool/qthreadpool.pro
index 4d81218f24..4d81218f24 100644
--- a/tests/auto/corelib/concurrent/qthreadpool/qthreadpool.pro
+++ b/tests/auto/corelib/thread/qthreadpool/qthreadpool.pro
diff --git a/tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
index 1dd0410f41..1dd0410f41 100644
--- a/tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp
+++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
diff --git a/tests/auto/corelib/thread/thread.pro b/tests/auto/corelib/thread/thread.pro
index a137748b75..12a284c7c7 100644
--- a/tests/auto/corelib/thread/thread.pro
+++ b/tests/auto/corelib/thread/thread.pro
@@ -9,6 +9,7 @@ SUBDIRS=\
qsemaphore \
qthread \
qthreadonce \
+ qthreadpool \
qthreadstorage \
qwaitcondition \
qwritelocker