]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/geometries/point_xyz.cpp
f52484a2a5e729672f344f0a9bd8e5181d97fc31
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2020 Digvijay Janartha, Hamirpur, India.
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)
11 #include <geometry_test_common.hpp>
13 #include <boost/geometry/algorithms/make.hpp>
14 #include <boost/geometry/geometries/point.hpp>
15 #include <boost/geometry/geometries/point_xyz.hpp>
17 #include <test_common/test_point.hpp>
21 bg::model::d3::point_xyz
<T
> create_point_xyz()
26 return bg::model::d3::point_xyz
<T
>(t1
, t2
, t3
);
29 template <typename P
, typename T
>
30 void check_point_xyz(P
& to_check
, T x
, T y
, T z
)
32 BOOST_CHECK_EQUAL(bg::get
<0>(to_check
), x
);
33 BOOST_CHECK_EQUAL(bg::get
<1>(to_check
), y
);
34 BOOST_CHECK_EQUAL(bg::get
<2>(to_check
), z
);
35 BOOST_CHECK_EQUAL(to_check
.x(), x
);
36 BOOST_CHECK_EQUAL(to_check
.y(), y
);
37 BOOST_CHECK_EQUAL(to_check
.z(), z
);
41 void test_default_constructor()
43 bg::model::d3::point_xyz
<T
> p(create_point_xyz
<T
>());
44 check_point_xyz(p
, 1, 2, 3);
48 void test_copy_constructor()
50 bg::model::d3::point_xyz
<T
> p
= create_point_xyz
<T
>();
51 check_point_xyz(p
, 1, 2, 3);
55 void test_copy_assignment()
57 bg::model::d3::point_xyz
<T
> p(create_point_xyz
<T
>());
61 check_point_xyz(p
, 4, 5, 6);
67 test_default_constructor
<T
>();
68 test_copy_constructor
<T
>();
69 test_copy_assignment
<T
>();
72 int test_main(int, char* [])