tst_QImageReader: fix a trivial Q_FOREACH and remove #undef QT_NO_FOREACH

Other recent commits have fixed the other Q_FOREACH uses in this file.

Task-number: QTBUG-115839
Change-Id: I03063f3e8f1e99c5a2aa2d9188260f3e79ca43bd
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Marc Mutz 2023-08-08 20:13:08 +02:00 committed by Ahmad Samir
parent 11d6932560
commit 02add2a807

View File

@ -1,8 +1,6 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include <QTest>
#include <QBuffer>
@ -1832,13 +1830,13 @@ void tst_QImageReader::testIgnoresFormatAndExtension()
SKIP_IF_UNSUPPORTED(expected.toLatin1());
QList<QByteArray> formats = QImageReader::supportedImageFormats();
const QList<QByteArray> formats = QImageReader::supportedImageFormats();
QString fileNameBase = prefix + name + QLatin1Char('.');
QString tempPath = m_temporaryDir.path();
if (!tempPath.endsWith(QLatin1Char('/')))
tempPath += QLatin1Char('/');
foreach (const QByteArray &f, formats) {
for (const QByteArray &f : formats) {
if (f == extension.toLocal8Bit())
continue;