aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qmldom/path/tst_qmldompath.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qmldom/path/tst_qmldompath.h')
-rw-r--r--tests/auto/qmldom/path/tst_qmldompath.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/qmldom/path/tst_qmldompath.h b/tests/auto/qmldom/path/tst_qmldompath.h
index 24d8c30bcf..f463b93164 100644
--- a/tests/auto/qmldom/path/tst_qmldompath.h
+++ b/tests/auto/qmldom/path/tst_qmldompath.h
@@ -1,5 +1,5 @@
// Copyright (C) 2020 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef TST_QMLDOMPATH_H
#define TST_QMLDOMPATH_H
@@ -16,7 +16,7 @@ namespace PathEls {
class TestPaths: public QObject {
Q_OBJECT
public:
- void testPathInternals(Path p1)
+ void testPathInternals(const Path &p1)
{
QCOMPARE(p1.component(0).kind(), Kind::Root);
QCOMPARE(p1.component(1).kind(), Kind::Current);
@@ -85,11 +85,11 @@ private slots:
auto c10=PathComponent(Any());
QCOMPARE(c10.kind(), Kind::Any);
QVERIFY(c9!=c10);
- auto c11=PathComponent(Filter([](DomItem){ return true; }));
+ auto c11=PathComponent(Filter([](const DomItem &){ return true; }));
auto c12=c11;
- auto c13=PathComponent(Filter([](DomItem){ return false; }));
- auto c14=PathComponent(Filter([](DomItem){ return false; }, u"skipAll"));
- auto c15=PathComponent(Filter([](DomItem){ return true; }, u"skipAll"));
+ auto c13=PathComponent(Filter([](const DomItem &){ return false; }));
+ auto c14=PathComponent(Filter([](const DomItem &){ return false; }, u"skipAll"));
+ auto c15=PathComponent(Filter([](const DomItem &){ return true; }, u"skipAll"));
QCOMPARE(c11.kind(), Kind::Filter);
QCOMPARE(c11, c11);
QVERIFY(c11 != c12); // native code assumed to be non comparable and different even if they are the same
@@ -132,7 +132,7 @@ private slots:
QCOMPARE(p6[6].headKind(), Kind::Empty);
auto rString = u"$.@.aa[4][\"bla\"][*].";
QCOMPARE(p6.toString(), rString);
- auto p7 = p6.filter([](DomItem){ return true; }, u"true");
+ auto p7 = p6.filter([](const DomItem &){ return true; }, u"true");
auto p7Str = p7.toString();
QCOMPARE(p7Str, u"$.@.aa[4][\"bla\"][*].[?(true)]");
auto p8 = p7.dropTail();
@@ -161,7 +161,7 @@ private slots:
void testPathSplit()
{
- QList<Path> paths({Path(),
+ const QList<Path> paths({Path(),
Path::Root(PathRoot::Env).field(u"pippo").key(u"pluto").index(4),
Path::Root(PathRoot::Env).field(u"pippo").key(u"pluto"),
Path::Root(PathRoot::Env).field(u"pippo"),
@@ -175,7 +175,7 @@ private slots:
Path::Index(4),
Path::Key(u"zz")
});
- foreach (Path p, paths) {
+ for (const Path &p : paths) {
Source s = p.split();
QCOMPARE(p, s.pathToSource.path(s.pathFromSource));
if (!s.pathFromSource)