diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2009-06-16 10:35:49 +1000 |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2009-06-16 11:14:21 +1000 |
commit | efb335ea2623c6261810c1594aeda5b655d1f89e (patch) | |
tree | 7fffa83c0d6a7f6bfc7767d3350ed63a6d7378af /tests/auto/bic/tst_bic.cpp | |
parent | 3fd25c90fab85fc6aa9949311b13992c63ba7345 (diff) |
Add Qt 4.4.0 linux-gcc-ia32 testdata to bic test and make the bic test
code more maintainable.
Stop hardcoding the list of versions to test.
Note that this test currenty FAILS because QGraphicsProxyWidget
vtable size has changed from 4.4 -> 4.5.
Diffstat (limited to 'tests/auto/bic/tst_bic.cpp')
-rw-r--r-- | tests/auto/bic/tst_bic.cpp | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/tests/auto/bic/tst_bic.cpp b/tests/auto/bic/tst_bic.cpp index 181c27587e..b07f195615 100644 --- a/tests/auto/bic/tst_bic.cpp +++ b/tests/auto/bic/tst_bic.cpp @@ -97,6 +97,8 @@ tst_Bic::tst_Bic() bic.addBlacklistedClass(QLatin1String("QTypeInfo<*>")); bic.addBlacklistedClass(QLatin1String("QMetaTypeId<*>")); bic.addBlacklistedClass(QLatin1String("QVector<QGradientStop>*")); + bic.addBlacklistedClass(QLatin1String("QMap<*>::iterator")); + bic.addBlacklistedClass(QLatin1String("QMap<*>::Node")); /* this guy is never instantiated, just for compile-time checking */ bic.addBlacklistedClass(QLatin1String("QMap<*>::PayloadNode")); @@ -158,55 +160,52 @@ void tst_Bic::sizesAndVTables_data() QSKIP("Test not implemented for this compiler/platform", SkipAll); #else - QString archFileName400; - QString archFileName410; - QString archFileName420; - QString archFileName430; + int major = QT_VERSION >> 16; + if (major != 4) { + QFAIL("This test is for Qt 4"); + } + int minor = (QT_VERSION & 0x00FF00) >> 8; + int patch = (QT_VERSION & 0x0000FF); + + // Test every Qt 4 version up to this minor version. + typedef QPair<QString,bool> VersionPair; + QList<VersionPair> versions; + for (int i = 0; i <= minor; ++i) { + bool isPatchRelease = (i == minor && patch); + versions << qMakePair(QString("%1.%2").arg(major).arg(i), isPatchRelease); + } + QString arch; #if defined Q_OS_LINUX && defined Q_WS_X11 # if defined(__powerpc__) && !defined(__powerpc64__) - archFileName400 = "data/%1.4.0.0.linux-gcc-ppc32.txt"; - archFileName410 = "data/%1.4.1.0.linux-gcc-ppc32.txt"; - archFileName420 = "data/%1.4.2.0.linux-gcc-ppc32.txt"; + arch = "linux-gcc-ppc32"; # elif defined(__amd64__) - archFileName400 = "data/%1.4.0.0.linux-gcc-amd64.txt"; + arch = "linux-gcc-amd64"; # elif defined(__i386__) - archFileName400 = "data/%1.4.0.0.linux-gcc-ia32.txt"; - archFileName410 = "data/%1.4.1.0.linux-gcc-ia32.txt"; - archFileName420 = "data/%1.4.2.0.linux-gcc-ia32.txt"; - archFileName430 = "data/%1.4.3.0.linux-gcc-ia32.txt"; + arch = "linux-gcc-ia32"; # endif #elif defined Q_OS_AIX - if (sizeof(void*) == 4) - archFileName400 = "data/%1.4.0.0.aix-gcc-power32.txt"; + if (sizeof(void*) == 4) { + arch = "aix-gcc-power32"; + } #elif defined Q_OS_MAC && defined(__powerpc__) - archFileName400 = "data/%1.4.0.0.macx-gcc-ppc32.txt"; - archFileName410 = "data/%1.4.1.0.macx-gcc-ppc32.txt"; - archFileName420 = "data/%1.4.2.0.macx-gcc-ppc32.txt"; + arch = "macx-gcc-ppc32"; #elif defined Q_OS_MAC && defined(__i386__) - archFileName410 = "data/%1.4.1.0.macx-gcc-ia32.txt"; - archFileName420 = "data/%1.4.2.0.macx-gcc-ia32.txt"; + arch = "macx-gcc-ia32"; #elif defined Q_OS_WIN && defined Q_CC_GNU - archFileName410 = "data/%1.4.1.0.win32-gcc-ia32.txt"; - archFileName420 = "data/%1.4.2.0.win32-gcc-ia32.txt"; + arch = "win32-gcc-ia32"; #endif - if (archFileName400.isEmpty() && archFileName410.isEmpty() - && archFileName420.isEmpty()) - QSKIP("No reference files found for this platform", SkipAll); - - bool isPatchRelease400 = false; - bool isPatchRelease410 = false; - bool isPatchRelease420 = false; - bool isPatchRelease430 = false; + if (arch.isEmpty()) + QSKIP("No reference files found for this arch", SkipAll); QTest::addColumn<QString>("oldLib"); QTest::addColumn<bool>("isPatchRelease"); - QTest::newRow("4.0") << archFileName400 << isPatchRelease400; - QTest::newRow("4.1") << archFileName410 << isPatchRelease410; - QTest::newRow("4.2") << archFileName420 << isPatchRelease420; - QTest::newRow("4.3") << archFileName430 << isPatchRelease430; + foreach (VersionPair const& version, versions) { + QString archFileName = QString("data/%3.%1.0.%2.txt").arg(version.first).arg(arch); + QTest::newRow(qPrintable(version.first)) << archFileName << version.second; + } #endif } |