summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlpropertymap/tst_qmlpropertymap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qmlpropertymap/tst_qmlpropertymap.cpp')
-rw-r--r--tests/auto/declarative/qmlpropertymap/tst_qmlpropertymap.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/auto/declarative/qmlpropertymap/tst_qmlpropertymap.cpp b/tests/auto/declarative/qmlpropertymap/tst_qmlpropertymap.cpp
index 9be77e8..ece6030 100644
--- a/tests/auto/declarative/qmlpropertymap/tst_qmlpropertymap.cpp
+++ b/tests/auto/declarative/qmlpropertymap/tst_qmlpropertymap.cpp
@@ -95,13 +95,15 @@ void tst_QmlPropertyMap::operatorValue()
QmlPropertyMap map;
map.insert(QLatin1String("key1"),100);
map.insert(QLatin1String("key2"),200);
- QVERIFY(map.keys().count() == 2);
+ QVERIFY(map.count() == 2);
QVERIFY(map.contains(QLatin1String("key1")));
- QCOMPARE(map.value(QLatin1String("key1")), QVariant(100));
- QCOMPARE(map.value(QLatin1String("key2")), QVariant(200));
- QCOMPARE(map[QLatin1String("key1")], map.value(QLatin1String("key1")));
- QCOMPARE(map[QLatin1String("key2")], map.value(QLatin1String("key2")));
+ const QmlPropertyMap &constMap = map;
+
+ QCOMPARE(constMap.value(QLatin1String("key1")), QVariant(100));
+ QCOMPARE(constMap.value(QLatin1String("key2")), QVariant(200));
+ QCOMPARE(constMap[QLatin1String("key1")], constMap.value(QLatin1String("key1")));
+ QCOMPARE(constMap[QLatin1String("key2")], constMap.value(QLatin1String("key2")));
}
void tst_QmlPropertyMap::clear()