From 37bb907a921edab7e2ac675f82d93cc08e96fc01 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 7 Aug 2018 11:06:35 +0200 Subject: Add debugging output to help diagnose cause of tst_qspinbox failure I've tried to reproduce the failures in the CI a couple of times now, but it keeps passing. Let's leave some debug output in the test so that if/when it does fail, we might know a bit more about why it does so. Task-number: QTBUG-69492 Change-Id: I5b39ac692e9026ce4b25cd13d342b11e061b777b Reviewed-by: Edward Welbourne Reviewed-by: Nathan Collins Reviewed-by: Oliver Wolff --- tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/auto/widgets') diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp index 5a51bab51f..37bb28dec9 100644 --- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp +++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp @@ -1775,6 +1775,10 @@ void tst_QSpinBox::stepModifierPressAndHold() spin.setStyle(stepModifierStyle.data()); QSignalSpy spy(&spin, QOverload::of(&SpinBox::valueChanged)); + // TODO: remove debug output when QTBUG-69492 is fixed + connect(&spin, QOverload::of(&SpinBox::valueChanged), [=]() { + qDebug() << QTime::currentTime() << "valueChanged emitted"; + }); spin.show(); QVERIFY(QTest::qWaitForWindowActive(&spin)); @@ -1785,6 +1789,9 @@ void tst_QSpinBox::stepModifierPressAndHold() const QRect buttonRect = spin.style()->subControlRect( QStyle::CC_SpinBox, &spinBoxStyleOption, subControl, &spin); + // TODO: remove debug output when QTBUG-69492 is fixed + qDebug() << "QGuiApplication::focusWindow():" << QGuiApplication::focusWindow(); + qDebug() << "QGuiApplication::topLevelWindows():" << QGuiApplication::topLevelWindows(); QTest::mousePress(&spin, Qt::LeftButton, modifiers, buttonRect.center()); QTRY_VERIFY2(spy.length() >= 3, qPrintable(QString::fromLatin1( "Expected valueChanged() to be emitted 3 or more times, but it was only emitted %1 times").arg(spy.length()))); -- cgit v1.2.3