]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/geometry/test/core/coordinate_dimension.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / geometry / test / core / coordinate_dimension.cpp
CommitLineData
7c673cae
FG
1// Boost.Geometry (aka GGL, Generic Geometry Library)
2// Unit Test
3
4// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
5
1e59de90
TL
6// This file was modified by Oracle on 2021.
7// Modifications copyright (c) 2021, Oracle and/or its affiliates.
8// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
9
7c673cae
FG
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)
13
14
15#include <geometry_test_common.hpp>
16
17
18#include <boost/geometry/core/coordinate_dimension.hpp>
19
20
21#include <boost/geometry/geometries/geometries.hpp>
22
23#include <boost/geometry/geometries/adapted/c_array.hpp>
24#include <boost/geometry/geometries/adapted/boost_tuple.hpp>
25
26#include <boost/geometry/geometries/register/linestring.hpp>
27
28#include <vector>
29#include <deque>
30
31BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian)
32BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian)
33
34BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector)
35BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque)
36
37
1e59de90 38template <typename G, size_t Expected>
7c673cae
FG
39void test_geometry()
40{
41 BOOST_CHECK_EQUAL(bg::dimension<G>::type::value, Expected);
42}
43
44template <typename P, size_t D>
45void test_all()
46{
47 test_geometry<P, D>();
48 test_geometry<P const, D>();
49 test_geometry<bg::model::linestring<P> , D>();
50 test_geometry<bg::model::ring<P> , D>();
51 test_geometry<bg::model::polygon<P> , D>();
52 test_geometry<bg::model::box<P> , D>();
53 test_geometry<bg::model::segment<P> , D>();
54 test_geometry<bg::model::referring_segment<P const> , D>();
55
56 test_geometry<std::vector<P>, D>();
57 test_geometry<std::deque<P>, D>();
58}
59
60int test_main(int, char* [])
61{
62 test_geometry<int[2], 2>();
63 test_geometry<float[2], 2>();
64 test_geometry<double[2], 2>();
65
66 test_geometry<int[3], 3>();
67 test_geometry<float[3], 3>();
68 test_geometry<double[3], 3>();
69
70 test_geometry<boost::tuple<double, double>, 2>();
71 test_geometry<boost::tuple<double, double, double>, 3>();
72
1e59de90
TL
73 test_all<bg::model::point<int, 2, bg::cs::cartesian>, 2>();
74 test_all<bg::model::point<float, 2, bg::cs::cartesian>, 2>();
75 test_all<bg::model::point<double, 2, bg::cs::cartesian>, 2>();
7c673cae
FG
76
77 return 0;
78}