From f528fff97394554ccac9c2d9ced790cc0e6e4350 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 9 May 2014 13:22:42 +0200 Subject: tst_QWidget::windowMoveResize(): Fix QEXPECT_FAIL / QTRY_COMPARE . QEXPECT_FAIL followed by QTRY_COMPARE considerably slows down tests due to the check timing out. Task-number: QTBUG-38890 Change-Id: I7f90f2627fc6ce149d159a6d13355ca1a8181d54 Reviewed-by: Frederik Gladhorn --- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 36 ++++++++++------------- 1 file changed, 16 insertions(+), 20 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 dd3d041f56..2a70431223 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -4631,32 +4631,28 @@ void tst_QWidget::windowMoveResize() QTest::qWait(10); QTRY_COMPARE(widget.pos(), rect.topLeft()); - if (m_platform == QStringLiteral("windows")) { - QEXPECT_FAIL("130,100 0x200, flags 0", "QTBUG-26424", Continue); - QEXPECT_FAIL("130,50 0x0, flags 0", "QTBUG-26424", Continue); - } - QTRY_COMPARE(widget.size(), rect.size()); + // Windows: Minimum size of decorated windows. + const bool expectResizeFail = (!windowFlags && (rect.width() < 160 || rect.height() < 40)) + && m_platform == QStringLiteral("windows"); + if (!expectResizeFail) + QTRY_COMPARE(widget.size(), rect.size()); // move() while shown foreach (const QRect &r, rects) { - if (m_platform == QStringLiteral("xcb") - && ((widget.width() == 0 || widget.height() == 0) && r.width() != 0 && r.height() != 0)) { - QEXPECT_FAIL("130,100 0x200, flags 0", - "First resize after show of zero-sized gets wrong win_gravity.", - Continue); - QEXPECT_FAIL("100,50 200x0, flags 0", - "First resize after show of zero-sized gets wrong win_gravity.", - Continue); - QEXPECT_FAIL("130,50 0x0, flags 0", - "First resize after show of zero-sized gets wrong win_gravity.", - Continue); - } - + // XCB: First resize after show of zero-sized gets wrong win_gravity. + const bool expectMoveFail = !windowFlags + && ((widget.width() == 0 || widget.height() == 0) && r.width() != 0 && r.height() != 0) + && m_platform == QStringLiteral("xcb") + && (rect == QRect(QPoint(130, 100), QSize(0, 200)) + || rect == QRect(QPoint(100, 50), QSize(200, 0)) + || rect == QRect(QPoint(130, 50), QSize(0, 0))); widget.move(r.topLeft()); widget.resize(r.size()); QApplication::processEvents(); - QTRY_COMPARE(widget.pos(), r.topLeft()); - QTRY_COMPARE(widget.size(), r.size()); + if (!expectMoveFail) { + QTRY_COMPARE(widget.pos(), r.topLeft()); + QTRY_COMPARE(widget.size(), r.size()); + } } widget.move(rect.topLeft()); widget.resize(rect.size()); -- cgit v1.2.3