[core] Check all bucket dynamic_casts

A mismatch can occur when a layer changes from one type to another.
This commit is contained in:
John Firebaugh
2018-07-23 16:08:44 -07:00
parent cb714d57c5
commit 2bbc792060
15 changed files with 122 additions and 34 deletions

View File

@@ -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();
}