summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@theqtcompany.com>2015-11-23 12:22:50 +0100
committerJan Arve Sæther <jan-arve.saether@theqtcompany.com>2015-12-04 15:13:59 +0000
commit118d5dc4960e24d222f06ba7e1c6eab643a30f3e (patch)
treed86e4598047c78394e7c3573a1990eb63d6a9289 /tests
parent361e24b79ef835e1df040c64a71b9f42f90f14ad (diff)
Skip testing empty window sizes on Windows
Change-Id: Ib4f3bc63196527583a274180c40d0f7847e13f55 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 97c23ddf26..ddbb4e6d75 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -4562,8 +4562,18 @@ void tst_QWidget::setWindowGeometry_data()
QList<int> windowFlags;
windowFlags << 0 << Qt::FramelessWindowHint;
+ const bool skipEmptyRects = (m_platform == QStringLiteral("windows"));
foreach (QList<QRect> l, rects) {
QRect rect = l.first();
+ if (skipEmptyRects) {
+ QList<QRect>::iterator it = l.begin();
+ while (it != l.end()) {
+ if (it->isEmpty())
+ it = l.erase(it);
+ else
+ ++it;
+ }
+ }
foreach (int windowFlag, windowFlags) {
QTest::newRow(QString("%1,%2 %3x%4, flags %5")
.arg(rect.x())
@@ -4612,8 +4622,13 @@ void tst_QWidget::setWindowGeometry()
widget.setGeometry(rect);
widget.showNormal();
- if (rect.isValid())
+ if (rect.isValid()) {
QVERIFY(QTest::qWaitForWindowExposed(&widget));
+ } else {
+ // in case of an invalid rect, wait for the geometry to become
+ // adjusted to the actual (valid) value.
+ QApplication::processEvents();
+ }
QTRY_COMPARE(widget.geometry(), rect);
// setGeometry() while shown