From 2bbc79206073d260863c887a95ee4ba25bc45910 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 23 Jul 2018 16:08:44 -0700 Subject: [core] Check all bucket dynamic_casts A mismatch can occur when a layer changes from one type to another. --- test/map/map.test.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'test/map') 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(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(); +} -- cgit v1.2.1