summaryrefslogtreecommitdiff
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/declarative_ui/tst_map.qml15
-rw-r--r--tests/auto/geotestplugin/qgeotiledmap_test.cpp3
2 files changed, 10 insertions, 8 deletions
diff --git a/tests/auto/declarative_ui/tst_map.qml b/tests/auto/declarative_ui/tst_map.qml
index 2d35fce0..6051a48e 100644
--- a/tests/auto/declarative_ui/tst_map.qml
+++ b/tests/auto/declarative_ui/tst_map.qml
@@ -239,6 +239,7 @@ Item {
compare(mapPar.mapParameters.length, 1)
+ // Using toCoordinate, below, to verify the actual value of the center, and not what is in the map.center property
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)
@@ -253,19 +254,21 @@ Item {
fuzzyCompare(center.latitude, -33, 0.1)
fuzzyCompare(center.longitude, -47, 0.1)
- testParameter.center = mapPar.center // map.center has not been affected as it lives in the Declarative Map
+ testParameter.center = mapPar.center // map.center has been affected as the Declarative Map has received the QGeoMap::cameraDataChanged signal
mapPar.addMapParameter(testParameter)
compare(mapPar.mapParameters.length, 1)
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)
+ fuzzyCompare(center.latitude, -33, 0.1)
+ fuzzyCompare(center.longitude, -47, 0.1)
- testParameter.center = QtPositioning.coordinate(-33.0, -47.0)
+ testParameter.center = QtPositioning.coordinate(-30.0, -40.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)
+ fuzzyCompare(center.latitude, -30, 0.1)
+ fuzzyCompare(center.longitude, -40, 0.1)
+ fuzzyCompare(mapPar.center.latitude, -30, 0.1)
+ fuzzyCompare(mapPar.center.longitude, -40, 0.1)
mapPar.removeMapParameter(testParameter)
compare(mapPar.mapParameters.length, 0)
diff --git a/tests/auto/geotestplugin/qgeotiledmap_test.cpp b/tests/auto/geotestplugin/qgeotiledmap_test.cpp
index 62abb313..c3d466ea 100644
--- a/tests/auto/geotestplugin/qgeotiledmap_test.cpp
+++ b/tests/auto/geotestplugin/qgeotiledmap_test.cpp
@@ -98,9 +98,8 @@ QGeoTiledMapTest::QGeoTiledMapTest(QGeoTiledMappingManagerEngine *engine,
void QGeoTiledMapTest::onCameraCenter_testChanged(QGeoMapParameter *param, const char *propertyName)
{
- Q_D(QGeoTiledMapTest);
if (strcmp(propertyName, "center") == 0) {
- QGeoCameraData cameraData = d->m_cameraData;
+ QGeoCameraData cameraData = this->cameraData();
// Not testing for propertyName as this param has only one allowed property
QGeoCoordinate newCenter = param->property(propertyName).value<QGeoCoordinate>();
cameraData.setCenter(newCenter);