summaryrefslogtreecommitdiff
path: root/test/tile
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2018-11-29 12:50:10 -0800
committerChris Loer <chris.loer@mapbox.com>2018-11-30 12:30:50 -0800
commitf87ef3f72a6f2beda88bdc25dfbdeb169332603b (patch)
tree101a34d7ba78467ced9d9fdaa516717a2e6c6d87 /test/tile
parent01510619474d109e8eb80a4e328758007850dc72 (diff)
downloadqtlocation-mapboxgl-f87ef3f72a6f2beda88bdc25dfbdeb169332603b.tar.gz
[core] OverscaledTileID::isChildOf should check wrap values.
Fixes issue #13478
Diffstat (limited to 'test/tile')
-rw-r--r--test/tile/tile_id.test.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/tile/tile_id.test.cpp b/test/tile/tile_id.test.cpp
index 2f328b78d7..f2de13653f 100644
--- a/test/tile/tile_id.test.cpp
+++ b/test/tile/tile_id.test.cpp
@@ -186,6 +186,7 @@ TEST(TileID, Overscaled) {
EXPECT_TRUE(OverscaledTileID(4, 2, 3).isChildOf(OverscaledTileID(3, 1, 1)));
EXPECT_TRUE(OverscaledTileID(5, 0, { 4, 2, 3 }).isChildOf(OverscaledTileID(3, 1, 1)));
EXPECT_TRUE(OverscaledTileID(6, 0, { 4, 2, 3 }).isChildOf(OverscaledTileID(3, 1, 1)));
+ EXPECT_FALSE(OverscaledTileID(6, -1, { 4, 2, 3 }).isChildOf(OverscaledTileID(3, 1, 1)));
EXPECT_TRUE(OverscaledTileID(7, 0, { 4, 2, 3 }).isChildOf(OverscaledTileID(3, 1, 1)));
EXPECT_FALSE(OverscaledTileID(2, 0, 0).isChildOf(OverscaledTileID(5, 0, { 4, 2, 3 })));
@@ -194,6 +195,7 @@ TEST(TileID, Overscaled) {
EXPECT_FALSE(OverscaledTileID(5, 0, { 4, 2, 3 }).isChildOf(OverscaledTileID(5, 0, { 4, 2, 3 })));
EXPECT_TRUE(OverscaledTileID(6, 0, { 4, 2, 3 }).isChildOf(OverscaledTileID(5, 0, { 4, 2, 3 })));
EXPECT_TRUE(OverscaledTileID(7, 0, { 4, 2, 3 }).isChildOf(OverscaledTileID(5, 0, { 4, 2, 3 })));
+ EXPECT_FALSE(OverscaledTileID(7, 1, { 4, 2, 3 }).isChildOf(OverscaledTileID(5, 0, { 4, 2, 3 })));
EXPECT_FALSE(OverscaledTileID(2, 0, 0).isChildOf(OverscaledTileID(6, 0, { 4, 2, 3 })));
EXPECT_FALSE(OverscaledTileID(3, 1, 1).isChildOf(OverscaledTileID(6, 0, { 4, 2, 3 })));
@@ -201,7 +203,8 @@ TEST(TileID, Overscaled) {
EXPECT_FALSE(OverscaledTileID(5, 0, { 4, 2, 3 }).isChildOf(OverscaledTileID(6, 0, { 4, 2, 3 })));
EXPECT_FALSE(OverscaledTileID(6, 0, { 4, 2, 3 }).isChildOf(OverscaledTileID(6, 0, { 4, 2, 3 })));
EXPECT_TRUE(OverscaledTileID(7, 0, { 4, 2, 3 }).isChildOf(OverscaledTileID(6, 0, { 4, 2, 3 })));
-
+ EXPECT_FALSE(OverscaledTileID(7, 0, { 4, 2, 3 }).isChildOf(OverscaledTileID(6, -1, { 4, 2, 3 })));
+
EXPECT_FALSE(OverscaledTileID(2, 0, 0).isChildOf(OverscaledTileID(5, 0, { 4, 0, 0 })));
EXPECT_FALSE(OverscaledTileID(3, 1, 1).isChildOf(OverscaledTileID(5, 0, { 4, 0, 0 })));
EXPECT_FALSE(OverscaledTileID(4, 2, 3).isChildOf(OverscaledTileID(5, 0, { 4, 0, 0 })));