summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@nokia.com>2011-11-10 10:28:56 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-11 10:58:10 +0100
commit12ebdd9f9e1b27e322259afc058621b39c17c485 (patch)
tree2c262013c98a58cda25e57b3f7bb6e688f078dd9 /tests/auto/corelib/tools
parent51ae37d8c457fb885157659201909b478bf5b99a (diff)
QByteArray autotest: Check for defines inside of slot
Instead of creating slots depending on certain defines, these defines should be checked inside the slots. Moc may not be aware of all defines (e.g. compiler specific ones) and thus (not) create slots according to the condition given. Change-Id: I50495444b8f468ec131e6a0937e18803a8077758 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r--tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
index 186c592fb7..f3f453ae22 100644
--- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
@@ -63,10 +63,8 @@ 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();
@@ -192,9 +190,9 @@ void tst_QByteArray::qCompress()
// 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()
{
+#if !(defined(Q_OS_HPUX) && !defined(__ia64) && defined(Q_CC_GNU)) && !defined(Q_OS_SOLARIS) && !defined(Q_OS_QNX) && !defined(Q_OS_WIN)
QTest::addColumn<QByteArray>("in");
QTest::addColumn<QByteArray>("out");
@@ -210,10 +208,14 @@ void tst_QByteArray::qUncompress_data()
QTest::newRow("0xcfffffff") << QByteArray("\xcf\xff\xff\xff", 4) << QByteArray();
QTest::newRow("0xffffff00") << QByteArray("\xff\xff\xff\x00", 4) << QByteArray();
QTest::newRow("0xffffffff") << QByteArray("\xff\xff\xff\xff", 4) << QByteArray();
+#else
+ QSKIP("Test does not make sense on this platform");
+#endif
}
void tst_QByteArray::qUncompress()
{
+#if !(defined(Q_OS_HPUX) && !defined(__ia64) && defined(Q_CC_GNU)) && !defined(Q_OS_SOLARIS) && !defined(Q_OS_QNX) && !defined(Q_OS_WIN)
QFETCH(QByteArray, in);
QFETCH(QByteArray, out);
@@ -223,8 +225,10 @@ void tst_QByteArray::qUncompress()
res = ::qUncompress(in + "blah");
QCOMPARE(res, out);
-}
+#else
+ QSKIP("Test does not make sense on this platform");
#endif
+}
void tst_QByteArray::qCompressionZeroTermination()
{