summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-08-08 10:54:07 +0200
committerAhmad Samir <a.samirh78@gmail.com>2023-08-14 23:11:54 +0300
commitf2f8820073488c89fb71e3eb2d2e87bb582c3995 (patch)
tree13e8a7bc5bb755fac84f8e8dc9801a670edea5d0 /tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
parent47375a213f0751b5649ee7c4ae47fae020f9c77f (diff)
tests: port assorted trivial uses of Q_FOREACH to ranged for loops
All of these fall into the trivial category: loops over (readily made) const local containers. As such, they cannot possibly depend on the safety copy that Q_FOREACH performs, so are safe to port as-is to ranged for loops. There may be more where these came from, but these were the ones that stood out as immediately obvious when scanning the 100s of uses in qtbase, so I preferred to directly fix them over white-listing their files with QT_NO_FOREACH (which still may be necessary for some files, as this patch may not port all uses in that file). Pick-to: 6.6 6.5 Task-nubmber: QTBUG-115839 Change-Id: I7b7893bec8254f902660dac24167113aca855029 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp')
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
index f4714af91f..bb6ecb45f4 100644
--- a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
+++ b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
@@ -876,8 +876,8 @@ void tst_QPluginLoader::loadMachO_data()
QTest::newRow("machtest/good.fat.stub-i386.dylib") << false;
QDir d(QFINDTESTDATA("machtest"));
- QStringList badlist = d.entryList(QStringList() << "bad*.dylib");
- foreach (const QString &bad, badlist)
+ const QStringList badlist = d.entryList(QStringList() << "bad*.dylib");
+ for (const QString &bad : badlist)
QTest::newRow(qPrintable("machtest/" + bad)) << false;
#endif
}