diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-08-24 10:47:30 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-08-24 10:47:30 -0700 |
commit | 0451aca37e866c3380072b114e2d49353888e4b5 (patch) | |
tree | 899dcf40ef2ea0f51e25640556548d63cad60a21 /test | |
parent | e42e3ea3a00fd7d74ff73b955ebcb8d202362088 (diff) | |
parent | e97662972fef0e56132a03f2c2510c0da8537aad (diff) | |
download | qtlocation-mapboxgl-0451aca37e866c3380072b114e2d49353888e4b5.tar.gz |
Merge branch 'v8'
Diffstat (limited to 'test')
23 files changed, 128 insertions, 21 deletions
diff --git a/test/fixtures/api/water.json b/test/fixtures/api/water.json index 2bcce11992..c969b345ae 100644 --- a/test/fixtures/api/water.json +++ b/test/fixtures/api/water.json @@ -1,5 +1,5 @@ { - "version": 7, + "version": 8, "name": "Water", "sources": { "mapbox": { diff --git a/test/fixtures/headless/pois.json b/test/fixtures/headless/pois.json index 7a4488608a..a7fcfdb9dc 100644 --- a/test/fixtures/headless/pois.json +++ b/test/fixtures/headless/pois.json @@ -1,5 +1,5 @@ { - "version": 7, + "version": 8, "name": "POIs", "sources": { "mapbox": { diff --git a/test/fixtures/resources/style.json b/test/fixtures/resources/style.json index fb67afc662..fc5f9c973b 100644 --- a/test/fixtures/resources/style.json +++ b/test/fixtures/resources/style.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 8, "name": "Test", "sources": { "vectorsource": { @@ -20,7 +20,7 @@ "source": "vectorsource", "source-layer": "road_label", "layout": { - "text-font": "Open Sans Regular, Arial Unicode MS Regular", + "text-font": ["Open Sans Regular", "Arial Unicode MS Regular"], "text-field": "{name_en}" } }, { @@ -29,7 +29,7 @@ "source": "vectorsource", "source-layer": "poi_label", "layout": { - "text-font": "Open Sans Regular, Arial Unicode MS Regular", + "text-font": ["Open Sans Regular", "Arial Unicode MS Regular"], "icon-image": "{maki}_icon" } }] diff --git a/test/fixtures/style_parser/circle-blur.info.json b/test/fixtures/style_parser/circle-blur.info.json new file mode 100644 index 0000000000..397e4cd4d1 --- /dev/null +++ b/test/fixtures/style_parser/circle-blur.info.json @@ -0,0 +1,7 @@ +{ + "default": { + "log": [ + [1, "WARNING", "ParseStyle", "value of 'circle-blur' must be a number, or a number function"] + ] + } +} diff --git a/test/fixtures/style_parser/circle-blur.style.json b/test/fixtures/style_parser/circle-blur.style.json new file mode 100644 index 0000000000..8140ad5e47 --- /dev/null +++ b/test/fixtures/style_parser/circle-blur.style.json @@ -0,0 +1,18 @@ +{ + "version": 8, + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxzoom": 14 + } + }, + "layers": [{ + "id": "circle_blur_example", + "type": "circle", + "source": "mapbox", + "paint": { + "circle-blur": null + } + }] +} diff --git a/test/fixtures/style_parser/circle-color.info.json b/test/fixtures/style_parser/circle-color.info.json new file mode 100644 index 0000000000..b1708c2f05 --- /dev/null +++ b/test/fixtures/style_parser/circle-color.info.json @@ -0,0 +1,7 @@ +{ + "default": { + "log": [ + [1, "WARNING", "ParseStyle", "color value must be a string"] + ] + } +} diff --git a/test/fixtures/style_parser/circle-color.style.json b/test/fixtures/style_parser/circle-color.style.json new file mode 100644 index 0000000000..44c32f99ce --- /dev/null +++ b/test/fixtures/style_parser/circle-color.style.json @@ -0,0 +1,18 @@ +{ + "version": 8, + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxzoom": 14 + } + }, + "layers": [{ + "id": "circle_color_example", + "type": "circle", + "source": "mapbox", + "paint": { + "circle-color": null + } + }] +} diff --git a/test/fixtures/style_parser/circle-opacity.info.json b/test/fixtures/style_parser/circle-opacity.info.json new file mode 100644 index 0000000000..3e8662bdbe --- /dev/null +++ b/test/fixtures/style_parser/circle-opacity.info.json @@ -0,0 +1,7 @@ +{ + "default": { + "log": [ + [1, "WARNING", "ParseStyle", "value of 'circle-opacity' must be a number, or a number function"] + ] + } +} diff --git a/test/fixtures/style_parser/circle-opacity.style.json b/test/fixtures/style_parser/circle-opacity.style.json new file mode 100644 index 0000000000..601e81a51b --- /dev/null +++ b/test/fixtures/style_parser/circle-opacity.style.json @@ -0,0 +1,18 @@ +{ + "version": 8, + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxzoom": 14 + } + }, + "layers": [{ + "id": "circle_opacity_example", + "type": "circle", + "source": "mapbox", + "paint": { + "circle-opacity": null + } + }] +} diff --git a/test/fixtures/style_parser/circle-radius.info.json b/test/fixtures/style_parser/circle-radius.info.json new file mode 100644 index 0000000000..7e87aa4fdb --- /dev/null +++ b/test/fixtures/style_parser/circle-radius.info.json @@ -0,0 +1,7 @@ +{ + "default": { + "log": [ + [1, "WARNING", "ParseStyle", "value of 'circle-radius' must be a number, or a number function"] + ] + } +} diff --git a/test/fixtures/style_parser/circle-radius.style.json b/test/fixtures/style_parser/circle-radius.style.json new file mode 100644 index 0000000000..a7fb28b2d3 --- /dev/null +++ b/test/fixtures/style_parser/circle-radius.style.json @@ -0,0 +1,18 @@ +{ + "version": 8, + "sources": { + "mapbox": { + "type": "vector", + "url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v5", + "maxzoom": 14 + } + }, + "layers": [{ + "id": "circle_radius_example", + "type": "circle", + "source": "mapbox", + "paint": { + "circle-radius": null + } + }] +} diff --git a/test/fixtures/style_parser/colors.style.json b/test/fixtures/style_parser/colors.style.json index 24aa2e5d1c..8996548885 100644 --- a/test/fixtures/style_parser/colors.style.json +++ b/test/fixtures/style_parser/colors.style.json @@ -1,5 +1,5 @@ { - "version": 6, + "version": 8, "constants": { "@land": "r44,239,225)", "@snow": "f4f8foNGbjf#", diff --git a/test/fixtures/style_parser/function-numeric.style.json b/test/fixtures/style_parser/function-numeric.style.json index 2db5624ac9..f3fca7e1d0 100644 --- a/test/fixtures/style_parser/function-numeric.style.json +++ b/test/fixtures/style_parser/function-numeric.style.json @@ -1,5 +1,5 @@ { - "version": 6, + "version": 8, "sources": { "mapbox": { "type": "vector", diff --git a/test/fixtures/style_parser/function-string-bool-enum.style.json b/test/fixtures/style_parser/function-string-bool-enum.style.json index c38f195259..0447990911 100644 --- a/test/fixtures/style_parser/function-string-bool-enum.style.json +++ b/test/fixtures/style_parser/function-string-bool-enum.style.json @@ -1,5 +1,5 @@ { - "version": 6, + "version": 8, "sources": { "mapbox": { "type": "vector", @@ -31,7 +31,7 @@ "source-layer": "waterway", "layout": { "text-font": { - "stops": [[0, "Open Sans Regular"]] + "stops": [[0, ["Open Sans Regular"]]] }, "text-keep-upright": { "stops": [[0, false], [10, true]] diff --git a/test/fixtures/style_parser/function-type.style.json b/test/fixtures/style_parser/function-type.style.json index c992e71f04..cde8dfc76b 100644 --- a/test/fixtures/style_parser/function-type.style.json +++ b/test/fixtures/style_parser/function-type.style.json @@ -1,5 +1,5 @@ { - "version": 6, + "version": 8, "sources": { "mapbox": { "type": "vector", diff --git a/test/fixtures/style_parser/line-opacity.style.json b/test/fixtures/style_parser/line-opacity.style.json index 8f5221b8ad..712b2b6f50 100644 --- a/test/fixtures/style_parser/line-opacity.style.json +++ b/test/fixtures/style_parser/line-opacity.style.json @@ -1,5 +1,5 @@ { - "version": 6, + "version": 8, "sources": { "mapbox": { "type": "vector", diff --git a/test/fixtures/style_parser/line-translate.style.json b/test/fixtures/style_parser/line-translate.style.json index 3c079f3520..a32b2d8ee4 100644 --- a/test/fixtures/style_parser/line-translate.style.json +++ b/test/fixtures/style_parser/line-translate.style.json @@ -1,5 +1,5 @@ { - "version": 6, + "version": 8, "sources": { "mapbox": { "type": "vector", diff --git a/test/fixtures/style_parser/line-width.style.json b/test/fixtures/style_parser/line-width.style.json index 18653074db..e5fe6fa8e1 100644 --- a/test/fixtures/style_parser/line-width.style.json +++ b/test/fixtures/style_parser/line-width.style.json @@ -1,5 +1,5 @@ { - "version": 6, + "version": 8, "sources": { "mapbox": { "type": "vector", diff --git a/test/fixtures/style_parser/stop-zoom-value.style.json b/test/fixtures/style_parser/stop-zoom-value.style.json index 5f907cd8e9..520db9a904 100644 --- a/test/fixtures/style_parser/stop-zoom-value.style.json +++ b/test/fixtures/style_parser/stop-zoom-value.style.json @@ -1,5 +1,5 @@ { - "version": 6, + "version": 8, "sources": { "mapbox": { "type": "vector", diff --git a/test/fixtures/style_parser/stops-array.style.json b/test/fixtures/style_parser/stops-array.style.json index 107c1c064c..daa48214d9 100644 --- a/test/fixtures/style_parser/stops-array.style.json +++ b/test/fixtures/style_parser/stops-array.style.json @@ -1,5 +1,5 @@ { - "version": 6, + "version": 8, "sources": { "mapbox": { "type": "vector", diff --git a/test/fixtures/style_parser/text-size.style.json b/test/fixtures/style_parser/text-size.style.json index 175ce456ad..46dd33e3c4 100644 --- a/test/fixtures/style_parser/text-size.style.json +++ b/test/fixtures/style_parser/text-size.style.json @@ -1,5 +1,5 @@ { - "version": 6, + "version": 8, "sources": { "mapbox": { "type": "vector", diff --git a/test/miscellaneous/mapbox.cpp b/test/miscellaneous/mapbox.cpp index f93749760b..f1febd729b 100644 --- a/test/miscellaneous/mapbox.cpp +++ b/test/miscellaneous/mapbox.cpp @@ -8,22 +8,29 @@ using namespace mbgl; TEST(Mapbox, SourceURL) { - EXPECT_EQ(mbgl::util::mapbox::normalizeSourceURL("mapbox://user.map", "key"), "https://api.tiles.mapbox.com/v4/user.map.json?access_token=key&secure"); - EXPECT_EQ(mbgl::util::mapbox::normalizeSourceURL("mapbox://user.map", "token"), "https://api.tiles.mapbox.com/v4/user.map.json?access_token=token&secure"); + EXPECT_EQ(mbgl::util::mapbox::normalizeSourceURL("mapbox://user.map", "key"), "https://api.mapbox.com/v4/user.map.json?access_token=key&secure"); + EXPECT_EQ(mbgl::util::mapbox::normalizeSourceURL("mapbox://user.map", "token"), "https://api.mapbox.com/v4/user.map.json?access_token=token&secure"); EXPECT_THROW(mbgl::util::mapbox::normalizeSourceURL("mapbox://user.map", ""), std::runtime_error); } TEST(Mapbox, GlyphsURL) { - EXPECT_EQ(mbgl::util::mapbox::normalizeGlyphsURL("mapbox://fontstack/{fontstack}/{range}.pbf", "key"), "https://api.tiles.mapbox.com/v4/fontstack/{fontstack}/{range}.pbf?access_token=key"); - EXPECT_EQ(mbgl::util::mapbox::normalizeGlyphsURL("mapbox://fonts/v1/user/{fontstack}/{range}.pbf", "key"), "https://api.tiles.mapbox.com/fonts/v1/user/{fontstack}/{range}.pbf?access_token=key"); + EXPECT_EQ(mbgl::util::mapbox::normalizeGlyphsURL("mapbox://fonts/boxmap/{fontstack}/{range}.pbf", "key"), "https://api.mapbox.com/fonts/v1/boxmap/{fontstack}/{range}.pbf?access_token=key"); EXPECT_EQ(mbgl::util::mapbox::normalizeGlyphsURL("http://path", "key"), "http://path"); } TEST(Mapbox, StyleURL) { - EXPECT_EQ(mbgl::util::mapbox::normalizeStyleURL("mapbox://user.style", "key"), "https://api.tiles.mapbox.com/styles/v1/user/user.style?access_token=key"); + EXPECT_EQ(mbgl::util::mapbox::normalizeStyleURL("mapbox://styles/user/style", "key"), "https://api.mapbox.com/styles/v1/user/style?access_token=key"); + EXPECT_EQ(mbgl::util::mapbox::normalizeStyleURL("mapbox://styles/user/style/draft", "key"), "https://api.mapbox.com/styles/v1/user/style/draft?access_token=key"); EXPECT_EQ(mbgl::util::mapbox::normalizeStyleURL("http://path", "key"), "http://path"); } +TEST(Mapbox, SpriteURL) { + EXPECT_EQ(mbgl::util::mapbox::normalizeSpriteURL("map/box/sprites@2x.json", "key"), "map/box/sprites@2x.json"); + EXPECT_EQ(mbgl::util::mapbox::normalizeSpriteURL("mapbox://sprites/mapbox/streets-v8.json", "key"), "https://api.mapbox.com/styles/v1/mapbox/streets-v8/sprite.json?access_token=key"); + EXPECT_EQ(mbgl::util::mapbox::normalizeSpriteURL("mapbox://sprites/mapbox/streets-v8@2x.png", "key"), "https://api.mapbox.com/styles/v1/mapbox/streets-v8/sprite@2x.png?access_token=key"); + EXPECT_EQ(mbgl::util::mapbox::normalizeSpriteURL("mapbox://sprites/mapbox/streets-v8/draft@2x.png", "key"), "https://api.mapbox.com/styles/v1/mapbox/streets-v8/draft/sprite@2x.png?access_token=key"); +} + TEST(Mapbox, TileURL) { try { EXPECT_EQ(mbgl::util::mapbox::normalizeTileURL("http://path.png/tile.png", "mapbox://user.map", SourceType::Raster), "http://path.png/tile{ratio}.png"); diff --git a/test/suite b/test/suite -Subproject b6b8a25e76231c2ceed341e024b4dce462c45a2 +Subproject b6828212d3fe5a06e1e91df1dc9a212cb565609 |