]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/geometry/test/strategies/vincenty.cpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / libs / geometry / test / strategies / vincenty.cpp
index 14a8c0acd44d6eef09faa466a1299b268cbab799..279db467789f3570d9f6f0b0c98f9c751296d748 100644 (file)
@@ -5,8 +5,8 @@
 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
 
-// This file was modified by Oracle on 2014, 2015, 2016.
-// Modifications copyright (c) 2014-2016 Oracle and/or its affiliates.
+// This file was modified by Oracle on 2014, 2015, 2016, 2017.
+// Modifications copyright (c) 2014-2017 Oracle and/or its affiliates.
 
 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
 
 
 #include <boost/concept_check.hpp>
 
-#include <boost/geometry/strategies/geographic/distance_vincenty.hpp>
-#include <boost/geometry/strategies/geographic/side_vincenty.hpp>
+#include <boost/geometry/algorithms/assign.hpp>
+#include <boost/geometry/algorithms/distance.hpp>
 #include <boost/geometry/formulas/vincenty_inverse.hpp>
 #include <boost/geometry/formulas/vincenty_direct.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 <boost/geometry/srs/spheroid.hpp>
+#include <boost/geometry/strategies/concepts/distance_concept.hpp>
+#include <boost/geometry/strategies/geographic/distance_vincenty.hpp>
+#include <boost/geometry/strategies/geographic/side_vincenty.hpp>
+
 #include <test_common/test_point.hpp>
 
 #ifdef HAVE_TTMATH
@@ -163,9 +164,10 @@ void test_vincenty(double lon1, double lat1, double lon2, double lat2,
         //check_deg("direct_az21_deg", direct_az21_deg, az21_deg, tolerance, error);
     }
 
-    // distance strategy
+    // distance strategies
     {
         typedef bg::strategy::distance::vincenty<Spheroid> vincenty_type;
+        typedef bg::strategy::distance::geographic<bg::strategy::vincenty, Spheroid> geographic_type;
 
         BOOST_CONCEPT_ASSERT(
             (
@@ -173,6 +175,7 @@ void test_vincenty(double lon1, double lat1, double lon2, double lat2,
             );
 
         vincenty_type vincenty(spheroid);
+        geographic_type geographic(spheroid);
         typedef typename bg::strategy::distance::services::return_type<vincenty_type, P1, P2>::type return_type;
 
         P1 p1;
@@ -182,6 +185,7 @@ void test_vincenty(double lon1, double lat1, double lon2, double lat2,
         bg::assign_values(p2, lon2, lat2);
         
         BOOST_CHECK_CLOSE(vincenty.apply(p1, p2), return_type(expected_distance), tolerance);
+        BOOST_CHECK_CLOSE(geographic.apply(p1, p2), return_type(expected_distance), tolerance);
         BOOST_CHECK_CLOSE(bg::distance(p1, p2, vincenty), return_type(expected_distance), tolerance);
     }
 }
@@ -212,8 +216,10 @@ void test_side(double lon1, double lat1,
     typedef bg::srs::spheroid<rtype> stype;
 
     typedef bg::strategy::side::vincenty<stype> strategy_type;
+    typedef bg::strategy::side::geographic<bg::strategy::vincenty, stype> strategy2_type;
 
     strategy_type strategy;
+    strategy2_type strategy2;
 
     PS p1, p2;
     P p;
@@ -223,8 +229,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>