diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/map/snapshotter.test.cpp | 22 | ||||
-rw-r--r-- | test/test-files.json | 1 |
2 files changed, 23 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); +} diff --git a/test/test-files.json b/test/test-files.json index a98e896e7e..293a0804e2 100644 --- a/test/test-files.json +++ b/test/test-files.json @@ -19,6 +19,7 @@ "test/gl/object.test.cpp", "test/map/map.test.cpp", "test/map/prefetch.test.cpp", + "test/map/snapshotter.test.cpp", "test/map/transform.test.cpp", "test/math/clamp.test.cpp", "test/math/minmax.test.cpp", |