diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/api/annotations.test.cpp | 4 | ||||
-rw-r--r-- | test/api/api_misuse.test.cpp | 4 | ||||
-rw-r--r-- | test/api/custom_geometry_source.test.cpp | 3 | ||||
-rw-r--r-- | test/api/custom_layer.test.cpp | 3 | ||||
-rw-r--r-- | test/api/query.test.cpp | 3 | ||||
-rw-r--r-- | test/api/recycle_map.cpp | 4 | ||||
-rw-r--r-- | test/gl/context.test.cpp | 4 | ||||
-rw-r--r-- | test/map/map.test.cpp | 10 | ||||
-rw-r--r-- | test/map/prefetch.test.cpp | 4 | ||||
-rw-r--r-- | test/text/local_glyph_rasterizer.test.cpp | 3 | ||||
-rw-r--r-- | test/util/memory.test.cpp | 8 |
11 files changed, 35 insertions, 15 deletions
diff --git a/test/api/annotations.test.cpp b/test/api/annotations.test.cpp index d13bc15ea7..9208e671cb 100644 --- a/test/api/annotations.test.cpp +++ b/test/api/annotations.test.cpp @@ -6,6 +6,7 @@ #include <mbgl/style/style.hpp> #include <mbgl/style/image.hpp> #include <mbgl/map/map.hpp> +#include <mbgl/map/map_options.hpp> #include <mbgl/util/io.hpp> #include <mbgl/util/run_loop.hpp> #include <mbgl/util/color.hpp> @@ -31,8 +32,9 @@ public: ThreadPool threadPool { 4 }; float pixelRatio { 1 }; HeadlessFrontend frontend { pixelRatio, fileSource, threadPool }; + Map map { frontend, MapObserver::nullObserver(), frontend.getSize(), pixelRatio, fileSource, - threadPool, MapMode::Static}; + threadPool, MapOptions().withMapMode(MapMode::Static)}; void checkRendering(const char * name) { test::checkImage(std::string("test/fixtures/annotations/") + name, diff --git a/test/api/api_misuse.test.cpp b/test/api/api_misuse.test.cpp index 363958451b..8899173071 100644 --- a/test/api/api_misuse.test.cpp +++ b/test/api/api_misuse.test.cpp @@ -3,6 +3,7 @@ #include <mbgl/test/fixture_log_observer.hpp> #include <mbgl/map/map.hpp> +#include <mbgl/map/map_options.hpp> #include <mbgl/renderer/backend_scope.hpp> #include <mbgl/gl/headless_frontend.hpp> #include <mbgl/storage/online_file_source.hpp> @@ -27,7 +28,8 @@ TEST(API, RenderWithoutCallback) { HeadlessFrontend frontend { pixelRatio, fileSource, threadPool }; auto map = std::make_unique<Map>(frontend, MapObserver::nullObserver(), frontend.getSize(), - pixelRatio, fileSource, threadPool, MapMode::Static); + pixelRatio, fileSource, threadPool, + MapOptions().withMapMode(MapMode::Static)); map->renderStill(nullptr); // Force Map thread to join. diff --git a/test/api/custom_geometry_source.test.cpp b/test/api/custom_geometry_source.test.cpp index 51d026e30d..9b8f166e03 100644 --- a/test/api/custom_geometry_source.test.cpp +++ b/test/api/custom_geometry_source.test.cpp @@ -1,6 +1,7 @@ #include <mbgl/test/util.hpp> #include <mbgl/map/map.hpp> +#include <mbgl/map/map_options.hpp> #include <mbgl/util/shared_thread_pool.hpp> #include <mbgl/storage/default_file_source.hpp> #include <mbgl/gl/headless_frontend.hpp> @@ -24,7 +25,7 @@ TEST(CustomGeometrySource, Grid) { float pixelRatio { 1 }; HeadlessFrontend frontend { pixelRatio, fileSource, *threadPool }; Map map(frontend, MapObserver::nullObserver(), frontend.getSize(), pixelRatio, fileSource, - *threadPool, MapMode::Static); + *threadPool, MapOptions().withMapMode(MapMode::Static)); map.getStyle().loadJSON(util::read_file("test/fixtures/api/water.json")); map.setLatLngZoom({ 37.8, -122.5 }, 10); diff --git a/test/api/custom_layer.test.cpp b/test/api/custom_layer.test.cpp index c2a0797483..ef0ff579b0 100644 --- a/test/api/custom_layer.test.cpp +++ b/test/api/custom_layer.test.cpp @@ -2,6 +2,7 @@ #include <mbgl/platform/gl_functions.hpp> #include <mbgl/map/map.hpp> +#include <mbgl/map/map_options.hpp> #include <mbgl/util/default_thread_pool.hpp> #include <mbgl/storage/default_file_source.hpp> #include <mbgl/gl/defines.hpp> @@ -94,7 +95,7 @@ TEST(CustomLayer, Basic) { float pixelRatio { 1 }; HeadlessFrontend frontend { pixelRatio, fileSource, threadPool }; Map map(frontend, MapObserver::nullObserver(), frontend.getSize(), pixelRatio, fileSource, - threadPool, MapMode::Static); + threadPool, MapOptions().withMapMode(MapMode::Static)); map.getStyle().loadJSON(util::read_file("test/fixtures/api/water.json")); map.setLatLngZoom({ 37.8, -122.5 }, 10); map.getStyle().addLayer(std::make_unique<CustomLayer>( diff --git a/test/api/query.test.cpp b/test/api/query.test.cpp index f5eb32788d..6aee0d6b7c 100644 --- a/test/api/query.test.cpp +++ b/test/api/query.test.cpp @@ -1,4 +1,5 @@ #include <mbgl/map/map.hpp> +#include <mbgl/map/map_options.hpp> #include <mbgl/util/default_thread_pool.hpp> #include <mbgl/test/stub_file_source.hpp> #include <mbgl/test/util.hpp> @@ -37,7 +38,7 @@ public: float pixelRatio { 1 }; HeadlessFrontend frontend { pixelRatio, fileSource, threadPool }; Map map { frontend, MapObserver::nullObserver(), frontend.getSize(), pixelRatio, fileSource, - threadPool, MapMode::Static}; + threadPool, MapOptions().withMapMode(MapMode::Static)}; }; std::vector<Feature> getTopClusterFeature(QueryTest& test) { diff --git a/test/api/recycle_map.cpp b/test/api/recycle_map.cpp index fc7e5223ec..0883241274 100644 --- a/test/api/recycle_map.cpp +++ b/test/api/recycle_map.cpp @@ -3,6 +3,7 @@ #include <mbgl/gl/headless_frontend.hpp> #include <mbgl/map/map.hpp> +#include <mbgl/map/map_options.hpp> #include <mbgl/renderer/backend_scope.hpp> #include <mbgl/storage/online_file_source.hpp> #include <mbgl/style/layers/symbol_layer.hpp> @@ -29,7 +30,8 @@ TEST(API, RecycleMapUpdateImages) { HeadlessFrontend frontend { pixelRatio, fileSource, threadPool }; auto map = std::make_unique<Map>(frontend, MapObserver::nullObserver(), frontend.getSize(), - pixelRatio, fileSource, threadPool, MapMode::Static); + pixelRatio, fileSource, threadPool, + MapOptions().withMapMode(MapMode::Static)); EXPECT_TRUE(map); diff --git a/test/gl/context.test.cpp b/test/gl/context.test.cpp index 176257916f..28f4a15d52 100644 --- a/test/gl/context.test.cpp +++ b/test/gl/context.test.cpp @@ -3,6 +3,7 @@ #include <mbgl/platform/gl_functions.hpp> #include <mbgl/gl/context.hpp> #include <mbgl/map/map.hpp> +#include <mbgl/map/map_options.hpp> #include <mbgl/util/default_thread_pool.hpp> #include <mbgl/storage/default_file_source.hpp> #include <mbgl/gl/defines.hpp> @@ -91,7 +92,8 @@ TEST(GLContextMode, Shared) { HeadlessFrontend frontend { pixelRatio, fileSource, threadPool, {}, GLContextMode::Shared }; - Map map(frontend, MapObserver::nullObserver(), frontend.getSize(), pixelRatio, fileSource, threadPool, MapMode::Static); + Map map(frontend, MapObserver::nullObserver(), frontend.getSize(), pixelRatio, + fileSource, threadPool, MapOptions().withMapMode(MapMode::Static)); map.getStyle().loadJSON(util::read_file("test/fixtures/api/water.json")); map.setLatLngZoom({ 37.8, -122.5 }, 10); diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp index 690df6b3e9..cf83eeeb81 100644 --- a/test/map/map.test.cpp +++ b/test/map/map.test.cpp @@ -5,6 +5,7 @@ #include <mbgl/test/fixture_log_observer.hpp> #include <mbgl/map/map.hpp> +#include <mbgl/map/map_options.hpp> #include <mbgl/gl/context.hpp> #include <mbgl/gl/headless_frontend.hpp> #include <mbgl/util/default_thread_pool.hpp> @@ -38,7 +39,8 @@ public: MapTest(float pixelRatio = 1, MapMode mode = MapMode::Static) : frontend(pixelRatio, fileSource, threadPool) - , map(frontend, observer, frontend.getSize(), pixelRatio, fileSource, threadPool, mode) { + , map(frontend, observer, frontend.getSize(), pixelRatio, + fileSource, threadPool, MapOptions().withMapMode(mode)) { } template <typename T = FileSource> @@ -47,7 +49,8 @@ public: typename std::enable_if<std::is_same<T, DefaultFileSource>::value>::type* = 0) : fileSource { cachePath, assetRoot } , frontend(pixelRatio, fileSource, threadPool) - , map(frontend, observer, frontend.getSize(), pixelRatio, fileSource, threadPool, mode) { + , map(frontend, observer, frontend.getSize(), pixelRatio, + fileSource, threadPool, MapOptions().withMapMode(mode)) { } }; @@ -682,7 +685,8 @@ TEST(Map, TEST_DISABLED_ON_CI(ContinuousRendering)) { }); }; - Map map(frontend, observer, frontend.getSize(), pixelRatio, fileSource, threadPool, MapMode::Continuous); + Map map(frontend, observer, frontend.getSize(), pixelRatio, fileSource, + threadPool, MapOptions().withMapMode(MapMode::Continuous)); map.getStyle().loadJSON(util::read_file("test/fixtures/api/water.json")); runLoop.run(); diff --git a/test/map/prefetch.test.cpp b/test/map/prefetch.test.cpp index 9b61224027..7f252fcb2e 100644 --- a/test/map/prefetch.test.cpp +++ b/test/map/prefetch.test.cpp @@ -3,6 +3,7 @@ #include <mbgl/test/stub_map_observer.hpp> #include <mbgl/map/map.hpp> +#include <mbgl/map/map_options.hpp> #include <mbgl/gl/headless_frontend.hpp> #include <mbgl/storage/default_file_source.hpp> #include <mbgl/style/style.hpp> @@ -37,7 +38,8 @@ TEST(Map, PrefetchTiles) { }; HeadlessFrontend frontend { { 512, 512 }, 1, fileSource, threadPool }; - Map map(frontend, observer, frontend.getSize(), 1, fileSource, threadPool, MapMode::Continuous); + Map map(frontend, observer, frontend.getSize(), 1, fileSource, threadPool, + MapOptions().withMapMode(MapMode::Continuous)); std::vector<int> tiles; diff --git a/test/text/local_glyph_rasterizer.test.cpp b/test/text/local_glyph_rasterizer.test.cpp index 0dfec1689a..20f825c935 100644 --- a/test/text/local_glyph_rasterizer.test.cpp +++ b/test/text/local_glyph_rasterizer.test.cpp @@ -1,6 +1,7 @@ #include <mbgl/test/util.hpp> #include <mbgl/test/stub_file_source.hpp> #include <mbgl/map/map.hpp> +#include <mbgl/map/map_options.hpp> #include <mbgl/util/io.hpp> #include <mbgl/util/run_loop.hpp> #include <mbgl/util/color.hpp> @@ -42,7 +43,7 @@ public: float pixelRatio { 1 }; HeadlessFrontend frontend; Map map { frontend, MapObserver::nullObserver(), frontend.getSize(), pixelRatio, fileSource, - threadPool, MapMode::Static}; + threadPool, MapOptions().withMapMode(MapMode::Static)}; void checkRendering(const char * name) { test::checkImage(std::string("test/fixtures/local_glyphs/") + name, diff --git a/test/util/memory.test.cpp b/test/util/memory.test.cpp index 6befb521f0..76f385d3d6 100644 --- a/test/util/memory.test.cpp +++ b/test/util/memory.test.cpp @@ -3,6 +3,7 @@ #include <mbgl/test/util.hpp> #include <mbgl/map/map.hpp> +#include <mbgl/map/map_options.hpp> #include <mbgl/gl/headless_frontend.hpp> #include <mbgl/util/default_thread_pool.hpp> #include <mbgl/util/io.hpp> @@ -72,7 +73,7 @@ TEST(Memory, Vector) { HeadlessFrontend frontend { { 256, 256 }, ratio, test.fileSource, test.threadPool }; Map map(frontend, MapObserver::nullObserver(), frontend.getSize(), ratio, test.fileSource, - test.threadPool, MapMode::Static); + test.threadPool, MapOptions().withMapMode(MapMode::Static)); map.setZoom(16); // more map features map.getStyle().loadURL("mapbox://streets"); @@ -85,7 +86,7 @@ TEST(Memory, Raster) { HeadlessFrontend frontend { { 256, 256 }, ratio, test.fileSource, test.threadPool }; Map map(frontend, MapObserver::nullObserver(), frontend.getSize(), ratio, test.fileSource, - test.threadPool, MapMode::Static); + test.threadPool, MapOptions().withMapMode(MapMode::Static)); map.getStyle().loadURL("mapbox://satellite"); frontend.render(map); @@ -122,7 +123,8 @@ TEST(Memory, Footprint) { public: FrontendAndMap(MemoryTest& test_, const char* style) : frontend(Size{ 256, 256 }, 2, test_.fileSource, test_.threadPool) - , map(frontend, MapObserver::nullObserver(), frontend.getSize(), 2, test_.fileSource, test_.threadPool, MapMode::Static) { + , map(frontend, MapObserver::nullObserver(), frontend.getSize(), 2, test_.fileSource + , test_.threadPool, MapOptions().withMapMode(MapMode::Static)) { map.setZoom(16); map.getStyle().loadURL(style); frontend.render(map); |