// Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test // Copyright (c) 2016 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fisikopoulos, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include #include #include template void test_all() { // Simple test_geometry >("POLYGON((0 0,3 4,4 3,0 0))", 5 + sqrt(2.0) + 5); // Non-simple test_geometry >("POLYGON((0 0,3 4,4 3,0 3,0 0))", 5 + sqrt(2.0) + 4 + 3); // With holes test_geometry >("POLYGON((0 0,3 4,4 3,0 0),\ (2 2,3 4,3 3,2 2))", 5 + sqrt(2.0) + 5 + sqrt(5.0) + 1 + sqrt(2.0)); // Repeated points test_geometry >("POLYGON((0 0,3 4,3 4,3 4,4 3,4 3,\ 4 3,4 3,4 3,4 3,0 3,0 0))", 5 + sqrt(2.0) + 4 + 3); // Multipolygon test_geometry > > ( "MULTIPOLYGON(((0 0,3 4,4 3,0 0)), ((0 0,3 4,4 3,0 3,0 0)))", 5 + sqrt(2.0) + 5 + 5 + sqrt(2.0) + 4 + 3 ); // Geometries with perimeter zero test_geometry

("POINT(0 0)", 0); test_geometry >("LINESTRING(0 0,3 4,4 3)", 0); } template void test_empty_input() { test_empty_input(bg::model::polygon

()); test_empty_input(bg::model::multi_polygon >()); } int test_main(int, char* []) { test_all >(); test_all >(); test_all >(); #if defined(HAVE_TTMATH) test_all >(); #endif // test_empty_input >(); return 0; }