summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSudarsana Babu Nagineni <sudarsana.babu@mapbox.com>2019-03-06 14:30:23 +0200
committerSudarsana Babu Nagineni <sudarsana.babu@mapbox.com>2019-03-08 17:36:40 +0200
commit744d92e7636ffcba7aea7a302315326b1098d8dc (patch)
tree11df789f9b6dc0913b3d95f1debbfd87c9225a6a /test
parentc6598fc5da063f9b60204639cd619647cbbc89da (diff)
downloadqtlocation-mapboxgl-744d92e7636ffcba7aea7a302315326b1098d8dc.tar.gz
[core] consolidate Axonometric rendering API
Instead of having individual APIs for setting axonometric and skew options, create ProjectionMode struct that holds all the relevant options for Axonometric rendering and introduce setter/getter on the Map for those options.
Diffstat (limited to 'test')
-rw-r--r--test/map/map.test.cpp11
-rw-r--r--test/map/transform.test.cpp11
2 files changed, 22 insertions, 0 deletions
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp
index 6d1650b82c..3a8d05ebb2 100644
--- a/test/map/map.test.cpp
+++ b/test/map/map.test.cpp
@@ -268,6 +268,17 @@ TEST(Map, SetStyleDefaultCamera) {
EXPECT_DOUBLE_EQ(*camera.zoom, 0.5);
}
+TEST(Map, ProjectionMode) {
+ MapTest<> test;
+
+ test.map.setProjectionMode(ProjectionMode().withAxonometric(true).withXSkew(1.0).withYSkew(0.0));
+ auto options = test.map.getProjectionMode();
+
+ EXPECT_TRUE(*options.axonometric);
+ EXPECT_EQ(*options.xSkew, 1.0);
+ EXPECT_EQ(*options.ySkew, 0.0);
+}
+
TEST(Map, SetStyleInvalidJSON) {
Log::setObserver(std::make_unique<FixtureLogObserver>());
diff --git a/test/map/transform.test.cpp b/test/map/transform.test.cpp
index 6e59ca37f3..04b9c1a931 100644
--- a/test/map/transform.test.cpp
+++ b/test/map/transform.test.cpp
@@ -472,6 +472,17 @@ TEST(Transform, Camera) {
ASSERT_DOUBLE_EQ(transform.getLatLng().longitude(), 0);
}
+TEST(Transform, ProjectionMode) {
+ Transform transform;
+
+ transform.setProjectionMode(ProjectionMode().withAxonometric(true).withXSkew(1.0).withYSkew(0.0));
+ auto options = transform.getProjectionMode();
+
+ EXPECT_TRUE(*options.axonometric);
+ EXPECT_EQ(*options.xSkew, 1.0);
+ EXPECT_EQ(*options.ySkew, 0.0);
+}
+
TEST(Transform, IsPanning)
{
Transform transform;