unit test - cope with incorrectly encoded geometries
This commit is contained in:
parent
4cf6ce1866
commit
d05c13d849
2 changed files with 22 additions and 1 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 5038563194e75b95af155a337ce48f6478534022
|
Subproject commit e0058873df6a16b1eeef15c3ae0be09d3c0d700b
|
|
@ -95,6 +95,27 @@ TEST_CASE("SVG parser") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SECTION("SVG - cope with erroneous geometries")
|
||||||
|
{
|
||||||
|
std::string svg_name("./test/data/svg/errors.svg");
|
||||||
|
std::ifstream in(svg_name.c_str());
|
||||||
|
std::string svg_str((std::istreambuf_iterator<char>(in)),
|
||||||
|
std::istreambuf_iterator<char>());
|
||||||
|
|
||||||
|
using namespace mapnik::svg;
|
||||||
|
mapnik::svg_storage_type path;
|
||||||
|
vertex_stl_adapter<svg_path_storage> stl_storage(path.source());
|
||||||
|
svg_path_adapter svg_path(stl_storage);
|
||||||
|
svg_converter_type svg(svg_path, path.attributes());
|
||||||
|
svg_parser p(svg);
|
||||||
|
|
||||||
|
if (!p.parse_from_string(svg_str))
|
||||||
|
{
|
||||||
|
auto const& errors = p.error_messages();
|
||||||
|
REQUIRE(errors.size() == 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SECTION("SVG parser display=none")
|
SECTION("SVG parser display=none")
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue