diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-08-17 10:04:23 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-08-27 05:09:29 +0000 |
commit | dd0daa73f5b03551fd6632562020259686a2fae4 (patch) | |
tree | e13816079f6070d9c36749e269f11d02d5e3e3cb /tests | |
parent | 33aaa6a9953c930bb19ba8cad2c2e4c2abe6db2e (diff) |
tests/auto/corelib/json: clean up
Just one Q_FOREACH needed porting to C++11 range-for here.
Change-Id: I30ddd2a80cbb3245e23accc7843e67574fb2db17
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/json/tst_qtjson.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/corelib/json/tst_qtjson.cpp b/tests/auto/corelib/json/tst_qtjson.cpp index 015228d7b9..1194260efa 100644 --- a/tests/auto/corelib/json/tst_qtjson.cpp +++ b/tests/auto/corelib/json/tst_qtjson.cpp @@ -2751,8 +2751,9 @@ void tst_QtJson::unicodeKeys() QCOMPARE(error.error, QJsonParseError::NoError); QJsonObject o = doc.object(); - QCOMPARE(o.keys().size(), 5); - Q_FOREACH (const QString &key, o.keys()) { + const auto keys = o.keys(); + QCOMPARE(keys.size(), 5); + for (const QString &key : keys) { QString suffix = key.mid(key.indexOf(QLatin1Char('_'))); QCOMPARE(o[key].toString(), QString("hello") + suffix); } |