]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/geometry/test/algorithms/set_operations/union/test_union_linear_linear.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / geometry / test / algorithms / set_operations / union / test_union_linear_linear.hpp
index 1b6dda37c35e2636486cdd5a9f55fa1d4e7761f0..e4357b60321fafd79dd0dabdd8352f075d77578b 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_UNION_LINEAR_LINEAR_HPP
 #define BOOST_GEOMETRY_TEST_UNION_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_union,
+                         std::string const& case_id,
+                         double tolerance)
+{
+    BOOST_CHECK_MESSAGE( equals::apply(mls_union, mls_output, tolerance),
+                         "case id: " << case_id
+                         << ", union L/L: " << bg::wkt(geometry1)
+                         << " " << bg::wkt(geometry2)
+                         << " -> Expected: " << bg::wkt(mls_union)
+                         << " computed: " << bg::wkt(mls_output) );
+}
+
 template
 <
     typename Geometry1, typename Geometry2,
@@ -51,14 +68,20 @@ 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::union_(geometry1, geometry2, mls_output, strategy_type());
+
+        check_result(geometry1, geometry2, mls_output, mls_union1, case_id, tolerance);
+
+        // Check normal behaviour
+        bg::clear(mls_output);
         bg::union_(geometry1, geometry2, mls_output);
 
-        BOOST_CHECK_MESSAGE( equals::apply(mls_union1, mls_output, tolerance),
-                             "case id: " << case_id
-                             << ", union L/L: " << bg::wkt(geometry1)
-                             << " " << bg::wkt(geometry2)
-                             << " -> Expected: " << bg::wkt(mls_union1)
-                             << " computed: " << bg::wkt(mls_output) );
+        check_result(geometry1, geometry2, mls_output, mls_union1, case_id, tolerance);
 
         set_operation_output("union", case_id,
                              geometry1, geometry2, mls_output);
@@ -101,17 +124,12 @@ private:
 #endif
         }
 
-        // check the symmetric difference where the order of the two
+        // check the union where the order of the two
         // geometries is reversed
         bg::clear(mls_output);
         bg::union_(geometry2, geometry1, mls_output);
 
-        BOOST_CHECK_MESSAGE( equals::apply(mls_union2, mls_output, tolerance),
-                             "case id: " << case_id
-                             << ", union L/L: " << bg::wkt(geometry2)
-                             << " " << bg::wkt(geometry1)
-                             << " -> Expected: " << bg::wkt(mls_union2)
-                             << " computed: " << bg::wkt(mls_output) );
+        check_result(geometry1, geometry2, mls_output, mls_union2, case_id, tolerance);
 
 #ifdef BOOST_GEOMETRY_TEST_DEBUG
         std::cout << "Geometry #1: " << bg::wkt(geometry2) << std::endl;