summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/algorithm/mock.hpp5
-rw-r--r--test/algorithm/update_renderables.test.cpp55
-rw-r--r--test/api/render_caching.cpp10
-rw-r--r--test/api/render_missing.test.cpp4
-rw-r--r--test/fixtures/api/assets/raster/10-163-395.pngbin0 -> 17685 bytes
-rw-r--r--test/fixtures/api/assets/raster/6-10-24.pngbin0 -> 29243 bytes
-rw-r--r--test/fixtures/api/cached_raster/expected.pngbin0 -> 120955 bytes
-rw-r--r--test/map/map.test.cpp4
-rw-r--r--test/sprite/sprite_loader.test.cpp2
-rw-r--r--test/src/mbgl/test/stub_render_source_observer.hpp9
-rw-r--r--test/src/mbgl/test/stub_style_observer.hpp4
-rw-r--r--test/src/mbgl/test/stub_tile_observer.hpp2
-rw-r--r--test/src/mbgl/test/util.cpp5
-rw-r--r--test/text/glyph_loader.test.cpp8
-rw-r--r--test/tile/geojson_tile.test.cpp4
-rw-r--r--test/tile/raster_tile.test.cpp4
-rw-r--r--test/tile/vector_tile.test.cpp2
17 files changed, 56 insertions, 62 deletions
diff --git a/test/algorithm/mock.hpp b/test/algorithm/mock.hpp
index d87f55343b..67f02bd8f5 100644
--- a/test/algorithm/mock.hpp
+++ b/test/algorithm/mock.hpp
@@ -26,10 +26,6 @@ struct MockBucket {};
struct MockTileData {
MockTileData(const mbgl::OverscaledTileID& tileID_) : tileID(tileID_) {}
- bool hasTriedOptional() const {
- return triedOptional;
- }
-
bool isRenderable() const {
return renderable;
}
@@ -39,7 +35,6 @@ struct MockTileData {
}
bool renderable = false;
- bool triedOptional = false;
bool loaded = false;
const mbgl::OverscaledTileID tileID;
};
diff --git a/test/algorithm/update_renderables.test.cpp b/test/algorithm/update_renderables.test.cpp
index 2d37992579..9c417cf7d5 100644
--- a/test/algorithm/update_renderables.test.cpp
+++ b/test/algorithm/update_renderables.test.cpp
@@ -171,7 +171,7 @@ TEST(UpdateRenderables, SingleTile) {
// Mark the created tile as having the optional request tried.
log.clear();
- source.dataTiles[{ 1, 0, { 1, 0, 1 } }]->triedOptional = true;
+ source.dataTiles[{ 1, 0, { 1, 0, 1 } }]->loaded = true;
algorithm::updateRenderables(getTileData, createTileData, retainTileData, renderTile,
source.idealTiles, source.zoomRange, 1);
EXPECT_EQ(ActionLog({
@@ -183,7 +183,7 @@ TEST(UpdateRenderables, SingleTile) {
GetTileDataAction{ { 2, 0, { 2, 1, 3 } }, NotFound }, // ...
GetTileDataAction{ { 0, 0, { 0, 0, 0 } }, NotFound }, // parent tile
CreateTileDataAction{ { 0, 0, { 0, 0, 0 } } }, // load parent tile
- RetainTileDataAction{ { 0, 0, { 0, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 0, 0, { 0, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 1, 0, { 1, 1, 1 } }, Found }, // found ideal tile
RetainTileDataAction{ { 1, 0, { 1, 1, 1 } }, Resource::Necessity::Required }, //
@@ -333,7 +333,7 @@ TEST(UpdateRenderables, DontUseWrongParentTile) {
// Now mark the created tile as having the optional request tried.
log.clear();
- source.dataTiles[{ 2, 0, { 2, 0, 0 } }]->triedOptional = true;
+ source.dataTiles[{ 2, 0, { 2, 0, 0 } }]->loaded = true;
algorithm::updateRenderables(getTileData, createTileData, retainTileData, renderTile,
source.idealTiles, source.zoomRange, 2);
EXPECT_EQ(ActionLog({
@@ -345,7 +345,7 @@ TEST(UpdateRenderables, DontUseWrongParentTile) {
GetTileDataAction{ { 3, 0, { 3, 1, 1 } }, NotFound }, // ...
GetTileDataAction{ { 1, 0, { 1, 0, 0 } }, NotFound }, // parent tile, missing
CreateTileDataAction{ { 1, 0, { 1, 0, 0 } } }, // find optional parent
- RetainTileDataAction{ { 1, 0, { 1, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 1, 0, { 1, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 0, 0, { 0, 0, 0 } }, NotFound }, // parent tile, missing
}),
log);
@@ -364,7 +364,7 @@ TEST(UpdateRenderables, DontUseWrongParentTile) {
GetTileDataAction{ { 3, 0, { 3, 1, 0 } }, NotFound }, // ...
GetTileDataAction{ { 3, 0, { 3, 1, 1 } }, NotFound }, // ...
GetTileDataAction{ { 1, 0, { 1, 0, 0 } }, Found }, // parent tile not ready
- RetainTileDataAction{ { 1, 0, { 1, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 1, 0, { 1, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 0, 0, { 0, 0, 0 } }, NotFound }, // missing parent tile
GetTileDataAction{ { 2, 0, { 2, 2, 0 } }, NotFound }, // missing ideal tile
@@ -718,7 +718,7 @@ TEST(UpdateRenderables, UseOverzoomedTileAfterMaxzoom) {
// Mark the created tile as having tried the optional request.
log.clear();
- source.dataTiles[{ 2, 0, { 2, 0, 0 } }]->triedOptional = true;
+ source.dataTiles[{ 2, 0, { 2, 0, 0 } }]->loaded = true;
algorithm::updateRenderables(getTileData, createTileData, retainTileData, renderTile,
source.idealTiles, source.zoomRange, 2);
EXPECT_EQ(
@@ -728,7 +728,7 @@ TEST(UpdateRenderables, UseOverzoomedTileAfterMaxzoom) {
GetTileDataAction{ { 3, 0, { 2, 0, 0 } }, NotFound }, // overzoomed tile, not children!
GetTileDataAction{ { 1, 0, { 1, 0, 0 } }, NotFound }, //
CreateTileDataAction{ { 1, 0, { 1, 0, 0 } } }, //
- RetainTileDataAction{ { 1, 0, { 1, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 1, 0, { 1, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 0, 0, { 0, 0, 0 } }, NotFound }, //
}),
log);
@@ -856,7 +856,7 @@ TEST(UpdateRenderables, AscendToNonOverzoomedTiles) {
// Now, mark the created tile as found.
log.clear();
- source.dataTiles[{ 3, 0, { 2, 0, 0 } }]->triedOptional = true;
+ source.dataTiles[{ 3, 0, { 2, 0, 0 } }]->loaded = true;
algorithm::updateRenderables(getTileData, createTileData, retainTileData, renderTile,
source.idealTiles, source.zoomRange, 3);
EXPECT_EQ(ActionLog({
@@ -865,7 +865,7 @@ TEST(UpdateRenderables, AscendToNonOverzoomedTiles) {
GetTileDataAction{ { 4, 0, { 2, 0, 0 } }, NotFound }, //
GetTileDataAction{ { 2, 0, { 2, 0, 0 } }, NotFound }, //
CreateTileDataAction{ { 2, 0, { 2, 0, 0 } } }, //
- RetainTileDataAction{ { 2, 0, { 2, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 2, 0, { 2, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 1, 0, { 1, 0, 0 } }, Found }, //
RetainTileDataAction{ { 1, 0, { 1, 0, 0 } }, Resource::Necessity::Optional }, //
RenderTileAction{ { 1, 0, 0 }, *tile_1_1_0_0 }, //
@@ -1086,7 +1086,7 @@ TEST(UpdateRenderables, RepeatedRenderWithMissingOptionals) {
// Mark next level has having tried optional.
log.clear();
- source.dataTiles[{ 6, 0, { 6, 0, 0 } }]->triedOptional = true;
+ source.dataTiles[{ 6, 0, { 6, 0, 0 } }]->loaded = true;
algorithm::updateRenderables(getTileData, createTileData, retainTileData, renderTile,
source.idealTiles, source.zoomRange, 6);
EXPECT_EQ(ActionLog({
@@ -1098,7 +1098,7 @@ TEST(UpdateRenderables, RepeatedRenderWithMissingOptionals) {
GetTileDataAction{ { 7, 0, { 7, 1, 1 } }, NotFound }, // ...
GetTileDataAction{ { 5, 0, { 5, 0, 0 } }, NotFound }, // ascent
CreateTileDataAction{ { 5, 0, { 5, 0, 0 } } }, //
- RetainTileDataAction{ { 5, 0, { 5, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 5, 0, { 5, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 4, 0, { 4, 0, 0 } }, NotFound }, // ...
GetTileDataAction{ { 3, 0, { 3, 0, 0 } }, NotFound }, // ...
GetTileDataAction{ { 2, 0, { 2, 0, 0 } }, NotFound }, // ...
@@ -1119,7 +1119,7 @@ TEST(UpdateRenderables, RepeatedRenderWithMissingOptionals) {
GetTileDataAction{ { 7, 0, { 7, 1, 0 } }, NotFound }, // ...
GetTileDataAction{ { 7, 0, { 7, 1, 1 } }, NotFound }, // ...
GetTileDataAction{ { 5, 0, { 5, 0, 0 } }, Found }, // ascent
- RetainTileDataAction{ { 5, 0, { 5, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 5, 0, { 5, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 4, 0, { 4, 0, 0 } }, NotFound }, // ...
GetTileDataAction{ { 3, 0, { 3, 0, 0 } }, NotFound }, // ...
GetTileDataAction{ { 2, 0, { 2, 0, 0 } }, NotFound }, // ...
@@ -1130,7 +1130,7 @@ TEST(UpdateRenderables, RepeatedRenderWithMissingOptionals) {
// Mark next level has having tried optional.
log.clear();
- source.dataTiles[{ 5, 0, { 5, 0, 0 } }]->triedOptional = true;
+ source.dataTiles[{ 5, 0, { 5, 0, 0 } }]->loaded = true;
algorithm::updateRenderables(getTileData, createTileData, retainTileData, renderTile,
source.idealTiles, source.zoomRange, 6);
EXPECT_EQ(ActionLog({
@@ -1141,10 +1141,10 @@ TEST(UpdateRenderables, RepeatedRenderWithMissingOptionals) {
GetTileDataAction{ { 7, 0, { 7, 1, 0 } }, NotFound }, // ...
GetTileDataAction{ { 7, 0, { 7, 1, 1 } }, NotFound }, // ...
GetTileDataAction{ { 5, 0, { 5, 0, 0 } }, Found }, // ascent
- RetainTileDataAction{ { 5, 0, { 5, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 5, 0, { 5, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 4, 0, { 4, 0, 0 } }, NotFound }, // ...
CreateTileDataAction{ { 4, 0, { 4, 0, 0 } } }, //
- RetainTileDataAction{ { 4, 0, { 4, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 4, 0, { 4, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 3, 0, { 3, 0, 0 } }, NotFound }, // ...
GetTileDataAction{ { 2, 0, { 2, 0, 0 } }, NotFound }, // ...
GetTileDataAction{ { 1, 0, { 1, 0, 0 } }, NotFound }, // ...
@@ -1154,7 +1154,7 @@ TEST(UpdateRenderables, RepeatedRenderWithMissingOptionals) {
// Mark next level has having tried optional.
log.clear();
- source.dataTiles[{ 4, 0, { 4, 0, 0 } }]->triedOptional = true;
+ source.dataTiles[{ 4, 0, { 4, 0, 0 } }]->loaded = true;
algorithm::updateRenderables(getTileData, createTileData, retainTileData, renderTile,
source.idealTiles, source.zoomRange, 6);
EXPECT_EQ(ActionLog({
@@ -1165,12 +1165,12 @@ TEST(UpdateRenderables, RepeatedRenderWithMissingOptionals) {
GetTileDataAction{ { 7, 0, { 7, 1, 0 } }, NotFound }, // ...
GetTileDataAction{ { 7, 0, { 7, 1, 1 } }, NotFound }, // ...
GetTileDataAction{ { 5, 0, { 5, 0, 0 } }, Found }, // ascent
- RetainTileDataAction{ { 5, 0, { 5, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 5, 0, { 5, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 4, 0, { 4, 0, 0 } }, Found }, // ...
- RetainTileDataAction{ { 4, 0, { 4, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 4, 0, { 4, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 3, 0, { 3, 0, 0 } }, NotFound }, // ...
CreateTileDataAction{ { 3, 0, { 3, 0, 0 } } }, //
- RetainTileDataAction{ { 3, 0, { 3, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 3, 0, { 3, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 2, 0, { 2, 0, 0 } }, NotFound }, // ...
GetTileDataAction{ { 1, 0, { 1, 0, 0 } }, NotFound }, // ...
GetTileDataAction{ { 0, 0, { 0, 0, 0 } }, NotFound }, // ...
@@ -1179,7 +1179,7 @@ TEST(UpdateRenderables, RepeatedRenderWithMissingOptionals) {
// Mark next level has having tried optional.
log.clear();
- source.dataTiles[{ 3, 0, { 3, 0, 0 } }]->triedOptional = true;
+ source.dataTiles[{ 3, 0, { 3, 0, 0 } }]->loaded = true;
algorithm::updateRenderables(getTileData, createTileData, retainTileData, renderTile,
source.idealTiles, source.zoomRange, 6);
EXPECT_EQ(ActionLog({
@@ -1190,14 +1190,14 @@ TEST(UpdateRenderables, RepeatedRenderWithMissingOptionals) {
GetTileDataAction{ { 7, 0, { 7, 1, 0 } }, NotFound }, // ...
GetTileDataAction{ { 7, 0, { 7, 1, 1 } }, NotFound }, // ...
GetTileDataAction{ { 5, 0, { 5, 0, 0 } }, Found }, // ascent
- RetainTileDataAction{ { 5, 0, { 5, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 5, 0, { 5, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 4, 0, { 4, 0, 0 } }, Found }, // ...
- RetainTileDataAction{ { 4, 0, { 4, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 4, 0, { 4, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 3, 0, { 3, 0, 0 } }, Found }, // ...
- RetainTileDataAction{ { 3, 0, { 3, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 3, 0, { 3, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 2, 0, { 2, 0, 0 } }, NotFound }, // ...
CreateTileDataAction{ { 2, 0, { 2, 0, 0 } } }, //
- RetainTileDataAction{ { 2, 0, { 2, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 2, 0, { 2, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 1, 0, { 1, 0, 0 } }, NotFound }, // ...
GetTileDataAction{ { 0, 0, { 0, 0, 0 } }, NotFound }, // ...
}),
@@ -1217,11 +1217,11 @@ TEST(UpdateRenderables, RepeatedRenderWithMissingOptionals) {
GetTileDataAction{ { 7, 0, { 7, 1, 0 } }, NotFound }, // ...
GetTileDataAction{ { 7, 0, { 7, 1, 1 } }, NotFound }, // ...
GetTileDataAction{ { 5, 0, { 5, 0, 0 } }, Found }, // ascent
- RetainTileDataAction{ { 5, 0, { 5, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 5, 0, { 5, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 4, 0, { 4, 0, 0 } }, Found }, // ...
- RetainTileDataAction{ { 4, 0, { 4, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 4, 0, { 4, 0, 0 } }, Resource::Necessity::Required }, //
GetTileDataAction{ { 3, 0, { 3, 0, 0 } }, Found }, // ...
- RetainTileDataAction{ { 3, 0, { 3, 0, 0 } }, Resource::Necessity::Optional }, //
+ RetainTileDataAction{ { 3, 0, { 3, 0, 0 } }, Resource::Necessity::Required }, //
RenderTileAction{ { 3, 0, 0 }, *tile_3_3_0_0 }, //
}),
log);
@@ -1239,7 +1239,6 @@ TEST(UpdateRenderables, LoadRequiredIfIdealTileCantBeFound) {
source.idealTiles.emplace(UnwrappedTileID{ 6, 0, 0 });
auto tile_6_6_0_0 = source.createTileData(OverscaledTileID{ 6, 0, { 6, 0, 0 } });
- tile_6_6_0_0->triedOptional = true;
tile_6_6_0_0->loaded = true;
algorithm::updateRenderables(getTileData, createTileData, retainTileData, renderTile,
diff --git a/test/api/render_caching.cpp b/test/api/render_caching.cpp
index cec501f84e..44ed15336e 100644
--- a/test/api/render_caching.cpp
+++ b/test/api/render_caching.cpp
@@ -21,21 +21,19 @@ class FrameObserver : public mbgl::MapObserver {
public:
void onDidFinishRenderingFrame(RenderMode mode) {
if (mode == RenderMode::Full) {
- fprintf(stderr, "onDidFinishRenderingFrame: full\n");
+// fprintf(stderr, "onDidFinishRenderingFrame: full\n");
// mbgl::util::RunLoop::Get()->stop();
} else {
- fprintf(stderr, "onDidFinishRenderingFrame: partial\n");
-
+// fprintf(stderr, "onDidFinishRenderingFrame: partial\n");
}
}
void onDidFinishRenderingMap(RenderMode mode) {
// fprintf(stderr, "onDidFinishRenderingMap\n");
if (mode == RenderMode::Full) {
- fprintf(stderr, "onDidFinishRenderingMap: full\n");
+// fprintf(stderr, "onDidFinishRenderingMap: full\n");
mbgl::util::RunLoop::Get()->stop();
} else {
-
- fprintf(stderr, "onDidFinishRenderingMap: partial\n");
+// fprintf(stderr, "onDidFinishRenderingMap: partial\n");
}
}
};
diff --git a/test/api/render_missing.test.cpp b/test/api/render_missing.test.cpp
index 02c19d359b..54bf2e73c0 100644
--- a/test/api/render_missing.test.cpp
+++ b/test/api/render_missing.test.cpp
@@ -28,6 +28,8 @@ TEST(API, TEST_REQUIRES_SERVER(RenderMissingTile)) {
util::RunLoop loop;
+ Log::setObserver(std::make_unique<FixtureLogObserver>());
+
const auto style = util::read_file("test/fixtures/api/water_missing_tiles.json");
HeadlessBackend backend;
@@ -38,8 +40,6 @@ TEST(API, TEST_REQUIRES_SERVER(RenderMissingTile)) {
ThreadPool threadPool(4);
StubRendererFrontend rendererFrontend { std::make_unique<Renderer>(backend, pixelRatio, fileSource, threadPool), view };
- Log::setObserver(std::make_unique<FixtureLogObserver>());
-
Map map { rendererFrontend, MapObserver::nullObserver(), view.getSize(), pixelRatio, fileSource,
threadPool, MapMode::Still };
diff --git a/test/fixtures/api/assets/raster/10-163-395.png b/test/fixtures/api/assets/raster/10-163-395.png
new file mode 100644
index 0000000000..870512bd55
--- /dev/null
+++ b/test/fixtures/api/assets/raster/10-163-395.png
Binary files differ
diff --git a/test/fixtures/api/assets/raster/6-10-24.png b/test/fixtures/api/assets/raster/6-10-24.png
new file mode 100644
index 0000000000..2c00eb0dff
--- /dev/null
+++ b/test/fixtures/api/assets/raster/6-10-24.png
Binary files differ
diff --git a/test/fixtures/api/cached_raster/expected.png b/test/fixtures/api/cached_raster/expected.png
new file mode 100644
index 0000000000..4635df7409
--- /dev/null
+++ b/test/fixtures/api/cached_raster/expected.png
Binary files differ
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp
index 6c2ac7b0d7..f8ca896ab3 100644
--- a/test/map/map.test.cpp
+++ b/test/map/map.test.cpp
@@ -152,7 +152,7 @@ TEST(Map, Offline) {
test.fileSource.put(Resource::spriteImage(prefix + "sprite", 1.0), expiredItem("sprite.png"));
test.fileSource.put(Resource::tile(prefix + "{z}-{x}-{y}.vector.pbf", 1.0, 0, 0, 0, Tileset::Scheme::XYZ), expiredItem("0-0-0.vector.pbf"));
test.fileSource.put(Resource::glyphs(prefix + "{fontstack}/{range}.pbf", {{"Helvetica"}}, {0, 255}), expiredItem("glyph.pbf"));
- NetworkStatus::Set(NetworkStatus::Status::Offline);
+ test.fileSource.setOnlineStatus(false);
test.map.getStyle().loadURL(prefix + "style.json");
@@ -160,8 +160,6 @@ TEST(Map, Offline) {
test::render(test.map, test.view),
0.0015,
0.1);
-
- NetworkStatus::Set(NetworkStatus::Status::Online);
}
TEST(Map, SetStyleInvalidJSON) {
diff --git a/test/sprite/sprite_loader.test.cpp b/test/sprite/sprite_loader.test.cpp
index ca8162d685..1e291da265 100644
--- a/test/sprite/sprite_loader.test.cpp
+++ b/test/sprite/sprite_loader.test.cpp
@@ -22,7 +22,7 @@ public:
if (spriteLoaded) spriteLoaded(std::move(images));
}
- void onSpriteError(std::exception_ptr error) override {
+ void onSpriteError(std::exception_ptr error, const EventSeverity) override {
if (spriteError) spriteError(error);
}
diff --git a/test/src/mbgl/test/stub_render_source_observer.hpp b/test/src/mbgl/test/stub_render_source_observer.hpp
index ff20fff80c..7aa9e7714a 100644
--- a/test/src/mbgl/test/stub_render_source_observer.hpp
+++ b/test/src/mbgl/test/stub_render_source_observer.hpp
@@ -13,9 +13,12 @@ public:
if (tileChanged) tileChanged(source, tileID);
};
- void
- onTileError(RenderSource& source, const OverscaledTileID& tileID, std::exception_ptr error) override {
- if (tileError) tileError(source, tileID, error);
+ void onTileError(RenderSource& source,
+ const OverscaledTileID& tileID,
+ std::exception_ptr error,
+ EventSeverity) override {
+ if (tileError)
+ tileError(source, tileID, error);
}
std::function<void (RenderSource&, const OverscaledTileID&)> tileChanged;
diff --git a/test/src/mbgl/test/stub_style_observer.hpp b/test/src/mbgl/test/stub_style_observer.hpp
index b97911cdb0..f8b19aeaff 100644
--- a/test/src/mbgl/test/stub_style_observer.hpp
+++ b/test/src/mbgl/test/stub_style_observer.hpp
@@ -18,7 +18,7 @@ public:
if (sourceChanged) sourceChanged(source);
}
- void onSourceError(Source& source, std::exception_ptr error) override {
+ void onSourceError(Source& source, std::exception_ptr error, EventSeverity) override {
if (sourceError) sourceError(source, error);
}
@@ -26,7 +26,7 @@ public:
if (sourceDescriptionChanged) sourceDescriptionChanged(source);
}
- void onResourceError(std::exception_ptr error) override {
+ void onResourceError(std::exception_ptr error, EventSeverity) override {
if (resourceError) resourceError(error);
};
diff --git a/test/src/mbgl/test/stub_tile_observer.hpp b/test/src/mbgl/test/stub_tile_observer.hpp
index 43ae4d8360..720ee8739f 100644
--- a/test/src/mbgl/test/stub_tile_observer.hpp
+++ b/test/src/mbgl/test/stub_tile_observer.hpp
@@ -13,7 +13,7 @@ public:
if (tileChanged) tileChanged(tile);
}
- void onTileError(Tile& tile, std::exception_ptr error) override {
+ void onTileError(Tile& tile, std::exception_ptr error, EventSeverity) override {
if (tileError) tileError(tile, error);
}
diff --git a/test/src/mbgl/test/util.cpp b/test/src/mbgl/test/util.cpp
index 0b1034e315..8b3db8bd95 100644
--- a/test/src/mbgl/test/util.cpp
+++ b/test/src/mbgl/test/util.cpp
@@ -100,7 +100,10 @@ Server::~Server() {
PremultipliedImage render(Map& map, OffscreenView& view) {
PremultipliedImage result;
- map.renderStill([&](std::exception_ptr) {
+ map.renderStill([&](std::exception_ptr err) {
+ if (err) {
+ std::rethrow_exception(err);
+ }
result = view.readStillImage();
});
diff --git a/test/text/glyph_loader.test.cpp b/test/text/glyph_loader.test.cpp
index 41a65778f7..e06fbcb314 100644
--- a/test/text/glyph_loader.test.cpp
+++ b/test/text/glyph_loader.test.cpp
@@ -15,8 +15,12 @@ public:
if (glyphsLoaded) glyphsLoaded(fontStack, glyphRange);
}
- void onGlyphsError(const FontStack& fontStack, const GlyphRange& glyphRange, std::exception_ptr error) override {
- if (glyphsError) glyphsError(fontStack, glyphRange, error);
+ void onGlyphsError(const FontStack& fontStack,
+ const GlyphRange& glyphRange,
+ std::exception_ptr error,
+ const EventSeverity) override {
+ if (glyphsError)
+ glyphsError(fontStack, glyphRange, error);
}
std::function<void (const FontStack&, const GlyphRange&)> glyphsLoaded;
diff --git a/test/tile/geojson_tile.test.cpp b/test/tile/geojson_tile.test.cpp
index 31fb8c1fd0..f476628663 100644
--- a/test/tile/geojson_tile.test.cpp
+++ b/test/tile/geojson_tile.test.cpp
@@ -68,12 +68,12 @@ TEST(GeoJSONTile, Issue7648) {
tile.setObserver(&observer);
tile.setPlacementConfig({});
- while (!tile.isComplete()) {
+ while (!tile.isLoaded()) {
test.loop.runOnce();
}
tile.updateData(features);
- while (!tile.isComplete()) {
+ while (!tile.isLoaded()) {
test.loop.runOnce();
}
}
diff --git a/test/tile/raster_tile.test.cpp b/test/tile/raster_tile.test.cpp
index c32ee232b2..450438dd01 100644
--- a/test/tile/raster_tile.test.cpp
+++ b/test/tile/raster_tile.test.cpp
@@ -47,7 +47,6 @@ TEST(RasterTile, setError) {
tile.setError(std::make_exception_ptr(std::runtime_error("test")), 0);
EXPECT_FALSE(tile.isRenderable());
EXPECT_TRUE(tile.isLoaded());
- EXPECT_TRUE(tile.isComplete());
}
TEST(RasterTile, onError) {
@@ -56,7 +55,6 @@ TEST(RasterTile, onError) {
tile.onError(std::make_exception_ptr(std::runtime_error("test")), 0);
EXPECT_FALSE(tile.isRenderable());
EXPECT_TRUE(tile.isLoaded());
- EXPECT_TRUE(tile.isComplete());
}
TEST(RasterTile, onParsed) {
@@ -65,7 +63,6 @@ TEST(RasterTile, onParsed) {
tile.onParsed(std::make_unique<RasterBucket>(PremultipliedImage{}), 0);
EXPECT_TRUE(tile.isRenderable());
EXPECT_TRUE(tile.isLoaded());
- EXPECT_TRUE(tile.isComplete());
}
TEST(RasterTile, onParsedEmpty) {
@@ -74,5 +71,4 @@ TEST(RasterTile, onParsedEmpty) {
tile.onParsed(nullptr, 0);
EXPECT_FALSE(tile.isRenderable());
EXPECT_TRUE(tile.isLoaded());
- EXPECT_TRUE(tile.isComplete());
}
diff --git a/test/tile/vector_tile.test.cpp b/test/tile/vector_tile.test.cpp
index da9512bc48..30dfbfad21 100644
--- a/test/tile/vector_tile.test.cpp
+++ b/test/tile/vector_tile.test.cpp
@@ -53,7 +53,6 @@ TEST(VectorTile, setError) {
tile.setError(std::make_exception_ptr(std::runtime_error("test")), 0);
EXPECT_FALSE(tile.isRenderable());
EXPECT_TRUE(tile.isLoaded());
- EXPECT_TRUE(tile.isComplete());
}
TEST(VectorTile, onError) {
@@ -62,7 +61,6 @@ TEST(VectorTile, onError) {
tile.onError(std::make_exception_ptr(std::runtime_error("test")), 0);
EXPECT_FALSE(tile.isRenderable());
EXPECT_TRUE(tile.isLoaded());
- EXPECT_TRUE(tile.isComplete());
}
TEST(VectorTile, Issue7615) {