From 677313fc0b013644ad558e3410266ecbbcbc6d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 19 Mar 2013 13:19:19 +0100 Subject: Attempt to prevent tst_QWidget::scroll() from failing in CI. Skip the test on X11 where it's consistently failing in CI but not when trying to reproduce locally. Also attempt to make test slightly more robust on other platforms (it's already #ifndef'd for Q_OS_MAC). Task-number: QTBUG-30271 Change-Id: I6743eb99549abbd945e380a3a54ce8620000298a Reviewed-by: Gunnar Sletta --- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests/auto/widgets') diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index c1927c9d1f..ba60dd0c01 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -4239,9 +4239,13 @@ void tst_QWidget::isOpaque() */ void tst_QWidget::scroll() { + if (m_platform == QStringLiteral("xcb")) + QSKIP("X11: Skip unstable test"); + UpdateWidget updateWidget; updateWidget.resize(500, 500); updateWidget.reset(); + updateWidget.move(QGuiApplication::primaryScreen()->geometry().center() - QPoint(250, 250)); updateWidget.show(); qApp->setActiveWindow(&updateWidget); QVERIFY(QTest::qWaitForWindowActive(&updateWidget)); @@ -4253,7 +4257,7 @@ void tst_QWidget::scroll() qApp->processEvents(); QRegion dirty(QRect(0, 0, 500, 10)); dirty += QRegion(QRect(0, 10, 10, 490)); - QCOMPARE(updateWidget.paintedRegion, dirty); + QTRY_COMPARE(updateWidget.paintedRegion, dirty); } { @@ -4263,7 +4267,7 @@ void tst_QWidget::scroll() qApp->processEvents(); QRegion dirty(QRect(0, 0, 500, 10)); dirty += QRegion(QRect(0, 10, 10, 10)); - QCOMPARE(updateWidget.paintedRegion, dirty); + QTRY_COMPARE(updateWidget.paintedRegion, dirty); } { @@ -4276,7 +4280,7 @@ void tst_QWidget::scroll() dirty += QRegion(QRect(0, 60, 110, 40)); dirty += QRegion(QRect(50, 100, 60, 10)); dirty += QRegion(QRect(50, 110, 10, 40)); - QCOMPARE(updateWidget.paintedRegion, dirty); + QTRY_COMPARE(updateWidget.paintedRegion, dirty); } { @@ -4287,7 +4291,7 @@ void tst_QWidget::scroll() QRegion dirty(QRect(0, 0, 100, 100)); dirty += QRegion(QRect(100, 100, 100, 10)); dirty += QRegion(QRect(100, 110, 10, 90)); - QCOMPARE(updateWidget.paintedRegion, dirty); + QTRY_COMPARE(updateWidget.paintedRegion, dirty); } } #endif -- cgit v1.2.3 From 5fd509c4d7b4bd9be9cc6f3a5f419ee496fe9142 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 18 Mar 2013 16:33:06 +0100 Subject: Tests: stabilize tst_QDockWidget on small screens The test has been recently failing in CI. The problem was easy to reproduce in a virtual machine by resizing the window of the virtual machine small enough. This change makes sure that the requested size hint is significantly smaller than the desktop size, to avoid the window manager stepping in and limiting the window size. Change-Id: Id8ce63b2b88cbed964e0330633c5d2e1dc33598c Reviewed-by: Caroline Chao (cherry picked from commit 36e6632fa363152e1a0d42e53a0e5ada09092324) Reviewed-by: J-P Nurmi --- tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/widgets') diff --git a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp index 92b16ac155..6ab7cb4491 100644 --- a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp +++ b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp @@ -735,7 +735,7 @@ void tst_QDockWidget::task169808_setFloating() QSize sizeHint() const { const QRect& deskRect = qApp->desktop()->availableGeometry(); - return QSize(qMin(300, deskRect.width()), 300); + return QSize(qMin(300, deskRect.width() / 2), qMin(300, deskRect.height() / 2)); } QSize minimumSizeHint() const -- cgit v1.2.3