diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-02-10 16:22:10 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-02-10 16:25:47 -0800 |
commit | 20be32f217b860bb0b5af3b32cea2d928b091d29 (patch) | |
tree | ca167e3dfebee2fce67046bb80781b530e8961f6 /test/storage | |
parent | 7e287cae1b13354c202cb419c945f2883dbe0601 (diff) | |
download | qtlocation-mapboxgl-20be32f217b860bb0b5af3b32cea2d928b091d29.tar.gz |
[core] Always store tiles without ratio support with ratio = 1
Diffstat (limited to 'test/storage')
-rw-r--r-- | test/storage/resource.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/test/storage/resource.cpp b/test/storage/resource.cpp index 30c1597df2..0b04c1b3e4 100644 --- a/test/storage/resource.cpp +++ b/test/storage/resource.cpp @@ -18,14 +18,24 @@ TEST(Resource, Source) { TEST(Resource, Tile) { using namespace mbgl; - Resource resource = Resource::tile("http://example.com/{z}/{x}/{y}{ratio}.png", 2.0, 1, 2, 3); - EXPECT_EQ(Resource::Kind::Tile, resource.kind); - EXPECT_EQ("http://example.com/3/1/2@2x.png", resource.url); - EXPECT_EQ("http://example.com/{z}/{x}/{y}{ratio}.png", resource.tileData->urlTemplate); - EXPECT_EQ(2.0, resource.tileData->pixelRatio); - EXPECT_EQ(1, resource.tileData->x); - EXPECT_EQ(2, resource.tileData->y); - EXPECT_EQ(3, resource.tileData->z); + + Resource rasterTile = Resource::tile("http://example.com/{z}/{x}/{y}{ratio}.png", 2.0, 1, 2, 3); + EXPECT_EQ(Resource::Kind::Tile, rasterTile.kind); + EXPECT_EQ("http://example.com/3/1/2@2x.png", rasterTile.url); + EXPECT_EQ("http://example.com/{z}/{x}/{y}{ratio}.png", rasterTile.tileData->urlTemplate); + EXPECT_EQ(2, rasterTile.tileData->pixelRatio); + EXPECT_EQ(1, rasterTile.tileData->x); + EXPECT_EQ(2, rasterTile.tileData->y); + EXPECT_EQ(3, rasterTile.tileData->z); + + Resource vectorTile = Resource::tile("http://example.com/{z}/{x}/{y}.mvt", 2.0, 1, 2, 3); + EXPECT_EQ(Resource::Kind::Tile, vectorTile.kind); + EXPECT_EQ("http://example.com/3/1/2.mvt", vectorTile.url); + EXPECT_EQ("http://example.com/{z}/{x}/{y}.mvt", vectorTile.tileData->urlTemplate); + EXPECT_EQ(1, vectorTile.tileData->pixelRatio); + EXPECT_EQ(1, vectorTile.tileData->x); + EXPECT_EQ(2, vectorTile.tileData->y); + EXPECT_EQ(3, vectorTile.tileData->z); } TEST(Resource, Glyphs) { |