From 39f497ded6bd5f2d938d863f18d64b58d96d7593 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 29 Jun 2016 09:19:28 -0700 Subject: [PATCH] re-enable centroid test which appears to be passing --- test/unit/geometry/centroid.cpp | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/test/unit/geometry/centroid.cpp b/test/unit/geometry/centroid.cpp index ad9f19ec2..4549bec9b 100644 --- a/test/unit/geometry/centroid.cpp +++ b/test/unit/geometry/centroid.cpp @@ -177,25 +177,25 @@ SECTION("multi-polygon") { REQUIRE(centroid.y == 1); } -//SECTION("multi-polygon: one component empty") { -// -// mapnik::geometry::multi_polygon geom; -// mapnik::geometry::polygon poly; -// mapnik::geometry::linear_ring ring; -// ring.emplace_back(0, 0); -// ring.emplace_back(1, 0); -// ring.emplace_back(1, 1); -// ring.emplace_back(0, 1); -// ring.emplace_back(0, 0); -// poly.push_back(std::move(ring)); -// geom.emplace_back(std::move(poly)); -// geom.emplace_back(); -// geom.back().emplace_back(); -// mapnik::geometry::point centroid; -// REQUIRE(mapnik::geometry::centroid(geom, centroid)); -// REQUIRE(centroid.x == 0.5); -// REQUIRE(centroid.y == 0.5); -//} +SECTION("multi-polygon: one component empty") { + + mapnik::geometry::multi_polygon geom; + mapnik::geometry::polygon poly; + mapnik::geometry::linear_ring ring; + ring.emplace_back(0, 0); + ring.emplace_back(1, 0); + ring.emplace_back(1, 1); + ring.emplace_back(0, 1); + ring.emplace_back(0, 0); + poly.push_back(std::move(ring)); + geom.emplace_back(std::move(poly)); + geom.emplace_back(); + geom.back().emplace_back(); + mapnik::geometry::point centroid; + REQUIRE(mapnik::geometry::centroid(geom, centroid)); + REQUIRE(centroid.x == 0.5); + REQUIRE(centroid.y == 0.5); +} SECTION("empty multi-polygon") {