diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-03-19 16:57:36 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-03-20 21:30:08 +0200 |
commit | d5868d3da822f2bf3297229bd879e76853108a63 (patch) | |
tree | b3d28aab92b938cf541f917f1027d2bbd06d9780 /test/api/query.test.cpp | |
parent | d1762d7111b39d45430bd7bb75ea60b7a5d85bd2 (diff) | |
download | qtlocation-mapboxgl-d5868d3da822f2bf3297229bd879e76853108a63.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); |