diff --git a/tests/auto/tools/qmakelib/CMakeLists.txt b/tests/auto/tools/qmakelib/CMakeLists.txt index 271c369cf0..4c6a1e2a72 100644 --- a/tests/auto/tools/qmakelib/CMakeLists.txt +++ b/tests/auto/tools/qmakelib/CMakeLists.txt @@ -24,9 +24,6 @@ qt_internal_add_test(tst_qmakelib evaltest.cpp parsertest.cpp tst_qmakelib.cpp tst_qmakelib.h - NO_PCH_SOURCES - evaltest.cpp # undef QT_NO_FOREACH - parsertest.cpp # undef QT_NO_FOREACH DEFINES PROEVALUATOR_FULL PROEVALUATOR_SETENV diff --git a/tests/auto/tools/qmakelib/evaltest.cpp b/tests/auto/tools/qmakelib/evaltest.cpp index 94355efdd8..e4174ccfb2 100644 --- a/tests/auto/tools/qmakelib/evaltest.cpp +++ b/tests/auto/tools/qmakelib/evaltest.cpp @@ -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 "tst_qmakelib.h" #include @@ -2748,7 +2746,7 @@ static QString formatValue(const ProStringList &vals) { QString ret; - foreach (const ProString &str, vals) { + for (const ProString &str : vals) { ret += QLatin1Char(' '); ret += QMakeEvaluator::quoteValue(str); } @@ -2866,9 +2864,9 @@ void tst_qmakelib::proEval() qWarning("Got unexpected message(s)"); verified = false; } - QStringList missingMsgs = handler.expectedMessages(); + const QStringList missingMsgs = handler.expectedMessages(); if (!missingMsgs.isEmpty()) { - foreach (const QString &msg, missingMsgs) + for (const QString &msg : missingMsgs) qWarning("Missing message: %s", qPrintable(msg)); verified = false; } diff --git a/tests/auto/tools/qmakelib/parsertest.cpp b/tests/auto/tools/qmakelib/parsertest.cpp index ec1ec5ccbb..1d9c7e38d0 100644 --- a/tests/auto/tools/qmakelib/parsertest.cpp +++ b/tests/auto/tools/qmakelib/parsertest.cpp @@ -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 "tst_qmakelib.h" #include @@ -2013,9 +2011,9 @@ void tst_qmakelib::proParser() qWarning("Got unexpected message(s)"); verified = false; } - QStringList missingMsgs = handler.expectedMessages(); + const QStringList missingMsgs = handler.expectedMessages(); if (!missingMsgs.isEmpty()) { - foreach (const QString &msg, missingMsgs) + for (const QString &msg : missingMsgs) qWarning("Missing message: %s", qPrintable(msg)); verified = false; }