]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/algorithms/length/length.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
6 // Use, modification and distribution is subject to the Boost Software License,
7 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
10 #include <algorithms/test_length.hpp>
12 #include <boost/geometry/geometries/geometries.hpp>
13 #include <boost/geometry/geometries/point_xy.hpp>
14 #include <boost/geometry/geometries/adapted/std_pair_as_segment.hpp>
16 #include <test_geometries/all_custom_linestring.hpp>
17 #include <test_geometries/wrapped_boost_array.hpp>
24 test_geometry
<std::pair
<P
, P
> >("LINESTRING(0 0,3 4)", 5);
27 test_geometry
<bg::model::linestring
<P
> >("LINESTRING(0 0,3 4,4 3)", 5 + sqrt(2.0));
28 test_geometry
<all_custom_linestring
<P
> >("LINESTRING(0 0,3 4,4 3)", 5 + sqrt(2.0));
29 test_geometry
<test::wrapped_boost_array
<P
, 3> >("LINESTRING(0 0,3 4,4 3)", 5 + sqrt(2.0));
31 // Geometries with length zero
32 test_geometry
<P
>("POINT(0 0)", 0);
33 test_geometry
<bg::model::polygon
<P
> >("POLYGON((0 0,0 1,1 1,1 0,0 0))", 0);
37 void test_empty_input()
39 test_empty_input(bg::model::linestring
<P
>());
42 int test_main(int, char* [])
44 test_all
<bg::model::d2::point_xy
<int> >();
45 test_all
<bg::model::d2::point_xy
<float> >();
46 test_all
<bg::model::d2::point_xy
<double> >();
48 // test_empty_input<bg::model::d2::point_xy<int> >();