summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAsheem Mamoowala <asheem.mamoowala@mapbox.com>2018-03-08 12:18:59 -0800
committerAsheem Mamoowala <asheem.mamoowala@mapbox.com>2018-03-08 13:49:56 -0800
commit7df451def6c37bd842b13954b91fe8f303ecec9f (patch)
tree89db9e30094b1862faae348be4196c27f5948800 /test
parentc54035afb159826740ebb4c6a69dfe0f1809604f (diff)
downloadqtlocation-mapboxgl-7df451def6c37bd842b13954b91fe8f303ecec9f.tar.gz
[core] TileJSON conversion clamps bounds longitude to [-180,180], per spec
Diffstat (limited to 'test')
-rw-r--r--test/style/conversion/tileset.test.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/style/conversion/tileset.test.cpp b/test/style/conversion/tileset.test.cpp
index 9487277cca..f10aa0e318 100644
--- a/test/style/conversion/tileset.test.cpp
+++ b/test/style/conversion/tileset.test.cpp
@@ -62,6 +62,16 @@ TEST(Tileset, ValidWorldBounds) {
EXPECT_EQ(converted->bounds, LatLngBounds::hull({90, -180}, {-90, 180}));
}
+TEST(Tileset, BoundsAreClamped) {
+ Error error;
+ mbgl::optional<Tileset> converted = convertJSON<Tileset>(R"JSON({
+ "tiles": ["http://mytiles"],
+ "bounds": [-181.0000005,-90,180.00000000000006,90]
+ })JSON", error);
+ EXPECT_TRUE((bool) converted);
+ EXPECT_EQ(converted->bounds, LatLngBounds::hull({90, -180}, {-90, 180}));
+}
+
TEST(Tileset, FullConversion) {
Error error;
Tileset converted = *convertJSON<Tileset>(R"JSON({