summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.h
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-06-07 10:43:16 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-08 18:10:18 +0200
commit14cd2678396ed1450a72aeffa99c1504743ea415 (patch)
treef70b11d23505aa16320a45e53cb706a965241dfb /src/testlib/qtestcase.h
parent9e75354aabb752097e7e0d227f8b55f36237f6d5 (diff)
Use variadic macros where available to make QSKIP source compatible.
Otherwise this is a large source incompatbility during porting, so it makes sense to provide the option of using C++11 for that. Change-Id: I9792b3ae2c1fa3743bc9a2e74380134ea2f24add Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/testlib/qtestcase.h')
-rw-r--r--src/testlib/qtestcase.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index 661aaa08e8..5e88cc38e6 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -117,12 +117,22 @@ do { \
#define QTRY_COMPARE(__expr, __expected) QTRY_COMPARE_WITH_TIMEOUT(__expr, __expected, 5000)
-#define QSKIP(statement) \
+#define QSKIP_INTERNAL(statement) \
do {\
QTest::qSkip(statement, __FILE__, __LINE__);\
return;\
} while (0)
+#ifdef Q_COMPILER_VARIADIC_MACROS
+
+#define QSKIP(statement, ...) QSKIP_INTERNAL(statement)
+
+#else
+
+#define QSKIP(statement) QSKIP_INTERNAL(statement)
+
+#endif
+
#define QEXPECT_FAIL(dataIndex, comment, mode)\
do {\
if (!QTest::qExpectFail(dataIndex, comment, QTest::mode, __FILE__, __LINE__))\