diff options
Diffstat (limited to 'test/tile/vector_tile.test.cpp')
-rw-r--r-- | test/tile/vector_tile.test.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/test/tile/vector_tile.test.cpp b/test/tile/vector_tile.test.cpp index f24733dc9b..9d42f7ae74 100644 --- a/test/tile/vector_tile.test.cpp +++ b/test/tile/vector_tile.test.cpp @@ -6,11 +6,11 @@ #include <mbgl/util/default_thread_pool.hpp> #include <mbgl/util/run_loop.hpp> #include <mbgl/map/transform.hpp> -#include <mbgl/map/query.hpp> +#include <mbgl/style/style.hpp> #include <mbgl/style/layers/symbol_layer.hpp> #include <mbgl/renderer/tile_parameters.hpp> #include <mbgl/renderer/buckets/symbol_bucket.hpp> -#include <mbgl/text/collision_tile.hpp> +#include <mbgl/renderer/query.hpp> #include <mbgl/geometry/feature_index.hpp> #include <mbgl/annotation/annotation_manager.hpp> #include <mbgl/renderer/image_manager.hpp> @@ -26,7 +26,8 @@ public: TransformState transformState; util::RunLoop loop; ThreadPool threadPool { 1 }; - AnnotationManager annotationManager; + style::Style style { loop, fileSource, 1 }; + AnnotationManager annotationManager { style }; ImageManager imageManager; GlyphManager glyphManager { fileSource }; Tileset tileset { { "https://example.com" }, { 0, 22 }, "none" }; @@ -40,7 +41,8 @@ public: MapMode::Continuous, annotationManager, imageManager, - glyphManager + glyphManager, + 0 }; }; @@ -56,7 +58,8 @@ TEST(VectorTile, setError) { TEST(VectorTile, onError) { VectorTileTest test; VectorTile tile(OverscaledTileID(0, 0, 0), "source", test.tileParameters, test.tileset); - tile.onError(std::make_exception_ptr(std::runtime_error("test"))); + tile.onError(std::make_exception_ptr(std::runtime_error("test")), 0); + EXPECT_FALSE(tile.isRenderable()); EXPECT_TRUE(tile.isLoaded()); EXPECT_TRUE(tile.isComplete()); @@ -67,12 +70,13 @@ TEST(VectorTile, Issue7615) { VectorTile tile(OverscaledTileID(0, 0, 0), "source", test.tileParameters, test.tileset); style::SymbolLayer symbolLayer("symbol", "source"); + std::vector<SymbolInstance> symbolInstances; auto symbolBucket = std::make_shared<SymbolBucket>( style::SymbolLayoutProperties::PossiblyEvaluated(), std::map< std::string, std::pair<style::IconPaintProperties::PossiblyEvaluated, style::TextPaintProperties::PossiblyEvaluated>>(), - 16.0f, 1.0f, 0.0f, false, false); + 16.0f, 1.0f, 0.0f, false, false, false, std::move(symbolInstances)); // Simulate placement of a symbol layer. tile.onPlacement(GeometryTile::PlacementResult { @@ -80,19 +84,16 @@ TEST(VectorTile, Issue7615) { symbolLayer.getID(), symbolBucket }}, - nullptr, {}, {}, - 0 - }); + }, 0); // Subsequent onLayout should not cause the existing symbol bucket to be discarded. tile.onLayout(GeometryTile::LayoutResult { - {}, + std::unordered_map<std::string, std::shared_ptr<Bucket>>(), nullptr, nullptr, - 0 - }); + }, 0); EXPECT_EQ(symbolBucket.get(), tile.getBucket(*symbolLayer.baseImpl)); } |