aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Skoland <davidskoland@gmail.com>2020-10-28 13:25:38 +0100
committerDavid Skoland <david.skoland@qt.io>2020-10-28 14:44:47 +0100
commit27bd9cab73a1e7e3d66e6025ace8510f932c5df8 (patch)
tree4c92072c9a15d681d1c6cdca97f35db88ca7dae2 /tests
parent535adf8d9f6d26d4e9598a9276f23f938fcc7753 (diff)
Standardize QJsonArray iteration
When using refs as loop variables, the clang compiler complains (with default settings). This prevents that. Note that QJsonValueRef is used "behind the scenes", which makes this iteration method correct. Change-Id: I5a5f58ca8ad3887bce2009231cbae5a57c107697 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp2
-rw-r--r--tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
index dd201d1cfd..2561f19b11 100644
--- a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
+++ b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
@@ -969,7 +969,7 @@ void tst_QQmlDebugJS::encodeQmlScope()
if (scopes.count() < 2)
scopesFailed = true;
- for (const QJsonValue &scope : scopes) {
+ for (const QJsonValue scope : scopes) {
++numExpectedScopes;
m_client->scope(scope.toObject().value("index").toInt());
}
diff --git a/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp b/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp
index 6e06623fa6..2a6899080d 100644
--- a/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp
+++ b/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp
@@ -145,7 +145,7 @@ void TestQmlimportscanner::runQmlimportscanner(const QString &mode, const QStrin
const QJsonArray generatedArray = generated.array();
QJsonArray expectedArray = expected.array();
- for (const QJsonValue &value : generatedArray) {
+ for (const QJsonValue value : generatedArray) {
QVERIFY(value.isObject());
QJsonObject object = value.toObject();