Skip to content

Commit

Permalink
tests/auto/corelib/json: clean up
Browse files Browse the repository at this point in the history
Just one Q_FOREACH needed porting to C++11 range-for here.

Change-Id: I30ddd2a80cbb3245e23accc7843e67574fb2db17
Reviewed-by: Lars Knoll <[email protected]>
  • Loading branch information
marc-kdab committed Aug 27, 2016
1 parent 33aaa6a commit dd0daa7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/auto/corelib/json/tst_qtjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit dd0daa7

Please sign in to comment.