From a530c3381b06a6e26df5f2db6b20a962d98f88ca Mon Sep 17 00:00:00 2001 From: Caroline Chao Date: Tue, 16 Oct 2012 12:15:13 +0200 Subject: Test: remove QSKIP in tst_QSharedPointer::lambdaCustomDeleter 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 --- tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp') diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp index 614c04654d..9edcb8e787 100644 --- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp @@ -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 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) { -- cgit v1.2.3