]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/geometry/test/geometries/point.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / geometry / test / geometries / point.cpp
index 23a4151a47976dc3a1783cc6607b5b1dc0887430..26ef6a219ba329fc82c06365ef554f824fa23077 100644 (file)
@@ -3,6 +3,10 @@
 
 // Copyright (c) 2020 Digvijay Janartha, Hamirpur, India.
 
+// This file was modified by Oracle on 2020.
+// Modifications copyright (c) 2020, Oracle and/or its affiliates.
+// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
+
 // Use, modification and distribution is subject to the Boost Software License,
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
@@ -72,6 +76,20 @@ void test_concept()
     boost::ignore_unused<T1>();
 }
 
+template <typename T, typename CS>
+void test_constexpr()
+{
+    typedef bg::model::point<T, 3, CS> P;
+    constexpr P p1 = P(1, 2, 3);
+    constexpr P p2 = P(4, 5);
+    constexpr T c1 = bg::get<0>(p1);
+    constexpr T c2 = bg::get<2>(p2);
+    BOOST_CHECK_EQUAL(c1, 1);
+    BOOST_CHECK_EQUAL(c2, 0);
+    check_point(p1, 1, 2, 3);
+    check_point(p2, 4, 5, 0);
+}
+
 template <typename T, typename CS>
 void test_all()
 {
@@ -79,6 +97,7 @@ void test_all()
     test_copy_constructor<T, CS>();
     test_copy_assignment<T, CS>();
     test_concept<T, CS>();
+    test_constexpr<T, CS>();
 }
 
 template <typename CS>
@@ -89,7 +108,6 @@ void test_cs()
     test_all<double, CS>();
 }
 
-
 int test_main(int, char* [])
 {   
     test_cs<bg::cs::cartesian>();