summaryrefslogtreecommitdiff
path: root/test/map
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-08-10 16:14:37 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-08-11 22:04:52 +0300
commitbd4441503f364020af286e62bdeb86f4475d5d0a (patch)
treef09f97b1cc9b5f613828613493f2fcd16d5b5c31 /test/map
parent6179e0f9c05d178b2475e54a49568b57d66b68ae (diff)
downloadqtlocation-mapboxgl-bd4441503f364020af286e62bdeb86f4475d5d0a.tar.gz
[test] Added Map.SetStyleDefaultCamera test
Diffstat (limited to 'test/map')
-rw-r--r--test/map/map.test.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp
index 95d652f2af..98f8402706 100644
--- a/test/map/map.test.cpp
+++ b/test/map/map.test.cpp
@@ -160,6 +160,21 @@ TEST(Map, Offline) {
NetworkStatus::Set(NetworkStatus::Status::Online);
}
+TEST(Map, SetStyleDefaultCamera) {
+ MapTest<> test;
+ test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/empty.json"));
+ EXPECT_DOUBLE_EQ(test.map.getZoom(), 0.0);
+ EXPECT_DOUBLE_EQ(test.map.getPitch(), 0.0);
+ EXPECT_DOUBLE_EQ(test.map.getBearing(), 0.0);
+ EXPECT_EQ(test.map.getLatLng(), LatLng {});
+
+ test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/empty-zoomed.json"));
+ EXPECT_DOUBLE_EQ(test.map.getZoom(), 0.0);
+
+ test.map.jumpTo(test.map.getStyle().getDefaultCamera());
+ EXPECT_DOUBLE_EQ(test.map.getZoom(), 0.5);
+}
+
TEST(Map, SetStyleInvalidJSON) {
Log::setObserver(std::make_unique<FixtureLogObserver>());