diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-12-17 13:47:19 +0100 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2014-12-18 09:41:36 +0100 |
commit | bfbb985ed5d283114dbe37e6a42a3c19a61cd0d2 (patch) | |
tree | 35e3f8c3449bdaa45a8f19711f14a59968e0564d /tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | |
parent | 7f6c4390ec98b644cc3c07cc5aa5f47da37c8dd3 (diff) |
Add some debug information to tst_qwindow
The test still fails sporadically at a new place, so this adds some
debug information when it fails to may help us identify what is going
wrong.
Change-Id: Ife0f171299ef7e800a2d808602e76ca2f3885964
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'tests/auto/gui/kernel/qwindow/tst_qwindow.cpp')
-rw-r--r-- | tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 2b28f0a1d4..a5442968c6 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -154,6 +154,7 @@ public: void reset() { m_received.clear(); + m_framePositionsOnMove.clear(); } bool event(QEvent *event) @@ -162,6 +163,8 @@ public: m_order << event->type(); if (event->type() == QEvent::Expose) m_exposeRegion = static_cast<QExposeEvent *>(event)->region(); + else if (event->type() == QEvent::Move) + m_framePositionsOnMove << framePosition(); return QWindow::event(event); } @@ -181,6 +184,7 @@ public: return m_exposeRegion; } + QVector<QPoint> m_framePositionsOnMove; private: QHash<QEvent::Type, int> m_received; QVector<QEvent::Type> m_order; @@ -304,9 +308,17 @@ void tst_QWindow::positioning() QPoint framePos = QPlatformScreen::platformScreenForWindow(&window)->availableGeometry().center(); window.reset(); + const QPoint oldFramePos = window.framePosition(); window.setFramePosition(framePos); QTRY_VERIFY(window.received(QEvent::Move)); + if (window.framePosition() != framePos) { + qDebug() << "About to fail auto-test. Here is some additional information:"; + qDebug() << "window.framePosition() == " << window.framePosition(); + qDebug() << "old frame position == " << oldFramePos; + qDebug() << "We received " << window.received(QEvent::Move) << " move events"; + qDebug() << "frame positions after each move event:" << window.m_framePositionsOnMove; + } QTRY_COMPARE(framePos, window.framePosition()); QTRY_COMPARE(originalMargins, window.frameMargins()); QCOMPARE(window.position(), window.framePosition() + QPoint(originalMargins.left(), originalMargins.top())); |