summaryrefslogtreecommitdiff
path: root/test/map/map.test.cpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2019-03-01 09:58:58 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2019-03-04 14:45:32 +0200
commitba7427b4acf116aca7451ad3a6067dc234d3fa70 (patch)
tree106462886345e60f47bdeeaaf46580c67987b064 /test/map/map.test.cpp
parent73ac3c784fe755650dc631e2e722a47890981248 (diff)
downloadqtlocation-mapboxgl-ba7427b4acf116aca7451ad3a6067dc234d3fa70.tar.gz
[core] Transform{State}: s/angle/bearing/
Diffstat (limited to 'test/map/map.test.cpp')
-rw-r--r--test/map/map.test.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp
index da3abfcb24..1b64e48614 100644
--- a/test/map/map.test.cpp
+++ b/test/map/map.test.cpp
@@ -64,7 +64,7 @@ TEST(Map, RendererState) {
double bearingInDegrees = 30.0;
test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/empty.json"));
- test.map.jumpTo(CameraOptions().withCenter(coordinate).withZoom(zoom).withPitch(pitchInDegrees).withAngle(bearingInDegrees));
+ test.map.jumpTo(CameraOptions().withCenter(coordinate).withZoom(zoom).withPitch(pitchInDegrees).withBearing(bearingInDegrees));
test.runLoop.runOnce();
test.frontend.render(test.map);
@@ -75,7 +75,7 @@ TEST(Map, RendererState) {
EXPECT_NEAR(options.center->longitude(), coordinate.longitude(), 1e-7);
ASSERT_DOUBLE_EQ(*options.zoom, zoom);
ASSERT_DOUBLE_EQ(*options.pitch, pitchInDegrees);
- EXPECT_NEAR(*options.angle, bearingInDegrees, 1e-7);
+ EXPECT_NEAR(*options.bearing, bearingInDegrees, 1e-7);
{
const LatLng& latLng = test.frontend.latLngForPixel(ScreenCoordinate { 0, 0 });
@@ -148,7 +148,7 @@ TEST(Map, LatLngBoundsToCamera) {
EXPECT_NEAR(*virtualCamera.zoom, 1.55467, 1e-5);
}
-TEST(Map, LatLngBoundsToCameraWithAngle) {
+TEST(Map, LatLngBoundsToCameraWithBearing) {
MapTest<> test;
test.map.jumpTo(CameraOptions().withCenter(LatLng { 40.712730, -74.005953 }).withZoom(16.0));
@@ -158,10 +158,10 @@ TEST(Map, LatLngBoundsToCameraWithAngle) {
CameraOptions virtualCamera = test.map.cameraForLatLngBounds(bounds, {}, 35.0);
ASSERT_TRUE(bounds.contains(*virtualCamera.center));
EXPECT_NEAR(*virtualCamera.zoom, 1.21385, 1e-5);
- EXPECT_NEAR(virtualCamera.angle.value_or(0), 35.0, 1e-5);
+ EXPECT_NEAR(virtualCamera.bearing.value_or(0), 35.0, 1e-5);
}
-TEST(Map, LatLngBoundsToCameraWithAngleAndPitch) {
+TEST(Map, LatLngBoundsToCameraWithBearingAndPitch) {
MapTest<> test;
test.map.jumpTo(CameraOptions().withCenter(LatLng { 40.712730, -74.005953 }).withZoom(16.0));
@@ -172,7 +172,7 @@ TEST(Map, LatLngBoundsToCameraWithAngleAndPitch) {
ASSERT_TRUE(bounds.contains(*virtualCamera.center));
EXPECT_NEAR(*virtualCamera.zoom, 13.66272, 1e-5);
ASSERT_DOUBLE_EQ(*virtualCamera.pitch, 20.0);
- EXPECT_NEAR(virtualCamera.angle.value_or(0), 35.0, 1e-5);
+ EXPECT_NEAR(virtualCamera.bearing.value_or(0), 35.0, 1e-5);
}
TEST(Map, LatLngsToCamera) {
@@ -181,19 +181,19 @@ TEST(Map, LatLngsToCamera) {
std::vector<LatLng> latLngs{{ 40.712730, 74.005953 }, {15.68169,73.499857}, {30.82678, 83.4082}};
CameraOptions virtualCamera = test.map.cameraForLatLngs(latLngs, {}, 23.0);
- EXPECT_NEAR(virtualCamera.angle.value_or(0), 23.0, 1e-5);
+ EXPECT_NEAR(virtualCamera.bearing.value_or(0), 23.0, 1e-5);
EXPECT_NEAR(virtualCamera.zoom.value_or(0), 2.75434, 1e-5);
EXPECT_NEAR(virtualCamera.center->latitude(), 28.49288, 1e-5);
EXPECT_NEAR(virtualCamera.center->longitude(), 74.97437, 1e-5);
}
-TEST(Map, LatLngsToCameraWithAngleAndPitch) {
+TEST(Map, LatLngsToCameraWithBearingAndPitch) {
MapTest<> test;
std::vector<LatLng> latLngs{{ 40.712730, 74.005953 }, {15.68169,73.499857}, {30.82678, 83.4082}};
CameraOptions virtualCamera = test.map.cameraForLatLngs(latLngs, {}, 23, 20);
- EXPECT_NEAR(virtualCamera.angle.value_or(0), 23.0, 1e-5);
+ EXPECT_NEAR(virtualCamera.bearing.value_or(0), 23.0, 1e-5);
EXPECT_NEAR(virtualCamera.zoom.value_or(0), 3.04378, 1e-5);
EXPECT_NEAR(virtualCamera.center->latitude(), 28.53718, 1e-5);
EXPECT_NEAR(virtualCamera.center->longitude(), 74.31746, 1e-5);
@@ -256,7 +256,7 @@ TEST(Map, SetStyleDefaultCamera) {
CameraOptions camera = test.map.getCameraOptions();
EXPECT_DOUBLE_EQ(*camera.zoom, 0.0);
EXPECT_DOUBLE_EQ(*camera.pitch, 0.0);
- EXPECT_DOUBLE_EQ(*camera.angle, 0.0);
+ EXPECT_DOUBLE_EQ(*camera.bearing, 0.0);
EXPECT_EQ(*camera.center, LatLng {});
test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/empty-zoomed.json"));