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>
This commit is contained in:
parent
fe0348e103
commit
f528fff973
@ -4631,32 +4631,28 @@ void tst_QWidget::windowMoveResize()
|
|||||||
|
|
||||||
QTest::qWait(10);
|
QTest::qWait(10);
|
||||||
QTRY_COMPARE(widget.pos(), rect.topLeft());
|
QTRY_COMPARE(widget.pos(), rect.topLeft());
|
||||||
if (m_platform == QStringLiteral("windows")) {
|
// Windows: Minimum size of decorated windows.
|
||||||
QEXPECT_FAIL("130,100 0x200, flags 0", "QTBUG-26424", Continue);
|
const bool expectResizeFail = (!windowFlags && (rect.width() < 160 || rect.height() < 40))
|
||||||
QEXPECT_FAIL("130,50 0x0, flags 0", "QTBUG-26424", Continue);
|
&& m_platform == QStringLiteral("windows");
|
||||||
}
|
if (!expectResizeFail)
|
||||||
QTRY_COMPARE(widget.size(), rect.size());
|
QTRY_COMPARE(widget.size(), rect.size());
|
||||||
|
|
||||||
// move() while shown
|
// move() while shown
|
||||||
foreach (const QRect &r, rects) {
|
foreach (const QRect &r, rects) {
|
||||||
if (m_platform == QStringLiteral("xcb")
|
// XCB: First resize after show of zero-sized gets wrong win_gravity.
|
||||||
&& ((widget.width() == 0 || widget.height() == 0) && r.width() != 0 && r.height() != 0)) {
|
const bool expectMoveFail = !windowFlags
|
||||||
QEXPECT_FAIL("130,100 0x200, flags 0",
|
&& ((widget.width() == 0 || widget.height() == 0) && r.width() != 0 && r.height() != 0)
|
||||||
"First resize after show of zero-sized gets wrong win_gravity.",
|
&& m_platform == QStringLiteral("xcb")
|
||||||
Continue);
|
&& (rect == QRect(QPoint(130, 100), QSize(0, 200))
|
||||||
QEXPECT_FAIL("100,50 200x0, flags 0",
|
|| rect == QRect(QPoint(100, 50), QSize(200, 0))
|
||||||
"First resize after show of zero-sized gets wrong win_gravity.",
|
|| rect == QRect(QPoint(130, 50), QSize(0, 0)));
|
||||||
Continue);
|
|
||||||
QEXPECT_FAIL("130,50 0x0, flags 0",
|
|
||||||
"First resize after show of zero-sized gets wrong win_gravity.",
|
|
||||||
Continue);
|
|
||||||
}
|
|
||||||
|
|
||||||
widget.move(r.topLeft());
|
widget.move(r.topLeft());
|
||||||
widget.resize(r.size());
|
widget.resize(r.size());
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
QTRY_COMPARE(widget.pos(), r.topLeft());
|
if (!expectMoveFail) {
|
||||||
QTRY_COMPARE(widget.size(), r.size());
|
QTRY_COMPARE(widget.pos(), r.topLeft());
|
||||||
|
QTRY_COMPARE(widget.size(), r.size());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
widget.move(rect.topLeft());
|
widget.move(rect.topLeft());
|
||||||
widget.resize(rect.size());
|
widget.resize(rect.size());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user