aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-06-20 21:29:31 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2018-06-20 22:00:45 +0000
commitc7a5331a061d1062cbe37ab94122d4f76337cbe1 (patch)
tree97728b0de594af6deecff9d29e470aeb2c19ce8b /tests
parent3a869515d0dfca76ab378263acb5c6f21e68482b (diff)
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 <shawn.rutledge@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp16
1 files 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;
}