diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/geotestplugin/qplacemanagerengine_test.h | 18 | ||||
-rw-r--r-- | tests/auto/nokia_services/places_semiauto/tst_places.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp | 7 |
3 files changed, 9 insertions, 20 deletions
diff --git a/tests/auto/geotestplugin/qplacemanagerengine_test.h b/tests/auto/geotestplugin/qplacemanagerengine_test.h index f015afe7..0c707b65 100644 --- a/tests/auto/geotestplugin/qplacemanagerengine_test.h +++ b/tests/auto/geotestplugin/qplacemanagerengine_test.h @@ -574,11 +574,8 @@ public: m_categories.insert(category.categoryId(), category); QStringList children = m_childCategories.value(parentId); - QMutableHashIterator<QString, QStringList> i(m_childCategories); - while (i.hasNext()) { - i.next(); - i.value().removeAll(category.categoryId()); - } + for (QStringList &c : m_childCategories) + c.removeAll(category.categoryId()); if (!children.contains(category.categoryId())) { children.append(category.categoryId()); @@ -614,11 +611,8 @@ public: } else { m_categories.remove(categoryId); - QMutableHashIterator<QString, QStringList> i(m_childCategories); - while (i.hasNext()) { - i.next(); - i.value().removeAll(categoryId); - } + for (auto &c : m_childCategories) + c.removeAll(categoryId); } QMetaObject::invokeMethod(reply, "emitFinished", Qt::QueuedConnection); @@ -637,9 +631,7 @@ public: QString parentCategoryId(const QString &categoryId) const override { - QHashIterator<QString, QStringList> i(m_childCategories); - while (i.hasNext()) { - i.next(); + for (auto i = m_childCategories.cbegin(), end = m_childCategories.cend(); i != end; ++i) { if (i.value().contains(categoryId)) return i.key(); } diff --git a/tests/auto/nokia_services/places_semiauto/tst_places.cpp b/tests/auto/nokia_services/places_semiauto/tst_places.cpp index 2f68ab44..c198c616 100644 --- a/tests/auto/nokia_services/places_semiauto/tst_places.cpp +++ b/tests/auto/nokia_services/places_semiauto/tst_places.cpp @@ -610,9 +610,7 @@ void tst_QPlaceManagerNokia::content() QVERIFY(results.count() > 0); - QMapIterator<int, QPlaceContent> iter(results); - while (iter.hasNext()) { - iter.next(); + for (auto iter = results.cbegin(), end = results.cend(); iter != end; ++iter) { switch (type) { case (QPlaceContent::ImageType): { QPlaceImage image = iter.value(); diff --git a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp index 5da6b4d4..c7189278 100644 --- a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp +++ b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp @@ -145,7 +145,7 @@ void tst_QGeoTiledMap::fetchTiles() m_tilesCounter->m_tiles.clear(); m_map->setCameraData(camera); waitForFetch(visibleCount); - QSet<QGeoTileSpec> visible = m_tilesCounter->m_tiles; + const QSet<QGeoTileSpec> visible = m_tilesCounter->m_tiles; m_map->clearData(); m_tilesCounter->m_tiles.clear(); m_map->prefetchData(); @@ -164,9 +164,8 @@ void tst_QGeoTiledMap::fetchTiles() QVERIFY2(visibleCount == visible.size(), "visible count incorrect"); QVERIFY2(prefetchCount == prefetched.size(), "prefetch count incorrect"); - QSetIterator<QGeoTileSpec> i(visible); - while (i.hasNext()) - QVERIFY2(prefetched.contains(i.next()),"visible tile missing from prefetched tiles"); + for (const QGeoTileSpec &tile : visible) + QVERIFY2(prefetched.contains(tile),"visible tile missing from prefetched tiles"); //for zoomLevels wihtout fractions more tiles are fetched for current zoomlevel due to ViewExpansion if (qCeil(zoomLevel) != zoomLevel && style == QGeoTiledMap::PrefetchNeighbourLayer && nearestNeighbourLayer < zoomLevel) |