summaryrefslogtreecommitdiff
path: root/test/map
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-06-28 14:36:28 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-06-28 20:59:56 +0300
commit1df45a5e42b8f299d01cea09c9717c5df287f0b7 (patch)
tree50e507df58a0caa32de0636871d1e1c750de112c /test/map
parent433e54e636293eb3b6644c143866aa0d39198441 (diff)
downloadqtlocation-mapboxgl-1df45a5e42b8f299d01cea09c9717c5df287f0b7.tar.gz
[core] Check if frameZoom is NaN in Transform::flyTo callback
Diffstat (limited to 'test/map')
-rw-r--r--test/map/transform.test.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/map/transform.test.cpp b/test/map/transform.test.cpp
index 6d41a868dc..11c2c1cc6b 100644
--- a/test/map/transform.test.cpp
+++ b/test/map/transform.test.cpp
@@ -36,6 +36,11 @@ TEST(Transform, InvalidZoom) {
cameraOptions.center = LatLng { util::LATITUDE_MAX, util::LONGITUDE_MAX };
cameraOptions.zoom = transform.getState().getMaxZoom();
+ // Executing flyTo with an empty size causes frameZoom to be NaN.
+ transform.flyTo(cameraOptions);
+ transform.updateTransitions(transform.getTransitionStart() + transform.getTransitionDuration());
+ ASSERT_DOUBLE_EQ(transform.getZoom(), transform.getState().getMaxZoom());
+
// Executing flyTo with maximum zoom level to the same zoom level causes
// frameZoom to be bigger than maximum zoom.
transform.resize(Size { 100, 100 });