summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-03-20 17:32:06 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-03-20 18:25:04 +0200
commit24198ebca86cbe1329a1854f080e3f4638973142 (patch)
tree43447ee32faff421349706b8251d10d90fc9bc2b /test
parentf846205eb68e9508a0d80259008cf9adb8069a1b (diff)
downloadqtlocation-mapboxgl-24198ebca86cbe1329a1854f080e3f4638973142.tar.gz
[core] Expose Source::getZoomRange
Diffstat (limited to 'test')
-rw-r--r--test/style/source.test.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/style/source.test.cpp b/test/style/source.test.cpp
index fb7737e417..feb7b6b05a 100644
--- a/test/style/source.test.cpp
+++ b/test/style/source.test.cpp
@@ -19,6 +19,7 @@
#include <mbgl/style/update_parameters.hpp>
#include <mbgl/style/layers/line_layer.hpp>
#include <mbgl/annotation/annotation_manager.hpp>
+#include <mbgl/annotation/annotation_source.hpp>
#include <mapbox/geojsonvt.hpp>
@@ -65,6 +66,29 @@ public:
}
};
+TEST(Source, DefaultZoomRange) {
+ VectorSource vectorSource("vectorSource", "url");
+ vectorSource.baseImpl->loaded = true;
+ EXPECT_EQ(vectorSource.getZoomRange().min, 0u);
+ EXPECT_EQ(vectorSource.getZoomRange().max, 22u);
+
+ GeoJSONSource geojsonSource("source");
+ geojsonSource.baseImpl->loaded = true;
+ EXPECT_EQ(geojsonSource.getZoomRange().min, 0u);
+ EXPECT_EQ(geojsonSource.getZoomRange().max, 18u);
+
+ Tileset tileset;
+ RasterSource rasterSource("source", tileset, 512);
+ rasterSource.baseImpl->loaded = true;
+ EXPECT_EQ(rasterSource.getZoomRange().min, 0u);
+ EXPECT_EQ(rasterSource.getZoomRange().max, 22u);
+ EXPECT_EQ(rasterSource.getZoomRange(), tileset.zoomRange);
+
+ AnnotationSource annotationSource;
+ EXPECT_EQ(annotationSource.getZoomRange().min, 0u);
+ EXPECT_EQ(annotationSource.getZoomRange().max, 22u);
+}
+
TEST(Source, LoadingFail) {
SourceTest test;