diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2018-07-23 16:08:44 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2018-07-24 11:08:40 -0700 |
commit | 2bbc79206073d260863c887a95ee4ba25bc45910 (patch) | |
tree | 4478ba0db1d873ed35e80b7e342100d85728ed18 /test/map/map.test.cpp | |
parent | cb714d57c5c5ad181aaf5e1690221da8d965682b (diff) | |
download | qtlocation-mapboxgl-2bbc79206073d260863c887a95ee4ba25bc45910.tar.gz |
[core] Check all bucket dynamic_casts
A mismatch can occur when a layer changes from one type to another.
Diffstat (limited to 'test/map/map.test.cpp')
-rw-r--r-- | test/map/map.test.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp index 4f7bd2df7b..8e2d9cb9cd 100644 --- a/test/map/map.test.cpp +++ b/test/map/map.test.cpp @@ -653,3 +653,52 @@ TEST(Map, NoContentTiles) { 0.0015, 0.1); } + +// https://github.com/mapbox/mapbox-gl-native/issues/12432 +TEST(Map, Issue12432) { + MapTest<> test { 1, MapMode::Continuous }; + + test.fileSource.tileResponse = [&](const Resource&) { + Response result; + result.data = std::make_shared<std::string>(util::read_file("test/fixtures/map/issue12432/0-0-0.mvt")); + return result; + }; + + test.map.getStyle().loadJSON(R"STYLE({ + "version": 8, + "sources": { + "mapbox": { + "type": "vector", + "tiles": ["http://example.com/{z}-{x}-{y}.vector.pbf"] + } + }, + "layers": [{ + "id": "water", + "type": "fill", + "source": "mapbox", + "source-layer": "water" + }] + })STYLE"); + + test.observer.didFinishLoadingMapCallback = [&]() { + test.map.getStyle().loadJSON(R"STYLE({ + "version": 8, + "sources": { + "mapbox": { + "type": "vector", + "tiles": ["http://example.com/{z}-{x}-{y}.vector.pbf"] + } + }, + "layers": [{ + "id": "water", + "type": "line", + "source": "mapbox", + "source-layer": "water" + }] + })STYLE"); + + test.runLoop.stop(); + }; + + test.runLoop.run(); +} |