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>
bb10
Marc Mutz 2016-08-17 10:04:23 +02:00
parent 33aaa6a995
commit dd0daa73f5
1 changed files with 3 additions and 2 deletions

View File

@ -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);
}