mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 13:34:10 +00:00
[test][is_valid] add as test case the polygon used in the documentation
example for is_valid
This commit is contained in:
parent
512b07e85d
commit
f2c8ccefca
@ -606,6 +606,27 @@ void test_open_polygons()
|
||||
false);
|
||||
}
|
||||
|
||||
template <typename Point>
|
||||
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<Point> CCW_CG;
|
||||
|
||||
CCW_CG poly;
|
||||
|
||||
typedef validity_tester_areal<true> tester;
|
||||
typedef test_valid<tester, CCW_CG> test;
|
||||
|
||||
test::apply(from_wkt<CCW_CG>("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<point_type, allow_duplicates>();
|
||||
test_open_polygons<point_type, do_not_allow_duplicates>();
|
||||
test_doc_example_polygon<point_type>();
|
||||
}
|
||||
|
||||
template <typename Point, bool AllowDuplicates>
|
||||
|
Loading…
x
Reference in New Issue
Block a user