summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qwidget
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-05-09 13:22:42 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-09 18:49:41 +0200
commitf528fff97394554ccac9c2d9ced790cc0e6e4350 (patch)
treeab3968e6d8f7666b3b603e473717aceb5fa02787 /tests/auto/widgets/kernel/qwidget
parentfe0348e1036d630c50895680bb9d6b3673fee8c2 (diff)
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 <frederik.gladhorn@digia.com>
Diffstat (limited to 'tests/auto/widgets/kernel/qwidget')
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp36
1 files changed, 16 insertions, 20 deletions
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());