diff --git a/Generator/test/Generator/random_hull_test.cpp b/Generator/test/Generator/random_hull_test.cpp new file mode 100644 index 00000000000..0645d336bb4 --- /dev/null +++ b/Generator/test/Generator/random_hull_test.cpp @@ -0,0 +1,35 @@ + +#include +#include +#include +#include + + + typedef CGAL::Exact_predicates_inexact_constructions_kernel K; + typedef K::Point_2 Point_2; + typedef CGAL::Polygon_2 Polygon_2; + +int +main( ) +{ + + + Polygon_2 p; + int n( 1000); + boost::random::mt19937 gen; + + // build random hull from n random points in a disc: + random_convex_hull_in_disc_2(n,1.0,gen,std::back_inserter(p),K()); + + // check convexity: + if ( ! p.is_convex()) { + std::cerr << "ERROR: polygon is not convex." << std::endl; + return 1; + } + return 0; +} // int main( ) + +// ---------------------------------------------------------------------------- +// ** EOF +// ---------------------------------------------------------------------------- +