diff options
author | Peng Liu <peng.liu@mapbox.com> | 2020-01-07 16:10:53 +0200 |
---|---|---|
committer | Peng Liu <peng.liu@mapbox.com> | 2020-01-07 16:22:15 +0200 |
commit | c1ec9635335848900f89b2898b48f3faa9963ae3 (patch) | |
tree | ae5a1bd60d3d2dfd5525e3e11bee01b3da242da6 /test | |
parent | adb68b52f0b6b9065fb1bcd35f09630eb50525eb (diff) | |
download | qtlocation-mapboxgl-upstream/peng-get-visibile-coordinate-bounds.tar.gz |
Move API breaking changes to a new method name latLngBoundsForCameraUnwrapped.upstream/peng-get-visibile-coordinate-bounds
Diffstat (limited to 'test')
-rw-r--r-- | test/map/map.test.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp index e75fdf06da..a0cd64bdd5 100644 --- a/test/map/map.test.cpp +++ b/test/map/map.test.cpp @@ -252,7 +252,7 @@ TEST(Map, CameraToLatLngBounds) { ASSERT_NEAR(camera.center->longitude(), virtualCamera.center->longitude(), 1e-7); } -TEST(Map, CameraToLatLngBoundsWithRotation) { +TEST(Map, CameraToLatLngBoundsUnwrappedWithRotation) { MapTest<> test; test.map.jumpTo(CameraOptions().withCenter(LatLng{45, 90}).withZoom(16.0).withBearing(45.0)); @@ -261,16 +261,18 @@ TEST(Map, CameraToLatLngBoundsWithRotation) { CameraOptions camera = test.map.getCameraOptions(); - ASSERT_TRUE(test.map.latLngBoundsForCamera(camera).contains(test.map.latLngForPixel({}))); - ASSERT_TRUE(test.map.latLngBoundsForCamera(camera).contains(test.map.latLngForPixel({0.0, double(size.height)}))); - ASSERT_TRUE(test.map.latLngBoundsForCamera(camera).contains(test.map.latLngForPixel({double(size.width), 0.0}))); - ASSERT_TRUE(test.map.latLngBoundsForCamera(camera).contains( + ASSERT_TRUE(test.map.latLngBoundsForCameraUnwrapped(camera).contains(test.map.latLngForPixel({}))); + ASSERT_TRUE( + test.map.latLngBoundsForCameraUnwrapped(camera).contains(test.map.latLngForPixel({0.0, double(size.height)}))); + ASSERT_TRUE( + test.map.latLngBoundsForCameraUnwrapped(camera).contains(test.map.latLngForPixel({double(size.width), 0.0}))); + ASSERT_TRUE(test.map.latLngBoundsForCameraUnwrapped(camera).contains( test.map.latLngForPixel({double(size.width), double(size.height)}))); - ASSERT_TRUE(test.map.latLngBoundsForCamera(camera).contains( + ASSERT_TRUE(test.map.latLngBoundsForCameraUnwrapped(camera).contains( test.map.latLngForPixel({double(size.width) / 2, double(size.height) / 2}))); } -TEST(Map, CameraToLatLngBoundsCrossDateLine) { +TEST(Map, CameraToLatLngBoundsUnwrappedCrossDateLine) { MapTest<> test; test.map.jumpTo(CameraOptions().withCenter(LatLng{0, 180}).withZoom(16.0)); @@ -279,17 +281,17 @@ TEST(Map, CameraToLatLngBoundsCrossDateLine) { CameraOptions camera = test.map.getCameraOptions(); - ASSERT_TRUE(test.map.latLngBoundsForCamera(camera).contains(test.map.latLngForPixel({}), LatLng::Wrapped)); - ASSERT_TRUE(test.map.latLngBoundsForCamera(camera).contains(test.map.latLngForPixel({0.0, double(size.height)}), - LatLng::Wrapped)); - ASSERT_TRUE(test.map.latLngBoundsForCamera(camera).contains(test.map.latLngForPixel({double(size.width), 0.0}), - LatLng::Wrapped)); - ASSERT_TRUE(test.map.latLngBoundsForCamera(camera).contains( + ASSERT_TRUE(test.map.latLngBoundsForCameraUnwrapped(camera).contains(test.map.latLngForPixel({}), LatLng::Wrapped)); + ASSERT_TRUE(test.map.latLngBoundsForCameraUnwrapped(camera).contains( + test.map.latLngForPixel({0.0, double(size.height)}), LatLng::Wrapped)); + ASSERT_TRUE(test.map.latLngBoundsForCameraUnwrapped(camera).contains( + test.map.latLngForPixel({double(size.width), 0.0}), LatLng::Wrapped)); + ASSERT_TRUE(test.map.latLngBoundsForCameraUnwrapped(camera).contains( test.map.latLngForPixel({double(size.width), double(size.height)}), LatLng::Wrapped)); - ASSERT_TRUE(test.map.latLngBoundsForCamera(camera).contains( + ASSERT_TRUE(test.map.latLngBoundsForCameraUnwrapped(camera).contains( test.map.latLngForPixel({double(size.width) / 2, double(size.height) / 2}))); - ASSERT_TRUE(test.map.latLngBoundsForCamera(camera).crossesAntimeridian()); + ASSERT_TRUE(test.map.latLngBoundsForCameraUnwrapped(camera).crossesAntimeridian()); } TEST(Map, Offline) { |