diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-03-19 16:57:36 +0200 |
---|---|---|
committer | Alf Watt <alf.watt@mapbox.com> | 2019-03-21 12:25:12 -0700 |
commit | ba6dfea248b6fc5224c840ea536ac7abf57d80f1 (patch) | |
tree | 9ad248db128b3d1847985efb5c79bf13a4d56d36 /test/api/query.test.cpp | |
parent | 15c6dbe967f4150a0d9f555781c7e353ecf20043 (diff) | |
download | qtlocation-mapboxgl-ba6dfea248b6fc5224c840ea536ac7abf57d80f1.tar.gz |
[core] Remove file source from public Map ctor
Diffstat (limited to 'test/api/query.test.cpp')
-rw-r--r-- | test/api/query.test.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/api/query.test.cpp b/test/api/query.test.cpp index 5567eabc73..b4297bfe82 100644 --- a/test/api/query.test.cpp +++ b/test/api/query.test.cpp @@ -1,4 +1,5 @@ -#include <mbgl/map/map.hpp> +#include <mbgl/test/map_adapter.hpp> + #include <mbgl/map/map_options.hpp> #include <mbgl/util/default_thread_pool.hpp> #include <mbgl/test/stub_file_source.hpp> @@ -33,16 +34,16 @@ public: } util::RunLoop loop; - StubFileSource fileSource; + std::shared_ptr<StubFileSource> fileSource = std::make_shared<StubFileSource>(); ThreadPool threadPool { 4 }; float pixelRatio { 1 }; HeadlessFrontend frontend { pixelRatio, threadPool }; - Map map { frontend, MapObserver::nullObserver(), frontend.getSize(), pixelRatio, fileSource, - threadPool, MapOptions().withMapMode(MapMode::Static)}; + MapAdapter map { frontend, MapObserver::nullObserver(), frontend.getSize(), pixelRatio, fileSource, + threadPool, MapOptions().withMapMode(MapMode::Static)}; }; std::vector<Feature> getTopClusterFeature(QueryTest& test) { - test.fileSource.sourceResponse = [&] (const Resource& resource) { + test.fileSource->sourceResponse = [&] (const Resource& resource) { EXPECT_EQ("http://url"s, resource.url); Response response; response.data = std::make_unique<std::string>(util::read_file("test/fixtures/supercluster/places.json"s)); @@ -54,7 +55,7 @@ std::vector<Feature> getTopClusterFeature(QueryTest& test) { options.cluster = true; auto source = std::make_unique<GeoJSONSource>("cluster_source"s, options); source->setURL("http://url"s); - source->loadDescription(test.fileSource); + source->loadDescription(*test.fileSource); auto clusterLayer = std::make_unique<SymbolLayer>("cluster_layer"s, "cluster_source"s); clusterLayer->setIconImage("test-icon"s); |