]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/geometry/test/strategies/andoyer.cpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / libs / geometry / test / strategies / andoyer.cpp
index 2082e8bdf72c4cbc1bf96a142ad97152921559c4..515bbf2e8f91feef1cbfd2faf54ff2113489c2dc 100644 (file)
@@ -6,7 +6,7 @@
 // Copyright (c) 2009-2016 Mateusz Loskot, London, UK.
 
 // This file was modified by Oracle on 2014-2017.
-// Modifications copyright (c) 2014-2016 Oracle and/or its affiliates.
+// Modifications copyright (c) 2014-2017 Oracle and/or its affiliates.
 
 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
 
 #include <boost/concept_check.hpp>
 
+#include <boost/geometry/algorithms/assign.hpp>
+#include <boost/geometry/algorithms/distance.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/srs/spheroid.hpp>
+#include <boost/geometry/strategies/concepts/distance_concept.hpp>
 #include <boost/geometry/strategies/geographic/distance_andoyer.hpp>
 #include <boost/geometry/strategies/geographic/side_andoyer.hpp>
 
-#include <boost/geometry/core/srs.hpp>
-#include <boost/geometry/strategies/strategies.hpp>
-#include <boost/geometry/algorithms/assign.hpp>
-#include <boost/geometry/geometries/point.hpp>
 #include <test_common/test_point.hpp>
 
 #ifdef HAVE_TTMATH
@@ -76,6 +77,7 @@ void test_distance(double lon1, double lat1, double lon2, double lat2, double ex
     typedef bg::srs::spheroid<rtype> stype;
 
     typedef bg::strategy::distance::andoyer<stype> andoyer_type;
+    typedef bg::strategy::distance::geographic<bg::strategy::andoyer, stype> geographic_type;
     typedef bg::formula::andoyer_inverse<rtype, true, false> andoyer_inverse_type;
 
     BOOST_CONCEPT_ASSERT
@@ -84,6 +86,7 @@ void test_distance(double lon1, double lat1, double lon2, double lat2, double ex
         );
 
     andoyer_type andoyer;
+    geographic_type geographic;
     typedef typename bg::strategy::distance
         ::services::return_type<andoyer_type, P1, P2>::type return_type;
 
@@ -94,6 +97,7 @@ void test_distance(double lon1, double lat1, double lon2, double lat2, double ex
     bg::assign_values(p2, lon2, lat2);
 
     return_type d_strategy = andoyer.apply(p1, p2);
+    return_type d_strategy2 = geographic.apply(p1, p2);
     return_type d_function = bg::distance(p1, p2, andoyer);
 
     double diff = bg::math::longitude_distance_signed<bg::degree>(lon1, lon2);
@@ -115,6 +119,7 @@ void test_distance(double lon1, double lat1, double lon2, double lat2, double ex
     }
 
     BOOST_CHECK_CLOSE(d_strategy / 1000.0, expected_km, 0.001);
+    BOOST_CHECK_CLOSE(d_strategy2 / 1000.0, expected_km, 0.001);
     BOOST_CHECK_CLOSE(d_function / 1000.0, expected_km, 0.001);
     BOOST_CHECK_CLOSE(d_formula / 1000.0, expected_km, 0.001);
 }
@@ -197,8 +202,10 @@ void test_side(double lon1, double lat1,
     typedef bg::srs::spheroid<rtype> stype;
 
     typedef bg::strategy::side::andoyer<stype> strategy_type;
+    typedef bg::strategy::side::geographic<bg::strategy::andoyer, stype> strategy2_type;
 
     strategy_type strategy;
+    strategy2_type strategy2;
 
     PS p1, p2;
     P p;
@@ -208,8 +215,10 @@ void test_side(double lon1, double lat1,
     bg::assign_values(p, lon, lat);
 
     int side = strategy.apply(p1, p2, p);
+    int side2 = strategy2.apply(p1, p2, p);
 
     BOOST_CHECK_EQUAL(side, expected_side);
+    BOOST_CHECK_EQUAL(side2, expected_side);
 }
 
 template <typename P1, typename P2>