summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-03-24 17:04:23 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-04-14 14:18:19 -0700
commitb55692132ae66b76a5136bf2ccffd112512f01e9 (patch)
treec53ef3be473143f707e26d44d0869e8170b4fea5 /test
parent7de9e196d776e5be972d2e75fc5b290b5e01b33c (diff)
downloadqtlocation-mapboxgl-b55692132ae66b76a5136bf2ccffd112512f01e9.tar.gz
[tests] Use StubFileSource where a real FileSource is not required
Diffstat (limited to 'test')
-rw-r--r--test/api/annotations.cpp26
-rw-r--r--test/api/api_misuse.cpp6
-rw-r--r--test/api/custom_layer.cpp4
-rw-r--r--test/api/set_style.cpp4
-rw-r--r--test/map/map_context.cpp4
5 files changed, 22 insertions, 22 deletions
diff --git a/test/api/annotations.cpp b/test/api/annotations.cpp
index f403512660..8640ce9dbe 100644
--- a/test/api/annotations.cpp
+++ b/test/api/annotations.cpp
@@ -1,4 +1,5 @@
#include <mbgl/test/util.hpp>
+#include <mbgl/test/stub_file_source.hpp>
#include <mbgl/annotation/point_annotation.hpp>
#include <mbgl/annotation/shape_annotation.hpp>
@@ -6,7 +7,6 @@
#include <mbgl/map/map.hpp>
#include <mbgl/platform/default/headless_display.hpp>
#include <mbgl/platform/default/headless_view.hpp>
-#include <mbgl/storage/online_file_source.hpp>
#include <mbgl/util/io.hpp>
#include <mbgl/util/run_loop.hpp>
@@ -34,7 +34,7 @@ TEST(Annotations, PointAnnotation) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
Map map(view, fileSource, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), "");
@@ -49,7 +49,7 @@ TEST(Annotations, LineAnnotation) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
Map map(view, fileSource, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), "");
@@ -70,7 +70,7 @@ TEST(Annotations, FillAnnotation) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
Map map(view, fileSource, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), "");
@@ -90,7 +90,7 @@ TEST(Annotations, StyleSourcedShapeAnnotation) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
Map map(view, fileSource, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/annotation.json"), "");
@@ -107,7 +107,7 @@ TEST(Annotations, AddMultiple) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
Map map(view, fileSource, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), "");
@@ -126,7 +126,7 @@ TEST(Annotations, NonImmediateAdd) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
Map map(view, fileSource, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), "");
@@ -148,7 +148,7 @@ TEST(Annotations, UpdateIcon) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
Map map(view, fileSource, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), "");
@@ -169,7 +169,7 @@ TEST(Annotations, UpdatePoint) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
Map map(view, fileSource, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), "");
@@ -189,7 +189,7 @@ TEST(Annotations, RemovePoint) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
Map map(view, fileSource, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), "");
@@ -208,7 +208,7 @@ TEST(Annotations, RemoveShape) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
AnnotationSegments segments = {{ {{ { 0, 0 }, { 45, 45 } }} }};
@@ -232,7 +232,7 @@ TEST(Annotations, ImmediateRemoveShape) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
Map map(view, fileSource, MapMode::Still);
map.removeAnnotation(map.addShapeAnnotation(ShapeAnnotation({}, {})));
@@ -246,7 +246,7 @@ TEST(Annotations, SwitchStyle) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
Map map(view, fileSource, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), "");
diff --git a/test/api/api_misuse.cpp b/test/api/api_misuse.cpp
index 5e413df369..2400550a68 100644
--- a/test/api/api_misuse.cpp
+++ b/test/api/api_misuse.cpp
@@ -1,9 +1,9 @@
#include <mbgl/test/util.hpp>
+#include <mbgl/test/stub_file_source.hpp>
#include <mbgl/test/fixture_log_observer.hpp>
#include <mbgl/map/map.hpp>
#include <mbgl/platform/default/headless_display.hpp>
-#include <mbgl/platform/default/headless_view.hpp>
#include <mbgl/storage/online_file_source.hpp>
#include <mbgl/util/exception.hpp>
#include <mbgl/util/run_loop.hpp>
@@ -21,7 +21,7 @@ TEST(API, RenderWithoutCallback) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
view.resize(128, 512);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
std::unique_ptr<Map> map = std::make_unique<Map>(view, fileSource, MapMode::Still);
map->renderStill(nullptr);
@@ -45,7 +45,7 @@ TEST(API, RenderWithoutStyle) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
view.resize(128, 512);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
Map map(view, fileSource, MapMode::Still);
diff --git a/test/api/custom_layer.cpp b/test/api/custom_layer.cpp
index 46eecb2250..4ad25bbfd5 100644
--- a/test/api/custom_layer.cpp
+++ b/test/api/custom_layer.cpp
@@ -1,9 +1,9 @@
#include <mbgl/test/util.hpp>
+#include <mbgl/test/stub_file_source.hpp>
#include <mbgl/map/map.hpp>
#include <mbgl/platform/default/headless_display.hpp>
#include <mbgl/platform/default/headless_view.hpp>
-#include <mbgl/storage/online_file_source.hpp>
#include <mbgl/layer/custom_layer.hpp>
#include <mbgl/util/io.hpp>
#include <mbgl/util/mat4.hpp>
@@ -73,7 +73,7 @@ TEST(CustomLayer, Basic) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
Map map(view, fileSource, MapMode::Still);
map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"), "");
diff --git a/test/api/set_style.cpp b/test/api/set_style.cpp
index 317021b8db..f9beb53871 100644
--- a/test/api/set_style.cpp
+++ b/test/api/set_style.cpp
@@ -1,10 +1,10 @@
#include <mbgl/test/util.hpp>
+#include <mbgl/test/stub_file_source.hpp>
#include <mbgl/test/fixture_log_observer.hpp>
#include <mbgl/map/map.hpp>
#include <mbgl/platform/default/headless_view.hpp>
#include <mbgl/platform/default/headless_display.hpp>
-#include <mbgl/storage/online_file_source.hpp>
#include <mbgl/util/run_loop.hpp>
@@ -15,7 +15,7 @@ TEST(API, SetStyle) {
auto display = std::make_shared<mbgl::HeadlessDisplay>();
HeadlessView view(display, 1);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
Log::setObserver(std::make_unique<FixtureLogObserver>());
diff --git a/test/map/map_context.cpp b/test/map/map_context.cpp
index 5de0490557..47777d262e 100644
--- a/test/map/map_context.cpp
+++ b/test/map/map_context.cpp
@@ -1,10 +1,10 @@
#include <mbgl/test/util.hpp>
+#include <mbgl/test/stub_file_source.hpp>
#include <mbgl/map/map_data.hpp>
#include <mbgl/map/map_context.hpp>
#include <mbgl/platform/default/headless_view.hpp>
#include <mbgl/platform/default/headless_display.hpp>
-#include <mbgl/storage/online_file_source.hpp>
#include <mbgl/util/thread.hpp>
#include <mbgl/util/run_loop.hpp>
@@ -15,7 +15,7 @@ TEST(MapContext, DoubleStyleLoad) {
std::shared_ptr<HeadlessDisplay> display = std::make_shared<HeadlessDisplay>();
HeadlessView view(display, 1, 512, 512);
- OnlineFileSource fileSource;
+ StubFileSource fileSource;
util::Thread<MapContext> context({"Map", util::ThreadType::Map, util::ThreadPriority::Regular},
view, fileSource, MapMode::Continuous, GLContextMode::Unique, view.getPixelRatio());