From 12ebdd9f9e1b27e322259afc058621b39c17c485 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 10 Nov 2011 10:28:56 +0100 Subject: 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 --- tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests/auto/corelib/tools') 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("in"); QTest::addColumn("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() { -- cgit v1.2.3