summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2015-05-19 01:13:46 +0300
committerThiago Marcos P. Santos <thiago@mapbox.com>2015-05-22 10:44:18 +0300
commitda81211feaffd89319330774b61b261b939dde33 (patch)
tree18a26cabee3d486f7684590c7b9d981c39661f4f /test
parentb304b20073556d442764696dbe5ac09d5462ada0 (diff)
downloadqtlocation-mapboxgl-da81211feaffd89319330774b61b261b939dde33.tar.gz
Add callback for error notifications on renderStill()
The callback will be called when any of the resources requested from the network failed to load. There is not recovery implemented yet, so the closest thing to reseting the Map object and reloading all the resources would be setting a new style.
Diffstat (limited to 'test')
-rw-r--r--test/api/repeated_render.cpp4
-rw-r--r--test/headless/headless.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/test/api/repeated_render.cpp b/test/api/repeated_render.cpp
index ce7e6cbb0b..f563b00071 100644
--- a/test/api/repeated_render.cpp
+++ b/test/api/repeated_render.cpp
@@ -28,7 +28,7 @@ TEST(API, RepeatedRender) {
map.resize(128, 512, 1);
map.setStyleJSON(style, "test/suite");
std::promise<std::unique_ptr<const StillImage>> promise;
- map.renderStill([&promise](std::unique_ptr<const StillImage> image) {
+ map.renderStill([&promise](std::exception_ptr, std::unique_ptr<const StillImage> image) {
promise.set_value(std::move(image));
});
auto result = promise.get_future().get();
@@ -42,7 +42,7 @@ TEST(API, RepeatedRender) {
map.resize(512, 512, 2);
map.setStyleJSON(style, "TEST_DATA/suite");
std::promise<std::unique_ptr<const StillImage>> promise;
- map.renderStill([&promise](std::unique_ptr<const StillImage> image) {
+ map.renderStill([&promise](std::exception_ptr, std::unique_ptr<const StillImage> image) {
promise.set_value(std::move(image));
});
auto result = promise.get_future().get();
diff --git a/test/headless/headless.cpp b/test/headless/headless.cpp
index a02062dbdd..8dfed0383b 100644
--- a/test/headless/headless.cpp
+++ b/test/headless/headless.cpp
@@ -152,7 +152,7 @@ TEST_P(HeadlessTest, render) {
map.setLatLngZoom(mbgl::LatLng(latitude, longitude), zoom);
map.setBearing(bearing);
- map.renderStill([&](std::unique_ptr<const StillImage> image) {
+ map.renderStill([&](std::exception_ptr, std::unique_ptr<const StillImage> image) {
const std::string png = util::compress_png(image->width, image->height, image->pixels.get());
util::write_file("test/suite/tests/" + base + "/" + name + "/actual.png", png);
promise.set_value();