summaryrefslogtreecommitdiff
path: root/test/map/snapshotter.test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/map/snapshotter.test.cpp')
-rw-r--r--test/map/snapshotter.test.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/map/snapshotter.test.cpp b/test/map/snapshotter.test.cpp
new file mode 100644
index 0000000000..8e6c8a4904
--- /dev/null
+++ b/test/map/snapshotter.test.cpp
@@ -0,0 +1,22 @@
+#include <mbgl/test/util.hpp>
+
+#include <mbgl/map/camera.hpp>
+#include <mbgl/map/map_snapshotter.hpp>
+#include <mbgl/storage/resource_options.hpp>
+#include <mbgl/util/constants.hpp>
+
+using namespace mbgl;
+
+TEST(Snapshotter, Region) {
+ MapSnapshotter snapshotter({true, "{}"}, {256, 256}, 1.0, {}, {}, {}, {});
+
+ LatLngBounds region = LatLngBounds::hull({1.0, -1.0}, {-1.0, 1.0});
+ snapshotter.setRegion(region);
+
+ LatLngBounds region2 = snapshotter.getRegion();
+
+ EXPECT_NEAR(region.south(), region2.south(), 0.0001);
+ EXPECT_NEAR(region.north(), region2.north(), 0.0001);
+ EXPECT_NEAR(region.east(), region2.east(), 0.0001);
+ EXPECT_NEAR(region.west(), region2.west(), 0.0001);
+}