diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-10-04 11:51:31 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-05 03:04:31 +0200 |
commit | 7cfad460c56319ba89c4a3a0bbcb2e54ab1cdbc6 (patch) | |
tree | 5df8fca668dace17eea7b6c5ed82db8e87180105 /tests/auto/corelib/tools/qsharedpointer | |
parent | c46f59fadf63b661d8611e5896f09fb85c17a00c (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: Ib2025339422749cf216e87ac414a3056250bf8f9
Reviewed-on: http://codereview.qt-project.org/5942
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/corelib/tools/qsharedpointer')
-rw-r--r-- | tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp index 1c9818696e..5ad0b1c208 100644 --- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp @@ -68,7 +68,9 @@ private slots: void basics(); void operators(); void swap(); +#ifndef Q_CC_SUN void forwardDeclaration1(); +#endif void forwardDeclaration2(); void memoryManagement(); void downCast(); @@ -98,8 +100,10 @@ private slots: void map(); void hash(); void validConstructs(); +#ifndef QTEST_CROSS_COMPILED void invalidConstructs_data(); void invalidConstructs(); +#endif public slots: void cleanup() { check(); } @@ -340,11 +344,10 @@ ForwardDeclared *forwardPointer(); void externalForwardDeclaration(); extern int forwardDeclaredDestructorRunCount; +// This type of forward declaration is not valid with SunCC. +#ifndef Q_CC_SUN void tst_QSharedPointer::forwardDeclaration1() { -#if defined(Q_CC_SUN) || defined(Q_CC_WINSCW) || defined(Q_CC_RVCT) - QSKIP("This type of forward declaration is not valid with this compiler", SkipAll); -#else externalForwardDeclaration(); struct Wrapper { QSharedPointer<ForwardDeclared> pointer; }; @@ -356,8 +359,8 @@ void tst_QSharedPointer::forwardDeclaration1() QVERIFY(!w.pointer.isNull()); } QCOMPARE(forwardDeclaredDestructorRunCount, 1); -#endif } +#endif #include "forwarddeclared.h" @@ -1657,6 +1660,9 @@ void tst_QSharedPointer::validConstructs() typedef bool (QTest::QExternalTest:: * TestFunction)(const QByteArray &body); Q_DECLARE_METATYPE(TestFunction) + +// This test does not work on cross compiled systems. +#ifndef QTEST_CROSS_COMPILED void tst_QSharedPointer::invalidConstructs_data() { QTest::addColumn<TestFunction>("testFunction"); @@ -1801,9 +1807,6 @@ void tst_QSharedPointer::invalidConstructs() #ifdef Q_CC_MINGW QSKIP("The maintainer of QSharedPointer: 'We don't know what the problem is so skip the tests.'", SkipAll); #endif -#ifdef QTEST_CROSS_COMPILED - QSKIP("This test does not work on cross compiled systems", SkipAll); -#endif QTest::QExternalTest test; test.setQtModules(QTest::QExternalTest::QtCore); @@ -1858,6 +1861,7 @@ void tst_QSharedPointer::invalidConstructs() QFAIL("Fail"); } } +#endif namespace QTBUG11730 { struct IB |