summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/concurrent
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-11-15 11:36:18 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-18 01:51:57 +0100
commita8fd0c3654f8352773638633778cd8003680cbc7 (patch)
tree4815cca9daf879b96a92a3de95621b56ac5ba868 /tests/auto/corelib/concurrent
parentd90d57bb8b995c7a66e7f9b7b2515447fbe11de0 (diff)
Don't depend on moc to disable test functions.
The moc tool is not aware of all defines (particularly those that are compiler builtins) and does not correctly evaluate others that depend on compiler builtins, such as Q_OS_FOO. This commit reverts parts of the following commits, but is not a complete fix as there were many instances of this problem in the tests prior to those commits: 924d810dbdcd5b5b0fa860922b2487ea9062d002 8aaff6751038b88d17e23be6fcee945771297c5b 338d3f11973412047c2c9cd41cbd0c961d738ef3 a55034062ba2bf73a9f1ed3d9cf31745b38149e3 253497b7446c7d723aa3bdd7152e25d6852f2604 7cfad460c56319ba89c4a3a0bbcb2e54ab1cdbc6 9d2ff58f3642828e494e7e9b2df7dbb8e2cd408f 0cf6baa2d61ebaad2a2a0530c37f27e719b68f4b Change-Id: I947d797fe3ec76139ba1b55561cea569895662c5 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/corelib/concurrent')
-rw-r--r--tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp b/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp
index 7b1a0ca056..23f099bffa 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp
+++ b/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp
@@ -60,12 +60,8 @@ private slots:
#ifndef QT_NO_EXCEPTIONS
void exceptions();
#endif
-#ifdef Q_COMPILER_DECLTYPE
void functor();
-#endif
-#ifdef Q_COMPILER_LAMBDA
void lambda();
-#endif
};
void light()
@@ -414,9 +410,11 @@ struct Functor {
};
// This tests functor without result_type; decltype need to be supported by the compiler.
-#ifdef Q_COMPILER_DECLTYPE
void tst_QtConcurrentRun::functor()
{
+#ifndef Q_COMPILER_DECLTYPE
+ QSKIP("Compiler does not support decltype");
+#else
Functor f;
{
QFuture<int> fut = QtConcurrent::run(f);
@@ -437,12 +435,14 @@ void tst_QtConcurrentRun::functor()
QtConcurrent::run(f, 1,2,3,4).waitForFinished();
QtConcurrent::run(f, 1,2,3,4,5).waitForFinished();
}
-}
#endif
+}
-#ifdef Q_COMPILER_LAMBDA
void tst_QtConcurrentRun::lambda()
{
+#ifndef Q_COMPILER_LAMBDA
+ QSKIP("Compiler does not support lambda");
+#else
QCOMPARE(QtConcurrent::run([](){ return 45; }).result(), 45);
QCOMPARE(QtConcurrent::run([](int a){ return a+15; }, 12).result(), 12+15);
QCOMPARE(QtConcurrent::run([](int a, double b){ return a + b; }, 12, 15).result(), double(12+15));
@@ -456,8 +456,8 @@ void tst_QtConcurrentRun::lambda()
QCOMPARE(r, QStringList({"Hello", "World", "Foo"}));
}
#endif
-}
#endif
+}
QTEST_MAIN(tst_QtConcurrentRun)
#include "tst_qtconcurrentrun.moc"