From c7a5331a061d1062cbe37ab94122d4f76337cbe1 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 20 Jun 2018 21:29:31 +0200 Subject: tst_qquickpositioners::createView: replace qDebugs, fix warning We use qCDebug(lcTests) to avoid the output clutter unless the test fails, then the CI system will re-run it with all logging categories enabled. The "1-2-3-4" count was anyway not very informative. As usual there was a -Wunused-result warning about ignoring the return from qWaitForExposed, so now we don't ignore it. (Not sure if it ought to be fatal though.) Change-Id: I48f43083cbbcf27c81f0ac951b03d7b8b76e5300 Reviewed-by: Shawn Rutledge --- .../quick/qquickpositioners/tst_qquickpositioners.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp index fc6b4bd8d6..ec31acf035 100644 --- a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp +++ b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp @@ -40,6 +40,8 @@ using namespace QQuickViewTestUtil; using namespace QQuickVisualTestUtil; +Q_LOGGING_CATEGORY(lcTests, "qt.quick.tests") + class tst_qquickpositioners : public QQmlDataTest { Q_OBJECT @@ -4011,15 +4013,19 @@ void tst_qquickpositioners::test_attachedproperties_dynamic() QQuickView *tst_qquickpositioners::createView(const QString &filename, bool wait) { QQuickView *window = new QQuickView(nullptr); - qDebug() << "1"; + qCDebug(lcTests) << "created window"; window->setSource(QUrl::fromLocalFile(filename)); - qDebug() << "2"; + qCDebug(lcTests) << "loaded content from" << filename; window->show(); - qDebug() << "3"; + qCDebug(lcTests) << "window shown"; + bool exposed = true; if (wait) - QTest::qWaitForWindowExposed(window); //It may not relayout until the next frame, so it needs to be drawn - qDebug() << "4"; + exposed = QTest::qWaitForWindowExposed(window); //It may not relayout until the next frame, so it needs to be drawn + if (exposed) + qCDebug(lcTests) << "window exposed"; + else + qCWarning(lcTests) << "window NOT exposed"; return window; } -- cgit v1.2.3