aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlcontext
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-07-24 15:27:58 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-07-29 09:44:39 +0000
commit0ea3c24cfe7d1057964fe864924a7ee083764084 (patch)
tree681b7df0a201641203c936e748afd7d6a7ec39b5 /tests/auto/qml/qqmlcontext
parentbb87365ffabcba3a70dd49a4c3232a12b5b224a3 (diff)
tests/qml: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).
- Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Change-Id: I8cc97fd9b48fc789a849e9527c292c4e05accd97 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/qml/qqmlcontext')
-rw-r--r--tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
index 1bd070c2d0..18ef7ac31d 100644
--- a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
+++ b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
@@ -433,12 +433,12 @@ void tst_qqmlcontext::idAsContextProperty()
QVERIFY(obj);
QVariant a = obj->property("a");
- QVERIFY(a.userType() == QMetaType::QObjectStar);
+ QCOMPARE(a.userType(), int(QMetaType::QObjectStar));
QVariant ctxt = qmlContext(obj)->contextProperty("myObject");
- QVERIFY(ctxt.userType() == QMetaType::QObjectStar);
+ QCOMPARE(ctxt.userType(), int(QMetaType::QObjectStar));
- QVERIFY(a == ctxt);
+ QCOMPARE(a, ctxt);
delete obj;
}
@@ -455,20 +455,20 @@ void tst_qqmlcontext::readOnlyContexts()
QQmlContext *context = qmlContext(obj);
QVERIFY(context);
- QVERIFY(qvariant_cast<QObject*>(context->contextProperty("me")) == obj);
- QVERIFY(context->contextObject() == obj);
+ QCOMPARE(qvariant_cast<QObject*>(context->contextProperty("me")), obj);
+ QCOMPARE(context->contextObject(), obj);
QTest::ignoreMessage(QtWarningMsg, "QQmlContext: Cannot set property on internal context.");
context->setContextProperty("hello", 12);
- QVERIFY(context->contextProperty("hello") == QVariant());
+ QCOMPARE(context->contextProperty("hello"), QVariant());
QTest::ignoreMessage(QtWarningMsg, "QQmlContext: Cannot set property on internal context.");
context->setContextProperty("hello", obj);
- QVERIFY(context->contextProperty("hello") == QVariant());
+ QCOMPARE(context->contextProperty("hello"), QVariant());
QTest::ignoreMessage(QtWarningMsg, "QQmlContext: Cannot set context object for internal context.");
context->setContextObject(0);
- QVERIFY(context->contextObject() == obj);
+ QCOMPARE(context->contextObject(), obj);
delete obj;
}