diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-11-15 11:36:18 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-18 01:51:57 +0100 |
commit | a8fd0c3654f8352773638633778cd8003680cbc7 (patch) | |
tree | 4815cca9daf879b96a92a3de95621b56ac5ba868 /tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp | |
parent | d90d57bb8b995c7a66e7f9b7b2515447fbe11de0 (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/tools/qsharedpointer/tst_qsharedpointer.cpp')
-rw-r--r-- | tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp index 7328858858..94f6fc1c12 100644 --- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp @@ -68,9 +68,7 @@ private slots: void basics(); void operators(); void swap(); -#ifndef Q_CC_SUN void forwardDeclaration1(); -#endif void forwardDeclaration2(); void memoryManagement(); void downCast(); @@ -100,10 +98,8 @@ private slots: void map(); void hash(); void validConstructs(); -#ifndef QTEST_CROSS_COMPILED void invalidConstructs_data(); void invalidConstructs(); -#endif public slots: void cleanup() { check(); } @@ -344,10 +340,11 @@ 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"); +#else externalForwardDeclaration(); struct Wrapper { QSharedPointer<ForwardDeclared> pointer; }; @@ -359,8 +356,8 @@ void tst_QSharedPointer::forwardDeclaration1() QVERIFY(!w.pointer.isNull()); } QCOMPARE(forwardDeclaredDestructorRunCount, 1); -} #endif +} #include "forwarddeclared.h" @@ -1639,9 +1636,6 @@ 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"); @@ -1786,6 +1780,9 @@ 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.'"); #endif +#ifdef QTEST_CROSS_COMPILED + QSKIP("This test does not work on cross compiled systems"); +#endif QTest::QExternalTest test; test.setQtModules(QTest::QExternalTest::QtCore); @@ -1840,7 +1837,6 @@ void tst_QSharedPointer::invalidConstructs() QFAIL("Fail"); } } -#endif namespace QTBUG11730 { struct IB |