diff --git a/Tests/GeoLib/TestPolygon.cpp b/Tests/GeoLib/TestPolygon.cpp index e7da88e73510e36c51594559e03e6cb7c5fa4ba1..f986e105784bd0d50a520c4611d1105c2aa19b57 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)); +}