Test: remove QSKIP in tst_QSharedPointer::lambdaCustomDeleter
authorCaroline Chao <caroline.chao@digia.com>
Tue, 16 Oct 2012 10:15:13 +0000 (12:15 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 16 Oct 2012 18:43:37 +0000 (20:43 +0200)
Instead omit the whole test when Q_COMPILER_LAMBDA is not defined since
the test is not relevant in that case.

Change-Id: I541da96a881fa0c9be38ae5c0f86df047dd8fc6b
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp

index 614c046..9edcb8e 100644 (file)
@@ -91,7 +91,9 @@ private slots:
 #endif
     void constCorrectness();
     void customDeleter();
+#ifdef Q_COMPILER_LAMBDA
     void lambdaCustomDeleter();
+#endif
     void creating();
     void creatingQObject();
     void mixTrackingPointerCode();
@@ -1325,11 +1327,10 @@ void tst_QSharedPointer::customDeleter()
     safetyCheck();
 }
 
+#ifdef Q_COMPILER_LAMBDA
+// The compiler needs to be in C++11 mode and to support lambdas
 void tst_QSharedPointer::lambdaCustomDeleter()
 {
-#ifndef Q_COMPILER_LAMBDA
-    QSKIP("This compiler is not in C++11 mode or does not support lambdas");
-#else
     {
         // stateless, one-argument
         QSharedPointer<Data> ptr(new Data, [](Data *d) { delete d; });
@@ -1353,8 +1354,8 @@ void tst_QSharedPointer::lambdaCustomDeleter()
         QCOMPARE(i, 42);
     }
     safetyCheck();
-#endif
 }
+#endif
 
 void customQObjectDeleterFn(QObject *obj)
 {