diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-07-01 21:44:15 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-07-04 16:56:43 +0300 |
commit | 63dd17e2bbdb2c956789865c1d517305f860a175 (patch) | |
tree | 6888c96f50df988e55b5722dd870db98fdd877b5 /test | |
parent | b1cbc2f2451d6eea9a8ad2adde1c8087ab581192 (diff) | |
download | qtlocation-mapboxgl-63dd17e2bbdb2c956789865c1d517305f860a175.tar.gz |
[core] Introduce TileRenderData
Remove rendering functionality from Tile implementations.
Diffstat (limited to 'test')
-rw-r--r-- | test/tile/custom_geometry_tile.test.cpp | 4 | ||||
-rw-r--r-- | test/tile/geojson_tile.test.cpp | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/test/tile/custom_geometry_tile.test.cpp b/test/tile/custom_geometry_tile.test.cpp index 1aed821cd6..fb905ac076 100644 --- a/test/tile/custom_geometry_tile.test.cpp +++ b/test/tile/custom_geometry_tile.test.cpp @@ -111,14 +111,14 @@ TEST(CustomGeometryTile, InvokeTileChanged) { CustomGeometryTile tile(OverscaledTileID(0, 0, 0), "source", test.tileParameters, CustomGeometrySource::TileOptions(), loaderActor); + Immutable<LayerProperties> layerProperties = makeMutable<CircleLayerProperties>(staticImmutableCast<CircleLayer::Impl>(layer.baseImpl)); StubTileObserver observer; observer.tileChanged = [&] (const Tile&) { // Once present, the bucket should never "disappear", which would cause // flickering. - ASSERT_NE(nullptr, tile.getBucket(*layer.baseImpl)); + ASSERT_TRUE(tile.layerPropertiesUpdated(layerProperties)); }; - Immutable<LayerProperties> layerProperties = makeMutable<CircleLayerProperties>(staticImmutableCast<CircleLayer::Impl>(layer.baseImpl)); std::vector<Immutable<LayerProperties>> layers { layerProperties }; tile.setLayers(layers); tile.setObserver(&observer); diff --git a/test/tile/geojson_tile.test.cpp b/test/tile/geojson_tile.test.cpp index bf42278e4c..cc2dbfced8 100644 --- a/test/tile/geojson_tile.test.cpp +++ b/test/tile/geojson_tile.test.cpp @@ -52,14 +52,14 @@ TEST(GeoJSONTile, Issue7648) { features.push_back(mapbox::feature::feature<int16_t> { mapbox::geometry::point<int16_t>(0, 0) }); GeoJSONTile tile(OverscaledTileID(0, 0, 0), "source", test.tileParameters, features); - + Immutable<LayerProperties> layerProperties = makeMutable<CircleLayerProperties>(staticImmutableCast<CircleLayer::Impl>(layer.baseImpl)); StubTileObserver observer; observer.tileChanged = [&] (const Tile&) { // Once present, the bucket should never "disappear", which would cause // flickering. - ASSERT_NE(nullptr, tile.getBucket(*layer.baseImpl)); + ASSERT_TRUE(tile.layerPropertiesUpdated(layerProperties)); }; - Immutable<LayerProperties> layerProperties = makeMutable<CircleLayerProperties>(staticImmutableCast<CircleLayer::Impl>(layer.baseImpl)); + std::vector<Immutable<LayerProperties>> layers { layerProperties }; tile.setLayers(layers); tile.setObserver(&observer); @@ -95,18 +95,18 @@ TEST(GeoJSONTile, Issue9927) { } ASSERT_TRUE(tile.isRenderable()); - ASSERT_NE(nullptr, tile.getBucket(*layer.baseImpl)); + ASSERT_TRUE(tile.layerPropertiesUpdated(layerProperties)); // Make sure that once we've had a renderable tile and then receive erroneous data, we retain // the previously rendered data and keep the tile renderable. tile.setError(std::make_exception_ptr(std::runtime_error("Connection offline"))); ASSERT_TRUE(tile.isRenderable()); - ASSERT_NE(nullptr, tile.getBucket(*layer.baseImpl)); + ASSERT_TRUE(tile.layerPropertiesUpdated(layerProperties)); // Then simulate a parsing failure and make sure that we keep it renderable in this situation // as well. We're using 3 as a correlationID since we've done two three calls that increment // this counter (as part of the GeoJSONTile constructor, setLayers, and setPlacementConfig). tile.onError(std::make_exception_ptr(std::runtime_error("Parse error")), 3); ASSERT_TRUE(tile.isRenderable()); - ASSERT_NE(nullptr, tile.getBucket(*layer.baseImpl)); + ASSERT_TRUE(tile.layerPropertiesUpdated(layerProperties)); } |