summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-10-06 18:56:31 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-07 04:30:30 +0200
commit924d810dbdcd5b5b0fa860922b2487ea9062d002 (patch)
treeb14117ac5b9a2d8d02a502adbd00b94ba5eef424 /tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
parent13251dcaea443d2f228fc797e54318191048e588 (diff)
Avoid using QSKIP in lieu of compile-time checks
QSKIP is intended to be used to skip test functions that are found at run-time to be inapplicable or unsafe. If a test function can be determined to be inapplicable at compile-time, the entire test function should be omitted instead of replacing the body of the test function with a QSKIP, which only serves to slow down test runs and to inflate test run-rates with empty, inapplicable tests. Task-number: QTQAINFRA-278 Change-Id: I95feba3edbfa092c0ef4d85bb8c6877bd6be698e Reviewed-on: http://codereview.qt-project.org/6128 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp')
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
index 095103dd8a..96901f334e 100644
--- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
@@ -55,8 +55,9 @@ class tst_QTextCodec : public QObject
Q_OBJECT
private slots:
-
+#ifndef QT_NO_CONCURRENT
void threadSafety();
+#endif
void toUnicode_data();
void toUnicode();
@@ -1976,24 +1977,21 @@ static int loadAndConvertMIB(int mib)
}
+#ifndef QT_NO_CONCURRENT
void tst_QTextCodec::threadSafety()
{
QList<QByteArray> codecList = QTextCodec::availableCodecs();
QList<int> mibList = QTextCodec::availableMibs();
-#ifndef QT_NO_CONCURRENT
QThreadPool::globalInstance()->setMaxThreadCount(12);
QFuture<QByteArray> res = QtConcurrent::mapped(codecList, loadAndConvert);
-
QFuture<int> res2 = QtConcurrent::mapped(mibList, loadAndConvertMIB);
QCOMPARE(res.results(), codecList);
QCOMPARE(res2.results(), mibList);
-#else
- QSKIP("This function is not yet supported with QT_NO_CONCURRENT defined.", SkipAll);
-#endif
}
+#endif
void tst_QTextCodec::invalidNames()
{