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/qbytearray | |
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/qbytearray')
-rw-r--r-- | tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp index 41922a0a42..05bc7399a0 100644 --- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp @@ -71,8 +71,10 @@ private slots: void qCompress_data(); #ifndef QT_NO_COMPRESS void qCompress(); +#if !(defined Q_OS_HPUX && !defined __ia64 && defined Q_CC_GNU) && !defined Q_OS_SOLARIS && !defined Q_OS_QNX && !defined Q_OS_WIN void qUncompress_data(); void qUncompress(); +#endif void qCompressionZeroTermination(); #endif void constByteArray(); @@ -142,7 +144,9 @@ private slots: void reserve(); +#if defined(Q_COMPILER_LAMBDA) || defined(Q_CC_GNU) void literals(); +#endif }; tst_QByteArray::tst_QByteArray() @@ -214,9 +218,9 @@ void tst_QByteArray::qCompress() QTEST( ::qUncompress( compressed ), "ba" ); } -/* - Just making sure it doesn't crash on invalid data. -*/ +// Corrupt data causes this test to lock up on HP-UX / PA-RISC with gcc, +// SOLARIS, QNX and Windows. +#if !(defined Q_OS_HPUX && !defined __ia64 && defined Q_CC_GNU) && !defined Q_OS_SOLARIS && !defined Q_OS_QNX && !defined Q_OS_WIN void tst_QByteArray::qUncompress_data() { QTest::addColumn<QByteArray>("in"); @@ -241,16 +245,6 @@ void tst_QByteArray::qUncompress() QFETCH(QByteArray, in); QFETCH(QByteArray, out); -#if defined Q_OS_HPUX && !defined __ia64 && defined Q_CC_GNU - QSKIP("Corrupt data causes this tests to lock up on HP-UX / PA-RISC with gcc", SkipAll); -#elif defined Q_OS_SOLARIS - QSKIP("Corrupt data causes this tests to lock up on Solaris", SkipAll); -#elif defined Q_OS_QNX - QSKIP("Corrupt data causes this test to lock up on QNX", SkipAll); -#elif defined Q_OS_WIN - QSKIP("Corrupt data causes this test to lock up on Windows", SkipAll); -#endif - QByteArray res; res = ::qUncompress(in); QCOMPARE(res, out); @@ -258,6 +252,7 @@ void tst_QByteArray::qUncompress() res = ::qUncompress(in + "blah"); QCOMPARE(res, out); } +#endif void tst_QByteArray::qCompressionZeroTermination() { @@ -1540,9 +1535,10 @@ void tst_QByteArray::reserve() nil2.reserve(0); } +// Only tested on c++0x compliant compiler or gcc. +#if defined(Q_COMPILER_LAMBDA) || defined(Q_CC_GNU) void tst_QByteArray::literals() { -#if defined(Q_COMPILER_LAMBDA) || defined(Q_CC_GNU) QByteArray str(QByteArrayLiteral("abcd")); QVERIFY(str.length() == 4); @@ -1559,11 +1555,8 @@ void tst_QByteArray::literals() QVERIFY(str2.constData() == s); QVERIFY(str2.data() != s); - -#else - QSKIP("Only tested on c++0x compliant compiler or gcc", SkipAll); -#endif } +#endif const char globalChar = '1'; |