aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlpropertymap
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/qqmlpropertymap
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/qqmlpropertymap')
-rw-r--r--tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp b/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp
index 4860602a45..2f3754e42d 100644
--- a/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp
+++ b/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp
@@ -104,7 +104,7 @@ void tst_QQmlPropertyMap::insert()
QQmlPropertyMap map;
map.insert(QLatin1String("key1"),100);
map.insert(QLatin1String("key2"),200);
- QVERIFY(map.keys().count() == 2);
+ QCOMPARE(map.keys().count(), 2);
QVERIFY(map.contains(QLatin1String("key1")));
QCOMPARE(map.value(QLatin1String("key1")), QVariant(100));
@@ -117,33 +117,33 @@ void tst_QQmlPropertyMap::insert()
//QQmlPropertyMap has an invokable keys() method
QTest::ignoreMessage(QtWarningMsg, "Creating property with name \"keys\" is not permitted, conflicts with internal symbols.");
map.insert(QLatin1String("keys"), 1);
- QVERIFY(map.keys().count() == 2);
+ QCOMPARE(map.keys().count(), 2);
QVERIFY(!map.contains(QLatin1String("keys")));
QVERIFY(map.value(QLatin1String("keys")).isNull());
//QQmlPropertyMap has a deleteLater() slot
QTest::ignoreMessage(QtWarningMsg, "Creating property with name \"deleteLater\" is not permitted, conflicts with internal symbols.");
map.insert(QLatin1String("deleteLater"), 1);
- QVERIFY(map.keys().count() == 2);
+ QCOMPARE(map.keys().count(), 2);
QVERIFY(!map.contains(QLatin1String("deleteLater")));
QVERIFY(map.value(QLatin1String("deleteLater")).isNull());
//QQmlPropertyMap has an valueChanged() signal
QTest::ignoreMessage(QtWarningMsg, "Creating property with name \"valueChanged\" is not permitted, conflicts with internal symbols.");
map.insert(QLatin1String("valueChanged"), 1);
- QVERIFY(map.keys().count() == 2);
+ QCOMPARE(map.keys().count(), 2);
QVERIFY(!map.contains(QLatin1String("valueChanged")));
QVERIFY(map.value(QLatin1String("valueChanged")).isNull());
//but 'valueChange' should be ok
map.insert(QLatin1String("valueChange"), 1);
- QVERIFY(map.keys().count() == 3);
+ QCOMPARE(map.keys().count(), 3);
QVERIFY(map.contains(QLatin1String("valueChange")));
QCOMPARE(map.value(QLatin1String("valueChange")), QVariant(1));
//'valueCHANGED' should be ok, too
map.insert(QLatin1String("valueCHANGED"), 1);
- QVERIFY(map.keys().count() == 4);
+ QCOMPARE(map.keys().count(), 4);
QVERIFY(map.contains(QLatin1String("valueCHANGED")));
QCOMPARE(map.value(QLatin1String("valueCHANGED")), QVariant(1));
}
@@ -153,7 +153,7 @@ void tst_QQmlPropertyMap::operatorInsert()
QQmlPropertyMap map;
map[QLatin1String("key1")] = 100;
map[QLatin1String("key2")] = 200;
- QVERIFY(map.keys().count() == 2);
+ QCOMPARE(map.keys().count(), 2);
QCOMPARE(map.value(QLatin1String("key1")), QVariant(100));
QCOMPARE(map.value(QLatin1String("key2")), QVariant(200));
@@ -167,7 +167,7 @@ void tst_QQmlPropertyMap::operatorValue()
QQmlPropertyMap map;
map.insert(QLatin1String("key1"),100);
map.insert(QLatin1String("key2"),200);
- QVERIFY(map.count() == 2);
+ QCOMPARE(map.count(), 2);
QVERIFY(map.contains(QLatin1String("key1")));
const QQmlPropertyMap &constMap = map;
@@ -182,12 +182,12 @@ void tst_QQmlPropertyMap::clear()
{
QQmlPropertyMap map;
map.insert(QLatin1String("key1"),100);
- QVERIFY(map.keys().count() == 1);
+ QCOMPARE(map.keys().count(), 1);
QCOMPARE(map.value(QLatin1String("key1")), QVariant(100));
map.clear(QLatin1String("key1"));
- QVERIFY(map.keys().count() == 1);
+ QCOMPARE(map.keys().count(), 1);
QVERIFY(map.contains(QLatin1String("key1")));
QCOMPARE(map.value(QLatin1String("key1")), QVariant());
}
@@ -463,7 +463,7 @@ void tst_QQmlPropertyMap::QTBUG_35906()
QScopedPointer<QObject> obj(component.create());
QVERIFY(!obj.isNull());
QVariant value = obj->property("testValue");
- QVERIFY(value.type() == QVariant::Int);
+ QCOMPARE(value.type(), QVariant::Int);
QCOMPARE(value.toInt(), 42);
}