add display=none test

This commit is contained in:
artemp 2015-07-22 15:28:55 +02:00
parent 7aa30a211e
commit 626cb9f47c
2 changed files with 19 additions and 1 deletions

@ -1 +1 @@
Subproject commit 86c5f815a772ccdd30fba98d8caed1954435c2ac
Subproject commit 867d26dbfc536e58abcb25d4db5726a921cccf79

View file

@ -94,6 +94,24 @@ TEST_CASE("SVG parser") {
}
}
SECTION("SVG parser display=none")
{
std::string svg_name("./test/data/svg/invisible.svg");
std::shared_ptr<mapnik::marker const> marker = mapnik::marker_cache::instance().find(svg_name, false);
REQUIRE(marker);
REQUIRE(marker->is<mapnik::marker_svg>());
mapnik::marker_svg const& svg = mapnik::util::get<mapnik::marker_svg>(*marker);
auto bbox = svg.bounding_box();
REQUIRE(bbox == mapnik::box2d<double>(0, 0, 1, 1));
auto storage = svg.get_data();
REQUIRE(storage);
mapnik::svg::vertex_stl_adapter<mapnik::svg::svg_path_storage> stl_storage(storage->source());
mapnik::svg::svg_path_adapter path(stl_storage);
double x,y;
REQUIRE(path.vertex(&x,&y) == mapnik::SEG_END);
}
SECTION("SVG <rect>")
{
//<rect width="20" height="15" style="fill:rgb(0,0,255);stroke-width:1;stroke:rgb(0,0,0)" />