diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2012-09-20 15:35:21 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-13 05:51:19 +0200 |
commit | 6b04ee10e6a17999679de86e80ce66886ceab963 (patch) | |
tree | a939a0c9466e90d19ffeffc76bbd592ae2d3489a /tests/auto/widgets/kernel | |
parent | dc0d5bf387a0b440c74b9e822c46b09e20e00720 (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/widgets/kernel')
-rw-r--r-- | tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp | 5 | ||||
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 20 |
2 files changed, 18 insertions, 7 deletions
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 9ea8589e76..abb979c76c 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -71,6 +71,7 @@ #include <qpa/qwindowsysteminterface.h> +#include "../../../qtest-config.h" QT_BEGIN_NAMESPACE static QWindowSystemInterface::TouchPoint touchPoint(const QTouchEvent::TouchPoint& pt) @@ -2231,7 +2232,9 @@ Q_GLOBAL_STATIC(QPixmap, tst_qapp_pixmap); Q_GLOBAL_STATIC(QFont, tst_qapp_font); Q_GLOBAL_STATIC(QRegion, tst_qapp_region); Q_GLOBAL_STATIC(QFontDatabase, tst_qapp_fontDatabase); +#ifndef QTEST_NO_CURSOR Q_GLOBAL_STATIC(QCursor, tst_qapp_cursor); +#endif void tst_QApplication::globalStaticObjectDestruction() { @@ -2250,7 +2253,9 @@ void tst_QApplication::globalStaticObjectDestruction() QVERIFY(tst_qapp_font()); QVERIFY(tst_qapp_region()); QVERIFY(tst_qapp_fontDatabase()); +#ifndef QTEST_NO_CURSOR QVERIFY(tst_qapp_cursor()); +#endif } //QTEST_APPLESS_MAIN(tst_QApplication) diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 855f7fcc49..167bf28fc3 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -76,6 +76,8 @@ #include <QtWidgets/QGraphicsView> #include <QtWidgets/QGraphicsProxyWidget> +#include "../../../qtest-config.h" + #if defined(Q_OS_MAC) #include "tst_qwidget_mac_helpers.h" // Abstract the ObjC stuff out so not everyone must run an ObjC++ compile. #endif @@ -273,7 +275,9 @@ private slots: void deleteStyle(); void multipleToplevelFocusCheck(); void setFocus(); +#ifndef QTEST_NO_CURSOR void setCursor(); +#endif void setToolTip(); void testWindowIconChangeEventPropagation(); @@ -344,7 +348,7 @@ private slots: void setClearAndResizeMask(); void maskedUpdate(); -#if !defined(Q_OS_WINCE_WM) +#ifndef QTEST_NO_CURSOR void syntheticEnterLeave(); void taskQTBUG_4055_sendSyntheticEnterLeave(); #endif @@ -5222,9 +5226,9 @@ private: int m_count; }; +#ifndef QTEST_NO_CURSOR void tst_QWidget::setCursor() { -#ifndef QT_NO_CURSOR { QWidget window; window.resize(200, 200); @@ -5339,8 +5343,8 @@ void tst_QWidget::setCursor() widget.unsetCursor(); QCOMPARE(spy.count(), 2); } -#endif } +#endif void tst_QWidget::setToolTip() { @@ -8491,8 +8495,7 @@ void tst_QWidget::maskedUpdate() QTRY_COMPARE(grandChild.paintedRegion, QRegion(grandChild.rect())); // Full update. } -// Windows Mobile has no proper cursor support, so skip this test on that platform. -#if !defined(Q_OS_WINCE_WM) +#ifndef QTEST_NO_CURSOR void tst_QWidget::syntheticEnterLeave() { class MyWidget : public QWidget @@ -8595,8 +8598,7 @@ void tst_QWidget::syntheticEnterLeave() } #endif -// Windows Mobile has no proper cursor support, so skip this test on that platform. -#if !defined(Q_OS_WINCE_WM) +#ifndef QTEST_NO_CURSOR void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave() { if (m_platform == QStringLiteral("windows") || m_platform == QStringLiteral("xcb")) @@ -8812,7 +8814,9 @@ QWidgetBackingStore* backingStore(QWidget &widget) #ifndef Q_OS_WINCE_WM void tst_QWidget::rectOutsideCoordinatesLimit_task144779() { +#ifndef QTEST_NO_CURSOR QApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs +#endif QWidget main(0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame QPalette palette; palette.setColor(QPalette::Window, Qt::red); @@ -8845,7 +8849,9 @@ void tst_QWidget::rectOutsideCoordinatesLimit_task144779() QTRY_COMPARE(mainPixmap.toImage().convertToFormat(QImage::Format_RGB32), correct.toImage().convertToFormat(QImage::Format_RGB32)); +#ifndef QTEST_NO_CURSOR QApplication::restoreOverrideCursor(); +#endif } #endif |