aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2021-06-11 14:15:35 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2021-06-15 13:49:23 +0200
commit719e7daab06d10c9cec0059d73096435a1589e00 (patch)
treee55c1b588b204c8f9f74e0d88ec8290aa9799714
parentd3412cddab1ca2ed47ed3862d5d7e0a065e64b86 (diff)
Use QFAIL("Informative message") in preference to QVERIFY(false)
Change-Id: I9e9bf8ee19543c3ecd3d96c7aef59121567077c5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--tests/auto/qml/qqmlchangeset/tst_qqmlchangeset.cpp8
-rw-r--r--tests/auto/quick/examples/tst_examples.cpp4
-rw-r--r--tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp4
3 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/qml/qqmlchangeset/tst_qqmlchangeset.cpp b/tests/auto/qml/qqmlchangeset/tst_qqmlchangeset.cpp
index f12c3432c2..44a57a6eed 100644
--- a/tests/auto/qml/qqmlchangeset/tst_qqmlchangeset.cpp
+++ b/tests/auto/qml/qqmlchangeset/tst_qqmlchangeset.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -218,19 +218,19 @@ Q_DECLARE_METATYPE(tst_qqmlchangeset::SignalListList)
qDebug() << input; \
qDebug() << output; \
qDebug() << changes; \
- QVERIFY(false); \
+ QFAIL("Failed to apply input changes"); \
} else if (!applyChanges(outputList, output)) { \
qDebug() << input; \
qDebug() << output; \
qDebug() << changes; \
- QVERIFY(false); \
+ QFAIL("Failed to apply output changes"); \
} else if (outputList != inputList /* || changes != output*/) { \
qDebug() << input; \
qDebug() << output; \
qDebug() << changes; \
qDebug() << inputList; \
qDebug() << outputList; \
- QVERIFY(false); \
+ QFAIL("Outputs don't match inputs"); \
} else if (changes != output) { \
qDebug() << output; \
qDebug() << changes; \
diff --git a/tests/auto/quick/examples/tst_examples.cpp b/tests/auto/quick/examples/tst_examples.cpp
index dca5c1c3fd..154f31023d 100644
--- a/tests/auto/quick/examples/tst_examples.cpp
+++ b/tests/auto/quick/examples/tst_examples.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -300,7 +300,7 @@ void tst_examples::sgsnippets()
QQuickItem *root = qobject_cast<QQuickItem *>(object.data());
if (!root && !window) {
component.completeCreate();
- QVERIFY(false);
+ QFAIL("No root and no window");
}
if (!window)
window = new QQuickWindow;
diff --git a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
index 3885dd4a9a..1b8713f7af 100644
--- a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
+++ b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
@@ -1271,7 +1271,7 @@ void tst_qquickpositioners::moveTransitions(const QString &positionerObjectName)
case ListChange::Inserted:
case ListChange::SetCurrent:
case ListChange::SetContentY:
- QVERIFY(false);
+ QFAIL("Wrong change type");
break;
case ListChange::Polish:
break;
@@ -1298,7 +1298,7 @@ void tst_qquickpositioners::moveTransitions(const QString &positionerObjectName)
else if (change.type == ListChange::Removed)
displacedIndexes = adjustIndexesForRemoveDisplaced(expectedDisplacedIndexes.indexes, change.index, change.count);
else
- QVERIFY(false);
+ QFAIL("Wrong change type");
matchItemsAndIndexes(window->rootObject()->property("displacedTrans_items").toMap(), model, displacedIndexes);
QVariantList listOfEmptyIntLists;