summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2012-09-20 15:35:21 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-13 05:51:19 +0200
commit6b04ee10e6a17999679de86e80ce66886ceab963 (patch)
treea939a0c9466e90d19ffeffc76bbd592ae2d3489a /tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
parentdc0d5bf387a0b440c74b9e822c46b09e20e00720 (diff)
Auto tests: revise cursor dependant tests
Cursor dependant auto tests are currently skipped in various ways. Some are checking PlatformQuirks::haveMouseCursor() that tries to detect if the desktop environment is MeeGo, using obsolete Q_WS_X11. Some are skipped if QT_NO_CURSOR or Q_OS_WINCE is defined and some are actually missing the approriate guards. => unify by defining QTEST_NO_CURSOR in qtest-config.h when appropriate ie. for platforms that have no regular mouse cursor support or when QT_NO_CURSOR is defined. Task-number: QTBUG-22551 Change-Id: I9a1e0e3156617945ae46226c79268955454c8a9a Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Diffstat (limited to 'tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp')
-rw-r--r--tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
index 19ce2f2c7a..e0f479524f 100644
--- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
@@ -48,6 +48,8 @@
#include <QtGui/QPainter>
#include <QtGui/QPen>
+#include "../../../qtest-config.h"
+
Q_DECLARE_METATYPE(QBitArray)
Q_DECLARE_METATYPE(qint64)
@@ -78,8 +80,10 @@ private slots:
void stream_QByteArray_data();
void stream_QByteArray();
+#ifndef QTEST_NO_CURSOR
void stream_QCursor_data();
void stream_QCursor();
+#endif
void stream_QDate_data();
void stream_QDate();
@@ -193,7 +197,9 @@ private:
void writeQBrush(QDataStream *s);
void writeQColor(QDataStream *s);
void writeQByteArray(QDataStream *s);
+#ifndef QTEST_NO_CURSOR
void writeQCursor(QDataStream *s);
+#endif
void writeQWaitCursor(QDataStream *s);
void writeQDate(QDataStream *s);
void writeQTime(QDataStream *s);
@@ -220,7 +226,9 @@ private:
void readQBrush(QDataStream *s);
void readQColor(QDataStream *s);
void readQByteArray(QDataStream *s);
+#ifndef QTEST_NO_CURSOR
void readQCursor(QDataStream *s);
+#endif
void readQDate(QDataStream *s);
void readQTime(QDataStream *s);
void readQDateTime(QDataStream *s);
@@ -999,7 +1007,7 @@ void tst_QDataStream::readQByteArray(QDataStream *s)
}
// ************************************
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
static QCursor qCursorData(int index)
{
switch (index) {
@@ -1018,31 +1026,31 @@ static QCursor qCursorData(int index)
}
#endif
+#ifndef QTEST_NO_CURSOR
void tst_QDataStream::stream_QCursor_data()
{
-#ifndef QT_NO_CURSOR
stream_data(9);
-#endif
}
+#endif
+#ifndef QTEST_NO_CURSOR
void tst_QDataStream::stream_QCursor()
{
-#ifndef QT_NO_CURSOR
STREAM_IMPL(QCursor);
-#endif
}
+#endif
+#ifndef QTEST_NO_CURSOR
void tst_QDataStream::writeQCursor(QDataStream *s)
{
-#ifndef QT_NO_CURSOR
QCursor d5(qCursorData(dataIndex(QTest::currentDataTag())));
*s << d5;
-#endif
}
+#endif
+#ifndef QTEST_NO_CURSOR
void tst_QDataStream::readQCursor(QDataStream *s)
{
-#ifndef QT_NO_CURSOR
QCursor test(qCursorData(dataIndex(QTest::currentDataTag())));
QCursor d5;
*s >> d5;
@@ -1061,8 +1069,8 @@ void tst_QDataStream::readQCursor(QDataStream *s)
QPixmap expected = *(test.mask());
QCOMPARE(actual, expected);
}
-#endif
}
+#endif
// ************************************