From 6b04ee10e6a17999679de86e80ce66886ceab963 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 20 Sep 2012 15:35:21 +0200 Subject: 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 Reviewed-by: Marc Mutz Reviewed-by: Caroline Chao --- .../widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/auto/widgets/graphicsview/qgraphicswidget') diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp index 177670bb84..1987a37306 100644 --- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp @@ -53,6 +53,7 @@ #include #include +#include "../../../qtest-config.h" class EventSpy : public QObject { @@ -3203,10 +3204,12 @@ void tst_QGraphicsWidget::itemChangeEvents() valueDuringEvents.insert(QEvent::ParentChange, QVariant::fromValue(parentItem())); break; } +#ifndef QTEST_NO_CURSOR case QEvent::CursorChange: { valueDuringEvents.insert(QEvent::CursorChange, int(cursor().shape())); break; } +#endif case QEvent::ToolTipChange: { valueDuringEvents.insert(QEvent::ToolTipChange, toolTip()); break; @@ -3252,9 +3255,11 @@ void tst_QGraphicsWidget::itemChangeEvents() QVERIFY(!item->isVisible()); QTRY_VERIFY(!item->valueDuringEvents.value(QEvent::Hide).toBool()); +#ifndef QTEST_NO_CURSOR // CursorChange should be triggered after the cursor has changed item->setCursor(Qt::PointingHandCursor); QTRY_COMPARE(item->valueDuringEvents.value(QEvent::CursorChange).toInt(), int(item->cursor().shape())); +#endif // ToolTipChange should be triggered after the tooltip has changed item->setToolTip("tooltipText"); -- cgit v1.2.3