]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/geometry/test/algorithms/set_operations/difference/test_difference_linear_linear.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / geometry / test / algorithms / set_operations / difference / test_difference_linear_linear.hpp
index 258d5cfb433a077c28d1b4162cf1f7b77fbd43b5..14f6b039a2c3f51893cada69aabaaea0e074610e 100644 (file)
@@ -1,11 +1,12 @@
 // Boost.Geometry (aka GGL, Generic Geometry Library)
 
-// Copyright (c) 2014-2015, Oracle and/or its affiliates.
+// Copyright (c) 2014-2017, Oracle and/or its affiliates.
+// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
 
 // Licensed under the Boost Software License version 1.0.
 // http://www.boost.org/users/license.html
 
-// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
 
 #ifndef BOOST_GEOMETRY_TEST_DIFFERENCE_LINEAR_LINEAR_HPP
 #define BOOST_GEOMETRY_TEST_DIFFERENCE_LINEAR_LINEAR_HPP
 //==================================================================
 //==================================================================
 
+template <typename Geometry1, typename Geometry2, typename MultiLineString>
+inline void check_result(Geometry1 const& geometry1,
+                         Geometry2 const& geometry2,
+                         MultiLineString const& mls_output,
+                         MultiLineString const& mls_diff,
+                         std::string const& case_id,
+                         double tolerance = std::numeric_limits<double>::epsilon())
+{
+    BOOST_CHECK_MESSAGE( equals::apply(mls_diff, mls_output, tolerance),
+                         "case id: " << case_id
+                         << ", difference L/L: " << bg::wkt(geometry1)
+                         << " " << bg::wkt(geometry2)
+                         << " -> Expected: " << bg::wkt(mls_diff)
+                         << std::setprecision(20)
+                         << " computed: " << bg::wkt(mls_output) );
+}
+
 template
 <
     typename Geometry1, typename Geometry2,
@@ -52,6 +70,22 @@ private:
         linestring_vector ls_vector_output;
         linestring_deque ls_deque_output;
 
+        // Check strategy passed explicitly
+        typedef typename bg::strategy::relate::services::default_strategy
+            <
+                Geometry1, Geometry2
+            >::type strategy_type;
+        bg::difference(geometry1, geometry2, mls_output, strategy_type());
+
+        if (reverse_output_for_checking)
+        {
+            bg::reverse(mls_output);
+        }
+
+        check_result(geometry1, geometry2, mls_output, mls_diff, case_id, tolerance);
+
+        // Check normal behaviour
+        bg::clear(mls_output);
         bg::difference(geometry1, geometry2, mls_output);
 
         if ( reverse_output_for_checking ) 
@@ -59,14 +93,8 @@ private:
             bg::reverse(mls_output);
         }
 
-        BOOST_CHECK_MESSAGE( equals::apply(mls_diff, mls_output, tolerance),
-                             "case id: " << case_id
-                             << ", difference L/L: " << bg::wkt(geometry1)
-                             << " " << bg::wkt(geometry2)
-                             << " -> Expected: " << bg::wkt(mls_diff)
-                             << std::setprecision(20)
-                             << " computed: " << bg::wkt(mls_output) );
-
+        check_result(geometry1, geometry2, mls_output, mls_diff, case_id, tolerance);
+        
         set_operation_output("difference", case_id,
                              geometry1, geometry2, mls_output);