summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2019-02-19 23:11:50 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2019-02-26 21:17:31 +0200
commit7d407175e03c129e4361af871ed4d43f138ab337 (patch)
tree27bcdc7c6be1047844e7f03d69455313894cdfa9 /test
parentfab0dd4f008dccd5c27b33ac0cd26968f66ea2b9 (diff)
downloadqtlocation-mapboxgl-7d407175e03c129e4361af871ed4d43f138ab337.tar.gz
[core] Ensure 'isPanning' is true when panning a full round
Diffstat (limited to 'test')
-rw-r--r--test/map/transform.test.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/map/transform.test.cpp b/test/map/transform.test.cpp
index eb511a82da..7e98863400 100644
--- a/test/map/transform.test.cpp
+++ b/test/map/transform.test.cpp
@@ -468,6 +468,23 @@ TEST(Transform, Camera) {
ASSERT_DOUBLE_EQ(transform.getLatLng().longitude(), 0);
}
+TEST(Transform, IsPanning)
+{
+ Transform transform;
+
+ AnimationOptions easeOptions(Seconds(1));
+ easeOptions.transitionFrameFn = [&transform](double) {
+ ASSERT_TRUE(transform.getState().isPanning());
+ };
+
+ transform.resize({ 1000, 1000 });
+ transform.easeTo(CameraOptions().withCenter(LatLng(0, 360.0)), easeOptions);
+ transform.updateTransitions(transform.getTransitionStart() + Milliseconds(250));
+ transform.updateTransitions(transform.getTransitionStart() + Milliseconds(500));
+ transform.updateTransitions(transform.getTransitionStart() + Milliseconds(750));
+ transform.updateTransitions(transform.getTransitionStart() + transform.getTransitionDuration());
+}
+
TEST(Transform, DefaultTransform) {
struct TransformObserver : public mbgl::MapObserver {
void onCameraWillChange(MapObserver::CameraChangeMode) final {