From f2c8ccefca162b654c884e1b4f994920b73bcbcd Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Wed, 2 Jul 2014 11:28:40 +0300 Subject: [PATCH] [test][is_valid] add as test case the polygon used in the documentation example for is_valid --- test/algorithms/is_valid.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/algorithms/is_valid.cpp b/test/algorithms/is_valid.cpp index 03b93bbe5..46c2c6772 100644 --- a/test/algorithms/is_valid.cpp +++ b/test/algorithms/is_valid.cpp @@ -606,6 +606,27 @@ void test_open_polygons() false); } +template +inline void test_doc_example_polygon() +{ +#ifdef BOOST_GEOMETRY_TEST_DEBUG + std::cout << std::endl << std::endl; + std::cout << "************************************" << std::endl; + std::cout << " is_valid: doc example polygon " << std::endl; + std::cout << "************************************" << std::endl; +#endif + + typedef bg::model::polygon CCW_CG; + + CCW_CG poly; + + typedef validity_tester_areal tester; + typedef test_valid test; + + test::apply(from_wkt("POLYGON((0 0,0 10,10 10,10 0,0 0),(0 0,9 1,9 2,0 0),(0 0,2 9,1 9,0 0),(2 9,9 2,9 9,2 9))"), + false); +} + BOOST_AUTO_TEST_CASE( test_is_valid_polygon ) { bool const allow_duplicates = true; @@ -613,6 +634,7 @@ BOOST_AUTO_TEST_CASE( test_is_valid_polygon ) test_open_polygons(); test_open_polygons(); + test_doc_example_polygon(); } template