summaryrefslogtreecommitdiff
path: root/test/map/snapshotter.test.cpp
blob: 8e6c8a4904438ef1e359eac823f52b8caff7d558 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
}