summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-10-04 13:23:23 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-05 06:15:00 +0200
commit253497b7446c7d723aa3bdd7152e25d6852f2604 (patch)
treee91eb9fdb94aae121fa587ab5f54f3917a6c1d55 /tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
parent3f88da82b1bdf79fe4c89640838b0b69c8a89d8b (diff)
Avoid using QSKIP in lieu of compile-time checks
QSKIP is intended to be used to skip test functions that are found at run-time to be inapplicable or unsafe. If a test function can be determined to be inapplicable at compile-time, the entire test function should be omitted instead of replacing the body of the test function with a QSKIP, which only serves to slow down test runs and to inflate test run-rates with empty, inapplicable tests. Task-number: QTQAINFRA-278 Change-Id: I582732e3dd657df834f9a98fd52d7ee368f2f29b Reviewed-on: http://codereview.qt-project.org/5946 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp')
-rw-r--r--tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 1afc70079d..c223ca503a 100644
--- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -121,8 +121,10 @@ private slots:
void focusNextPrevChild();
void focusOutEvent_data();
void focusOutEvent();
+#if !defined(Q_OS_WINCE) || (defined(GWES_ICONCURS) && !defined(QT_NO_CURSOR))
void hoverEnterLeaveEvent_data();
void hoverEnterLeaveEvent();
+#endif
void hoverMoveEvent_data();
void hoverMoveEvent();
void keyPressEvent_data();
@@ -160,7 +162,9 @@ private slots:
void setFocus_complexTwoWidgets();
void popup_basic();
void popup_subwidget();
+#if !defined(QT_NO_CURSOR) && (!defined(Q_OS_WINCE) || defined(GWES_ICONCURS))
void changingCursor_basic();
+#endif
void tooltip_basic();
void childPos_data();
void childPos();
@@ -943,6 +947,8 @@ protected:
}
};
+// protected void hoverEnterEvent(QGraphicsSceneHoverEvent* event)
+#if !defined(Q_OS_WINCE) || (defined(GWES_ICONCURS) && !defined(QT_NO_CURSOR))
void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent_data()
{
QTest::addColumn<bool>("hasWidget");
@@ -953,16 +959,11 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent_data()
QTest::newRow("no widget, hover") << false << true;
}
-// protected void hoverEnterEvent(QGraphicsSceneHoverEvent* event)
void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent()
{
QFETCH(bool, hasWidget);
QFETCH(bool, hoverEnabled);
-#if defined(Q_OS_WINCE) && (!defined(GWES_ICONCURS) || defined(QT_NO_CURSOR))
- QSKIP("hover events not supported on this platform", SkipAll);
-#endif
-
// proxy should translate this into events that the widget would expect
QGraphicsScene scene;
@@ -1009,6 +1010,7 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent()
if (!hasWidget)
delete widget;
}
+#endif
void tst_QGraphicsProxyWidget::hoverMoveEvent_data()
{
@@ -2549,12 +2551,9 @@ void tst_QGraphicsProxyWidget::popup_subwidget()
QCOMPARE(popup->size(), child->size().toSize());
}
+#if !defined(QT_NO_CURSOR) && (!defined(Q_OS_WINCE) || defined(GWES_ICONCURS))
void tst_QGraphicsProxyWidget::changingCursor_basic()
{
-#if defined(Q_OS_WINCE) && (!defined(GWES_ICONCURS) || defined(QT_NO_CURSOR))
- QSKIP("hover events not supported on this platform", SkipAll);
-#endif
-#ifndef QT_NO_CURSOR
// Confirm that mouse events are working properly by checking that
// when moving the mouse over a line edit it will change the cursor into the I
QGraphicsScene scene;
@@ -2580,8 +2579,8 @@ void tst_QGraphicsProxyWidget::changingCursor_basic()
QTest::mouseMove(view.viewport(), QPoint(1, 1));
sendMouseMove(view.viewport(), QPoint(1, 1));
QTRY_COMPARE(view.viewport()->cursor().shape(), Qt::ArrowCursor);
-#endif
}
+#endif
void tst_QGraphicsProxyWidget::tooltip_basic()
{