diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2016-08-24 17:38:06 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2016-08-24 20:02:31 +0300 |
commit | c98f4f476bd590bdfd78409d428459e40347302a (patch) | |
tree | 6c4bc14970ba0bf199e36156e3bc529a6d054a61 /test/style | |
parent | 646528bc53c37950b556be825de1ba9fa5303be3 (diff) | |
download | qtlocation-mapboxgl-c98f4f476bd590bdfd78409d428459e40347302a.tar.gz |
[core] Emit MapChangeDidFailLoadingMap when the style cannot be loaded or parsed
Currently this signal is never emitted, which can cause the Still mode
to starve in case of an invalid style or failed request.
Diffstat (limited to 'test/style')
-rw-r--r-- | test/style/style_parser.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/style/style_parser.cpp b/test/style/style_parser.cpp index b7806c11cc..3e1149c997 100644 --- a/test/style/style_parser.cpp +++ b/test/style/style_parser.cpp @@ -4,6 +4,7 @@ #include <mbgl/style/parser.hpp> #include <mbgl/util/io.hpp> #include <mbgl/util/enum.hpp> +#include <mbgl/util/string.hpp> #include <mbgl/util/tileset.hpp> #include <rapidjson/document.h> @@ -32,7 +33,11 @@ TEST_P(StyleParserTest, ParseStyle) { Log::setObserver(std::unique_ptr<Log::Observer>(observer)); style::Parser parser; - parser.parse(util::read_file(base + ".style.json")); + auto error = parser.parse(util::read_file(base + ".style.json")); + + if (error) { + Log::Error(Event::ParseStyle, "Failed to parse style: %s", util::toString(error).c_str()); + } for (auto it = infoDoc.MemberBegin(), end = infoDoc.MemberEnd(); it != end; it++) { const std::string name { it->name.GetString(), it->name.GetStringLength() }; |