diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-13 11:38:18 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-14 11:25:45 -0700 |
commit | 9b0093e32dece62abc6fd7add789613871252a58 (patch) | |
tree | d6e8f90b12d64c41d4f95d9433e2dfca58be4f60 /test | |
parent | 7080196bf6b749de5f25b298c0acf49cced20b1e (diff) | |
download | qtlocation-mapboxgl-9b0093e32dece62abc6fd7add789613871252a58.tar.gz |
[core] Introduce source subclasses
Diffstat (limited to 'test')
-rw-r--r-- | test/style/source.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/test/style/source.cpp b/test/style/source.cpp index ae8fb54d2f..6828042c6a 100644 --- a/test/style/source.cpp +++ b/test/style/source.cpp @@ -2,7 +2,10 @@ #include <mbgl/test/stub_file_source.hpp> #include <mbgl/test/stub_style_observer.hpp> -#include <mbgl/style/source.hpp> +#include <mbgl/style/sources/raster_source.hpp> +#include <mbgl/style/sources/vector_source.hpp> +#include <mbgl/style/sources/geojson_source.hpp> + #include <mbgl/util/run_loop.hpp> #include <mbgl/util/string.hpp> #include <mbgl/util/io.hpp> @@ -83,7 +86,7 @@ TEST(Source, LoadingFail) { test.end(); }; - Source source(SourceType::Vector, "source", "url", 512, nullptr, nullptr); + VectorSource source("source", "url", 512, nullptr, nullptr); source.setObserver(&test.observer); source.load(test.fileSource); @@ -106,7 +109,7 @@ TEST(Source, LoadingCorrupt) { test.end(); }; - Source source(SourceType::Vector, "source", "url", 512, nullptr, nullptr); + VectorSource source("source", "url", 512, nullptr, nullptr); source.setObserver(&test.observer); source.load(test.fileSource); @@ -134,7 +137,7 @@ TEST(Source, RasterTileEmpty) { auto tileset = std::make_unique<Tileset>(); tileset->tiles = { "tiles" }; - Source source(SourceType::Raster, "source", "", 512, std::move(tileset), nullptr); + RasterSource source("source", "", 512, std::move(tileset), nullptr); source.setObserver(&test.observer); source.load(test.fileSource); source.update(test.updateParameters); @@ -163,7 +166,7 @@ TEST(Source, VectorTileEmpty) { auto tileset = std::make_unique<Tileset>(); tileset->tiles = { "tiles" }; - Source source(SourceType::Vector, "source", "", 512, std::move(tileset), nullptr); + VectorSource source("source", "", 512, std::move(tileset), nullptr); source.setObserver(&test.observer); source.load(test.fileSource); source.update(test.updateParameters); @@ -192,7 +195,7 @@ TEST(Source, RasterTileFail) { auto tileset = std::make_unique<Tileset>(); tileset->tiles = { "tiles" }; - Source source(SourceType::Raster, "source", "", 512, std::move(tileset), nullptr); + RasterSource source("source", "", 512, std::move(tileset), nullptr); source.setObserver(&test.observer); source.load(test.fileSource); source.update(test.updateParameters); @@ -221,7 +224,7 @@ TEST(Source, VectorTileFail) { auto tileset = std::make_unique<Tileset>(); tileset->tiles = { "tiles" }; - Source source(SourceType::Vector, "source", "", 512, std::move(tileset), nullptr); + VectorSource source("source", "", 512, std::move(tileset), nullptr); source.setObserver(&test.observer); source.load(test.fileSource); source.update(test.updateParameters); @@ -249,7 +252,7 @@ TEST(Source, RasterTileCorrupt) { auto tileset = std::make_unique<Tileset>(); tileset->tiles = { "tiles" }; - Source source(SourceType::Raster, "source", "", 512, std::move(tileset), nullptr); + RasterSource source("source", "", 512, std::move(tileset), nullptr); source.setObserver(&test.observer); source.load(test.fileSource); source.update(test.updateParameters); @@ -281,7 +284,7 @@ TEST(Source, VectorTileCorrupt) { auto tileset = std::make_unique<Tileset>(); tileset->tiles = { "tiles" }; - Source source(SourceType::Vector, "source", "", 512, std::move(tileset), nullptr); + VectorSource source("source", "", 512, std::move(tileset), nullptr); source.setObserver(&test.observer); source.load(test.fileSource); source.update(test.updateParameters); @@ -308,7 +311,7 @@ TEST(Source, RasterTileCancel) { auto tileset = std::make_unique<Tileset>(); tileset->tiles = { "tiles" }; - Source source(SourceType::Raster, "source", "", 512, std::move(tileset), nullptr); + RasterSource source("source", "", 512, std::move(tileset), nullptr); source.setObserver(&test.observer); source.load(test.fileSource); source.update(test.updateParameters); @@ -335,7 +338,7 @@ TEST(Source, VectorTileCancel) { auto tileset = std::make_unique<Tileset>(); tileset->tiles = { "tiles" }; - Source source(SourceType::Vector, "source", "", 512, std::move(tileset), nullptr); + VectorSource source("source", "", 512, std::move(tileset), nullptr); source.setObserver(&test.observer); source.load(test.fileSource); source.update(test.updateParameters); |