]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/geometries/point_xyz.cpp
00dcc0fd6dca73ecee6b7ebb8f3ed80cd890a257
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2020 Digvijay Janartha, Hamirpur, India.
6 // This file was modified by Oracle on 2020.
7 // Modifications copyright (c) 2020, Oracle and/or its affiliates.
8 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
10 // Use, modification and distribution is subject to the Boost Software License,
11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
12 // http://www.boost.org/LICENSE_1_0.txt)
15 #include <geometry_test_common.hpp>
17 #include <boost/geometry/algorithms/make.hpp>
18 #include <boost/geometry/geometries/point.hpp>
19 #include <boost/geometry/geometries/point_xyz.hpp>
21 #include <test_common/test_point.hpp>
25 bg::model::d3::point_xyz
<T
> create_point_xyz()
30 return bg::model::d3::point_xyz
<T
>(t1
, t2
, t3
);
33 template <typename P
, typename T
>
34 void check_point_xyz(P
& to_check
, T x
, T y
, T z
)
36 BOOST_CHECK_EQUAL(bg::get
<0>(to_check
), x
);
37 BOOST_CHECK_EQUAL(bg::get
<1>(to_check
), y
);
38 BOOST_CHECK_EQUAL(bg::get
<2>(to_check
), z
);
39 BOOST_CHECK_EQUAL(to_check
.x(), x
);
40 BOOST_CHECK_EQUAL(to_check
.y(), y
);
41 BOOST_CHECK_EQUAL(to_check
.z(), z
);
45 void test_default_constructor()
47 bg::model::d3::point_xyz
<T
> p(create_point_xyz
<T
>());
48 check_point_xyz(p
, 1, 2, 3);
52 void test_copy_constructor()
54 bg::model::d3::point_xyz
<T
> p
= create_point_xyz
<T
>();
55 check_point_xyz(p
, 1, 2, 3);
59 void test_copy_assignment()
61 bg::model::d3::point_xyz
<T
> p(create_point_xyz
<T
>());
65 check_point_xyz(p
, 4, 5, 6);
71 typedef bg::model::d3::point_xyz
<T
> P
;
72 constexpr P p
= P(1, 2, 3);
73 constexpr T c
= bg::get
<0>(p
);
74 BOOST_CHECK_EQUAL(c
, 1);
75 check_point_xyz(p
, 1, 2, 3);
81 test_default_constructor
<T
>();
82 test_copy_constructor
<T
>();
83 test_copy_assignment
<T
>();
87 int test_main(int, char* [])