]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/core/radius.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / geometry / test / core / radius.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 // Unit Test
3
4 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
6 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
7
8 // This file was modified by Oracle on 2014.
9 // Modifications copyright (c) 2014 Oracle and/or its affiliates.
10
11 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
12
13 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
14 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
15
16 // Use, modification and distribution is subject to the Boost Software License,
17 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
18 // http://www.boost.org/LICENSE_1_0.txt)
19
20
21 #include <geometry_test_common.hpp>
22
23 #include <boost/geometry/core/cs.hpp>
24 #include <boost/geometry/core/radius.hpp>
25 #include <boost/geometry/core/srs.hpp>
26
27 #include <boost/geometry/algorithms/make.hpp>
28
29
30 template <std::size_t I, typename G>
31 void test_get_set()
32 {
33 typedef typename bg::radius_type<G>::type radius_type;
34
35 G g;
36 bg::set_radius<I>(g, radius_type(5));
37
38 radius_type x = bg::get_radius<I>(g);
39
40 BOOST_CHECK_CLOSE(double(x), 5.0, 0.0001);
41 }
42
43 template <typename T>
44 void test_all()
45 {
46 typedef bg::srs::spheroid<T> Sd;
47 test_get_set<0, Sd>();
48 test_get_set<2, Sd>();
49
50 typedef bg::srs::sphere<T> Se;
51 test_get_set<0, Se>();
52 }
53
54
55 int test_main(int, char* [])
56 {
57 test_all<int>();
58 test_all<float>();
59 test_all<double>();
60
61 return 0;
62 }