summaryrefslogtreecommitdiff
path: root/test/style
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-02-04 10:59:36 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-02-04 13:18:14 -0800
commit19aa090bdcff083c039c0767908c9608ad853403 (patch)
tree8eee0222ccca67bf5f2968bb04fc6a7c2bb14616 /test/style
parentd7db9c775abafd852c3b935045443387191bf823 (diff)
downloadqtlocation-mapboxgl-19aa090bdcff083c039c0767908c9608ad853403.tar.gz
[tests] Don't call the callback for cancelled responses
StubFileSource gets an optional Response return type. Returning null means "cancelled; don't call the callback". Fixes #3784
Diffstat (limited to 'test/style')
-rw-r--r--test/style/glyph_store.cpp2
-rw-r--r--test/style/source.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/test/style/glyph_store.cpp b/test/style/glyph_store.cpp
index a4bc0e3135..55f19672af 100644
--- a/test/style/glyph_store.cpp
+++ b/test/style/glyph_store.cpp
@@ -134,7 +134,7 @@ TEST(GlyphStore, LoadingCancel) {
test.fileSource.glyphsResponse = [&] (const Resource&) {
test.end();
- return Response();
+ return optional<Response>();
};
test.observer.glyphsLoaded = [&] (const std::string&, const GlyphRange&) {
diff --git a/test/style/source.cpp b/test/style/source.cpp
index d1944f3842..528059ae9f 100644
--- a/test/style/source.cpp
+++ b/test/style/source.cpp
@@ -240,7 +240,7 @@ TEST(Source, RasterTileCancel) {
test.fileSource.tileResponse = [&] (const Resource&) {
test.end();
- return Response();
+ return optional<Response>();
};
test.observer.tileLoaded = [&] (Source&, const TileID&, bool) {
@@ -267,7 +267,7 @@ TEST(Source, VectorTileCancel) {
test.fileSource.tileResponse = [&] (const Resource&) {
test.end();
- return Response();
+ return optional<Response>();
};
test.observer.tileLoaded = [&] (Source&, const TileID&, bool) {