diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative_ui/tst_map.qml | 36 | ||||
-rw-r--r-- | tests/auto/qgeoserviceprovider/tst_qgeoserviceprovider.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp | 4 |
3 files changed, 22 insertions, 20 deletions
diff --git a/tests/auto/declarative_ui/tst_map.qml b/tests/auto/declarative_ui/tst_map.qml index a81885fb..998a06d4 100644 --- a/tests/auto/declarative_ui/tst_map.qml +++ b/tests/auto/declarative_ui/tst_map.qml @@ -79,6 +79,8 @@ Item { Map {id: map; plugin: testPlugin; center: coordinate1; width: 100; height: 100} SignalSpy {id: mapCenterSpy; target: map; signalName: 'centerChanged'} + Map {id: mapPar; plugin: testPlugin; center: coordinate1; width: 512; height: 512} + Map {id: coordinateMap; plugin: herePlugin; center: coordinate3; width: 1000; height: 1000; zoomLevel: 15 } @@ -135,46 +137,46 @@ Item { function test_map_parameters() { // coordinate is set at map element declaration - var center = map.toCoordinate(Qt.point((map.width - 1) / 2.0, (map.height - 1) / 2.0)) + var center = mapPar.toCoordinate(Qt.point((mapPar.width - 1) / 2.0, (mapPar.height - 1) / 2.0)) fuzzyCompare(center.latitude, 10, 0.1) fuzzyCompare(center.longitude, 11, 0.1) - compare(map.mapParameters.length, 0) + compare(mapPar.mapParameters.length, 0) - map.addMapParameter(testParameter) + mapPar.addMapParameter(testParameter) - compare(map.mapParameters.length, 1) + compare(mapPar.mapParameters.length, 1) - center = map.toCoordinate(Qt.point((map.width - 1) / 2.0, (map.height - 1) / 2.0)) + center = mapPar.toCoordinate(Qt.point((mapPar.width - 1) / 2.0, (mapPar.height - 1) / 2.0)) fuzzyCompare(center.latitude, -33, 0.1) fuzzyCompare(center.longitude, -47, 0.1) - map.addMapParameter(testParameter) - compare(map.mapParameters.length, 1) + mapPar.addMapParameter(testParameter) + compare(mapPar.mapParameters.length, 1) - map.removeMapParameter(testParameter) - compare(map.mapParameters.length, 0) + mapPar.removeMapParameter(testParameter) + compare(mapPar.mapParameters.length, 0) - center = map.toCoordinate(Qt.point((map.width - 1) / 2.0, (map.height - 1) / 2.0)) + center = mapPar.toCoordinate(Qt.point((mapPar.width - 1) / 2.0, (mapPar.height - 1) / 2.0)) fuzzyCompare(center.latitude, -33, 0.1) fuzzyCompare(center.longitude, -47, 0.1) - testParameter.center = map.center - map.addMapParameter(testParameter) - compare(map.mapParameters.length, 1) + testParameter.center = mapPar.center + mapPar.addMapParameter(testParameter) + compare(mapPar.mapParameters.length, 1) - var center = map.toCoordinate(Qt.point((map.width - 1) / 2.0, (map.height - 1) / 2.0)) + var center = mapPar.toCoordinate(Qt.point((mapPar.width - 1) / 2.0, (mapPar.height - 1) / 2.0)) fuzzyCompare(center.latitude, 10, 0.1) fuzzyCompare(center.longitude, 11, 0.1) testParameter.center = QtPositioning.coordinate(-33.0, -47.0) - center = map.toCoordinate(Qt.point((map.width - 1) / 2.0, (map.height - 1) / 2.0)) + center = mapPar.toCoordinate(Qt.point((mapPar.width - 1) / 2.0, (mapPar.height - 1) / 2.0)) fuzzyCompare(center.latitude, -33, 0.1) fuzzyCompare(center.longitude, -47, 0.1) - map.removeMapParameter(testParameter) - compare(map.mapParameters.length, 0) + mapPar.removeMapParameter(testParameter) + compare(mapPar.mapParameters.length, 0) } function test_map_clamp() diff --git a/tests/auto/qgeoserviceprovider/tst_qgeoserviceprovider.cpp b/tests/auto/qgeoserviceprovider/tst_qgeoserviceprovider.cpp index 121253fa..6a9457fe 100644 --- a/tests/auto/qgeoserviceprovider/tst_qgeoserviceprovider.cpp +++ b/tests/auto/qgeoserviceprovider/tst_qgeoserviceprovider.cpp @@ -67,7 +67,7 @@ void tst_QGeoServiceProvider::tst_availableServiceProvider() // Currently provided plugins if (provider.count() != 8) qWarning() << provider; - QCOMPARE(provider.count(), 8); + QVERIFY(provider.count() >= 8); // these providers are deployed QVERIFY(provider.contains(QStringLiteral("mapbox"))); QVERIFY(provider.contains(QStringLiteral("here"))); diff --git a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp index e4ecfae9..22fb6589 100644 --- a/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp +++ b/tests/auto/qgeotiledmap/tst_qgeotiledmap.cpp @@ -101,7 +101,7 @@ void tst_QGeoTiledMap::initTestCase() QStringLiteral("/../../../plugins")); #endif QVariantMap parameters; - parameters["tileSize"] = 16; + parameters["tileSize"] = 256; parameters["maxZoomLevel"] = 8; parameters["finishRequestImmediately"] = true; QGeoServiceProvider *provider = new QGeoServiceProvider("qmlgeo.test.plugin",parameters); @@ -110,7 +110,7 @@ void tst_QGeoTiledMap::initTestCase() QVERIFY2(provider->error() == QGeoServiceProvider::NoError, "Could not load plugin: " + provider->errorString().toLatin1()); m_map.reset(static_cast<QGeoTiledMapTest*>(mappingManager->createMap(this))); QVERIFY(m_map); - m_map->setViewportSize(QSize(16, 16)); + m_map->setViewportSize(QSize(256, 256)); m_fetcher = static_cast<QGeoTileFetcherTest*>(m_map->m_engine->tileFetcher()); m_tilesCounter.reset(new FetchTileCounter()); connect(m_fetcher, SIGNAL(tileFetched(const QGeoTileSpec&)), m_tilesCounter.data(), SLOT(tileFetched(const QGeoTileSpec&))); |