diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-06-28 13:02:50 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-06-28 16:33:52 +0300 |
commit | 4c896cbb31fcb929b0e57c7bd02e519c267a1be1 (patch) | |
tree | d1cb53b94bb2feea5b84a6aa722d277ca79f8451 /render-test | |
parent | 657e847015b28bff01f85f7adbb2cb2dc417fd12 (diff) | |
download | qtlocation-mapboxgl-4c896cbb31fcb929b0e57c7bd02e519c267a1be1.tar.gz |
[core] Fix error handling in HeadlessFrontend::render()
Diffstat (limited to 'render-test')
-rw-r--r-- | render-test/runner.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/render-test/runner.cpp b/render-test/runner.cpp index 1aa347f1a8..dd6aef3a54 100644 --- a/render-test/runner.cpp +++ b/render-test/runner.cpp @@ -123,8 +123,11 @@ bool TestRunner::runOperations(const std::string& key, TestMetadata& metadata) { // wait if (operationArray[0].GetString() == waitOp) { - frontend.render(map); - + try { + frontend.render(map); + } catch (const std::exception&) { + return false; + } // sleep } else if (operationArray[0].GetString() == sleepOp) { mbgl::util::Timer sleepTimer; @@ -400,7 +403,14 @@ bool TestRunner::run(TestMetadata& metadata) { return false; } - return checkImage(frontend.render(map), metadata); + mbgl::PremultipliedImage image; + try { + image = frontend.render(map); + } catch (const std::exception&) { + return false; + } + + return checkImage(std::move(image), metadata); } void TestRunner::reset() { |