summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-09-15 16:51:38 +0200
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-04-12 14:49:10 +0000
commitb21c33a3278260df469175a3ce08447b7a3dc47c (patch)
treedd8d0592cf388d8f71063b400d5013d3d68a761f /tests
parent5779661ba629eff1ffaf3a38c842b74250100bb1 (diff)
downloadqtlocation-b21c33a3278260df469175a3ce08447b7a3dc47c.tar.gz
Improve QGeoPath::path documentation and add autotestsv5.11.0-beta4
Change-Id: I8359c79f114abd0006012098cc154695013e0512 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative_geoshape/tst_locationsingleton.qml39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/auto/declarative_geoshape/tst_locationsingleton.qml b/tests/auto/declarative_geoshape/tst_locationsingleton.qml
index 6ebee62a..645aedb6 100644
--- a/tests/auto/declarative_geoshape/tst_locationsingleton.qml
+++ b/tests/auto/declarative_geoshape/tst_locationsingleton.qml
@@ -228,6 +228,10 @@ Item {
]
}
+ MapPolyline {
+ id: mapPolylineGeopath
+ }
+
TestCase {
name: "MapPolyline path"
function test_path_operations() {
@@ -274,4 +278,39 @@ Item {
compare(mapPolyline.path.length, mapPolyline.pathLength())
}
}
+
+ TestCase {
+ name: "GeoPath path"
+ function test_qgeopath_path_operations() {
+ var geopath = QtPositioning.path()
+
+ geopath.path = trace2
+ compare(geopath.path.length, trace2.length)
+
+ geopath.path = mapPolyline.path
+ compare(geopath.path.length, mapPolyline.pathLength())
+ compare(geopath.boundingGeoRectangle(), mapPolyline.geoShape.boundingGeoRectangle())
+
+ mapPolylineGeopath.path = mapPolyline.path
+ compare(mapPolylineGeopath.pathLength(), mapPolyline.pathLength())
+ compare(mapPolylineGeopath.geoShape.boundingGeoRectangle(), mapPolyline.geoShape.boundingGeoRectangle())
+
+ try {
+ var err = false;
+ mapPolylineGeopath.geoShape = geopath
+ } catch (e) {
+ if (e.message != 'Cannot assign to read-only property "geoShape"')
+ fail('Expected Cannot assign to read-only property "geoShape", got: ' + e.message);
+ err = true;
+ } finally {
+ verify(err, 'should throw Cannot assign to read-only property "geoShape"');
+ }
+
+ geopath.path = trace2
+ geopath.path[0].longitude = 11.0
+ compare(geopath.path.length, trace2.length)
+ compare(geopath.coordinateAt(0).latitude, trace2[0].latitude)
+ compare(geopath.coordinateAt(0).longitude, 11) // This fails
+ }
+ }
}