diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2018-03-08 12:35:33 -0800 |
---|---|---|
committer | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2018-03-09 12:00:12 -0800 |
commit | a57be420b0a90760d505d8e1df3e0d42ac1aa10d (patch) | |
tree | 7e377c3de99610a1f4c9ee7f2b448f89922aada4 /test | |
parent | 8a3deab73373c8f3182e4337a3619ebcc58ecc2c (diff) | |
download | qtlocation-mapboxgl-a57be420b0a90760d505d8e1df3e0d42ac1aa10d.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.cpp | 10 |
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({ |