From 9f35e6282994ece48ec0140f72a08c1f1cd0f83d Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Thu, 21 Apr 2016 12:27:28 +0200 Subject: [PATCH] [T/GL] Test copy constructor of Polygon. --- Tests/GeoLib/TestPolygon.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Tests/GeoLib/TestPolygon.cpp b/Tests/GeoLib/TestPolygon.cpp index e7da88e7351..f986e105784 100644 --- a/Tests/GeoLib/TestPolygon.cpp +++ b/Tests/GeoLib/TestPolygon.cpp @@ -204,3 +204,14 @@ TEST_F(PolygonTest, isPolylineInPolygon) for (std::size_t k(0); k<pnts.size(); k++) delete pnts[k]; } + +TEST_F(PolygonTest, CopyConstructor) +{ + GeoLib::Polygon polygon_copy(*_polygon); + ASSERT_EQ(_polygon->getNumberOfSegments(), polygon_copy.getNumberOfSegments()); + + // Check if all line segments of the original polygon are contained in the + // copy + for (auto const& segment : *_polygon) + ASSERT_TRUE(polygon_copy.containsSegment(segment)); +} -- GitLab