aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlmetatype
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/qqmlmetatype
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/qqmlmetatype')
-rw-r--r--tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
index f5423582b2..27e92f67a3 100644
--- a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
+++ b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
@@ -126,7 +126,7 @@ void tst_qqmlmetatype::initTestCase()
void tst_qqmlmetatype::qmlParserStatusCast()
{
- QVERIFY(QQmlMetaType::qmlType(QVariant::Int) == 0);
+ QVERIFY(!QQmlMetaType::qmlType(QVariant::Int));
QVERIFY(QQmlMetaType::qmlType(qMetaTypeId<TestType *>()) != 0);
QCOMPARE(QQmlMetaType::qmlType(qMetaTypeId<TestType *>())->parserStatusCast(), -1);
QVERIFY(QQmlMetaType::qmlType(qMetaTypeId<ValueSourceTestType *>()) != 0);
@@ -146,7 +146,7 @@ void tst_qqmlmetatype::qmlParserStatusCast()
void tst_qqmlmetatype::qmlPropertyValueSourceCast()
{
- QVERIFY(QQmlMetaType::qmlType(QVariant::Int) == 0);
+ QVERIFY(!QQmlMetaType::qmlType(QVariant::Int));
QVERIFY(QQmlMetaType::qmlType(qMetaTypeId<TestType *>()) != 0);
QCOMPARE(QQmlMetaType::qmlType(qMetaTypeId<TestType *>())->propertyValueSourceCast(), -1);
QVERIFY(QQmlMetaType::qmlType(qMetaTypeId<ParserStatusTestType *>()) != 0);
@@ -166,7 +166,7 @@ void tst_qqmlmetatype::qmlPropertyValueSourceCast()
void tst_qqmlmetatype::qmlPropertyValueInterceptorCast()
{
- QVERIFY(QQmlMetaType::qmlType(QVariant::Int) == 0);
+ QVERIFY(!QQmlMetaType::qmlType(QVariant::Int));
QVERIFY(QQmlMetaType::qmlType(qMetaTypeId<TestType *>()) != 0);
QCOMPARE(QQmlMetaType::qmlType(qMetaTypeId<TestType *>())->propertyValueInterceptorCast(), -1);
QVERIFY(QQmlMetaType::qmlType(qMetaTypeId<ParserStatusTestType *>()) != 0);
@@ -224,8 +224,8 @@ void tst_qqmlmetatype::isList()
void tst_qqmlmetatype::defaultObject()
{
- QVERIFY(QQmlMetaType::defaultProperty(&QObject::staticMetaObject).name() == 0);
- QVERIFY(QQmlMetaType::defaultProperty(&ParserStatusTestType::staticMetaObject).name() == 0);
+ QVERIFY(!QQmlMetaType::defaultProperty(&QObject::staticMetaObject).name());
+ QVERIFY(!QQmlMetaType::defaultProperty(&ParserStatusTestType::staticMetaObject).name());
QCOMPARE(QString(QQmlMetaType::defaultProperty(&TestType::staticMetaObject).name()), QString("foo"));
QObject o;
@@ -233,8 +233,8 @@ void tst_qqmlmetatype::defaultObject()
ParserStatusTestType p;
QVERIFY(QQmlMetaType::defaultProperty((QObject *)0).name() == 0);
- QVERIFY(QQmlMetaType::defaultProperty(&o).name() == 0);
- QVERIFY(QQmlMetaType::defaultProperty(&p).name() == 0);
+ QVERIFY(!QQmlMetaType::defaultProperty(&o).name());
+ QVERIFY(!QQmlMetaType::defaultProperty(&p).name());
QCOMPARE(QString(QQmlMetaType::defaultProperty(&t).name()), QString("foo"));
}
@@ -270,8 +270,8 @@ void tst_qqmlmetatype::compositeType()
QQmlType *type = QQmlMetaType::qmlType(QString("ImplicitType"), QString(""), 1, 0);
QVERIFY(type);
- QVERIFY(type->module() == QLatin1String(""));
- QVERIFY(type->elementName() == QLatin1String("ImplicitType"));
+ QVERIFY(type->module().isEmpty());
+ QCOMPARE(type->elementName(), QLatin1String("ImplicitType"));
QCOMPARE(type->qmlTypeName(), QLatin1String("ImplicitType"));
QCOMPARE(type->sourceUrl(), testFileUrl("ImplicitType.qml"));
}