summaryrefslogtreecommitdiffstats
path: root/tests/auto/network
diff options
context:
space:
mode:
authorDavid Skoland <david.skoland@qt.io>2020-11-03 11:27:43 +0100
committerDavid Skoland <david.skoland@qt.io>2020-11-06 10:16:31 +0100
commit28f7c95e3b7fe56835f70c513b192eedf093d830 (patch)
tree305e81bd44b1d140dd655ec23c940c70f7b7aebf /tests/auto/network
parentdfec79f5d818e3cf1390e9c149501603c36d409b (diff)
Use built-in C++ foreach iteration in tests
Change-Id: I1e4bf9249ce26c034c676d78cfa16231226da05b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/network')
-rw-r--r--tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
index 10d7aa20f8..6b2df3cce4 100644
--- a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
+++ b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
@@ -518,7 +518,7 @@ void tst_QNetworkCookieJar::rfc6265_data()
QVERIFY(!document.isNull());
QVERIFY(document.isArray());
- foreach (const QJsonValue& testCase, document.array()) {
+ for (const QJsonValue testCase : document.array()) {
QJsonObject testObject = testCase.toObject();
//"test" - the test case name
@@ -527,15 +527,15 @@ void tst_QNetworkCookieJar::rfc6265_data()
continue;
//"received" - the cookies received from the server
- QJsonArray received = testObject.value("received").toArray();
+ const QJsonArray received = testObject.value("received").toArray();
QStringList receivedList;
- foreach (const QJsonValue& receivedCookie, received)
+ for (const QJsonValue receivedCookie : received)
receivedList.append(receivedCookie.toString());
//"sent" - the cookies sent back to the server
- QJsonArray sent = testObject.value("sent").toArray();
+ const QJsonArray sent = testObject.value("sent").toArray();
QList<QNetworkCookie> sentList;
- foreach (const QJsonValue& sentCookie, sent) {
+ for (const QJsonValue sentCookie : sent) {
QJsonObject sentCookieObject = sentCookie.toObject();
QNetworkCookie cookie;
cookie.setName(sentCookieObject.value("name").toString().toUtf8());