diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-11-02 12:42:33 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-11-02 14:56:12 +0100 |
commit | 66c8e1f6851b35bb3f9063db377d6cbb2856a941 (patch) | |
tree | 04fb905e2a92c6d5ece1d280ba954b3457c2f146 /tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | |
parent | e47edfe7a75eb9240604e66fc6a400ebef83b6a0 (diff) |
Fix compiler warnings from tests
Replace foreach with ranged for; don't name unused function parameters.
Change-Id: If0d9138261567edb14b72791799c6da1b16b5a5b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index dd662ef6d3..8778a1e1ac 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -4205,9 +4205,8 @@ void tst_qqmlecmascript::singletonType() if (!errorMessage.isEmpty()) QTest::ignoreMessage(QtWarningMsg, errorMessage.toLatin1().constData()); - if (warningMessages.size()) - foreach (const QString &warning, warningMessages) - QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); + for (const QString &warning : qAsConst(warningMessages)) + QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); QObject *object = component.create(); if (!errorMessage.isEmpty()) { @@ -4566,9 +4565,10 @@ void tst_qqmlecmascript::importScripts() if (!errorMessage.isEmpty()) QTest::ignoreMessage(QtWarningMsg, errorMessage.toLatin1().constData()); - if (compilationShouldSucceed && warningMessages.size()) - foreach (const QString &warning, warningMessages) + if (compilationShouldSucceed) { + for (const QString &warning : qAsConst(warningMessages)) QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); + } if (compilationShouldSucceed) QTRY_VERIFY(component.isReady()); |