diff options
author | Fawzi Mohamed <fawzi.mohamed@qt.io> | 2021-03-22 17:22:07 +0100 |
---|---|---|
committer | Fawzi Mohamed <fawzi.mohamed@qt.io> | 2021-04-14 14:10:07 +0200 |
commit | 94a68cda52120859bd1cf9754fdecb084d65bab5 (patch) | |
tree | e29428ff3477a54b7b0f874aa583d495ef0c4a41 /tests/auto/qmldom/domitem/tst_qmldomitem.cpp | |
parent | cf00dd59d16005d0511c43b3b7ca15e43612b9f6 (diff) |
qmldom: Improve basic infrastructure
* introduce function_ref to represent a reference to a function
and use it consistently
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0792r5.html)
* restricted errormessage levels to those of QtMsgType
* made path iterate on its segments
* made path methods mirror the DomItem methods, so that path
construction and access are similar
* AttachedInfo to keep the location information
* SourceLocation::combine
Change-Id: I152c4cc2c601e867f205a4f4b7b3f24884d60ad9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qmldom/domitem/tst_qmldomitem.cpp')
-rw-r--r-- | tests/auto/qmldom/domitem/tst_qmldomitem.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/qmldom/domitem/tst_qmldomitem.cpp b/tests/auto/qmldom/domitem/tst_qmldomitem.cpp index bec8db8c4a..543bad9a39 100644 --- a/tests/auto/qmldom/domitem/tst_qmldomitem.cpp +++ b/tests/auto/qmldom/domitem/tst_qmldomitem.cpp @@ -73,9 +73,9 @@ private slots: QCOMPARE(&(l3[0]), &(l3[0])); // QCOMPARE(&(l3[0]), &(l4[0])); // shallow copy actually copies els (QVector behavior)... DomItem list1 = env.subList( - List::fromQListRef<int>(Path::field(u"list"), l, &wrapInt)).item; + List::fromQListRef<int>(Path::Field(u"list"), l, &wrapInt)).item; DomItem list2 = env.subList( - List::fromQListRef<int>(Path::field(u"reverseList"), l, &wrapInt, ListOptions::Reverse)).item; + List::fromQListRef<int>(Path::Field(u"reverseList"), l, &wrapInt, ListOptions::Reverse)).item; QCOMPARE(list1.domKind(), DomKind::List); QCOMPARE(list1.indexes(), 4); QCOMPARE(list1[0].value().toInteger(), 1); @@ -107,7 +107,7 @@ private slots: //QCOMPARE(&(*it3), &(*it5)); DomItem map1 = env.subMap( Map::fromMapRef<int>( - Path::field(u"map"), map, + Path::Field(u"map"), map, &wrapInt)).item; QCOMPARE(map1.domKind(), DomKind::Map); QCOMPARE(map1[u"a"].value().toInteger(), 1); @@ -137,7 +137,7 @@ private slots: //QCOMPARE(&(*it4), &(*it6)); DomItem map1 = env.subMap( Map::fromMultiMapRef<int>( - Path::field(u"mmap"), mmap, + Path::Field(u"mmap"), mmap, &wrapInt)).item; QCOMPARE(map1[u"b"].index(0).value().toInteger(), 2); QVERIFY(!map1[u"b"].index(2)); @@ -148,7 +148,7 @@ private slots: QCOMPARE(map1.container(), env); } void testReference() { - Path p = Path::root(u"env"); + Path p = Path::Root(u"env"); DomItem ref = env.subReferenceField(u"ref",p).item; QCOMPARE(ref.field(u"referredObjectPath").value().toString(), p.toString()); QCOMPARE(ref.fields(), QList<QString>({QStringLiteral(u"referredObjectPath"), QStringLiteral(u"get")})); @@ -159,7 +159,7 @@ private slots: QCOMPARE(env.pathFromOwner(), Path()); QCOMPARE(env.containingObject().internalKind(), DomType::Empty); QCOMPARE(env.container().internalKind(), DomType::Empty); - QCOMPARE(env.canonicalPath(), Path::root(u"env")); + QCOMPARE(env.canonicalPath(), Path::Root(u"env")); QCOMPARE(env.path(u"$env").internalKind(), DomType::DomEnvironment); QCOMPARE(env.top().internalKind(), DomType::DomEnvironment); QCOMPARE(env.environment().internalKind(), DomType::DomEnvironment); |