Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / geometry / test / algorithms / set_operations / intersection / intersection.cpp
index e925758..01c9581 100644 (file)
@@ -188,10 +188,13 @@ void test_areal()
             settings);
     }
 
-    test_one<Polygon, Polygon, Polygon>("geos_1",
-        geos_1[0], geos_1[1],
-            1, -1, 3461.12321694, // MSVC 14 reports 3461.025390625
-            ut_settings(0.01, false));
+    if (! BOOST_GEOMETRY_CONDITION((boost::is_same<ct, float>::value)) )
+    {
+        test_one<Polygon, Polygon, Polygon>("geos_1",
+            geos_1[0], geos_1[1],
+                1, -1, BG_IF_RESCALED(3461.12321694, BG_IF_KRAMER(3461.02336, 3461.105448)), // MSVC 14 reports 3461.025390625
+                ut_settings(0.01, false));
+    }
 
     // Expectations:
     // In most cases: 0 (no intersection)
@@ -205,7 +208,7 @@ void test_areal()
             0, 0, 0.0);
     test_one<Polygon, Polygon, Polygon>("geos_4",
         geos_4[0], geos_4[1],
-            1, -1, 0.08368849);
+            1, -1, 0.08368849, ut_settings(0.01));
 
 
     if ( BOOST_GEOMETRY_CONDITION(! ccw && open) )
@@ -253,15 +256,17 @@ void test_areal()
     TEST_INTERSECTION(ggl_list_20190307_matthieu_1, 2, -1, 0.035136);
     TEST_INTERSECTION(ggl_list_20190307_matthieu_2, 1, -1, 3.64285);
 
+#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
     test_one<Polygon, Polygon, Polygon>("buffer_rt_f", buffer_rt_f[0], buffer_rt_f[1],
                 1, 4,  0.00029437899183903937, ut_settings(0.01));
+#endif
     test_one<Polygon, Polygon, Polygon>("buffer_rt_g", buffer_rt_g[0], buffer_rt_g[1],
                 1, 0, 2.914213562373);
 
     test_one<Polygon, Polygon, Polygon>("ticket_8254", ticket_8254[0], ticket_8254[1],
-                1, 4, 3.635930e-08, ut_settings(0.01));
+                if_typed<ct, float>(0, 1), -1, if_typed<ct, float>(0.0, 3.635930e-08), ut_settings(0.01));
     test_one<Polygon, Polygon, Polygon>("ticket_6958", ticket_6958[0], ticket_6958[1],
-                1, 4, 4.34355e-05, ut_settings(0.01));
+                if_typed<ct, float>(0, 1), -1, if_typed<ct, float>(0.0, 4.34355e-05), ut_settings(0.01));
     test_one<Polygon, Polygon, Polygon>("ticket_8652", ticket_8652[0], ticket_8652[1],
                 1, 4, 0.0003);
 
@@ -306,7 +311,7 @@ void test_areal()
 
     test_one<Polygon, Polygon, Polygon>("ticket_11576",
                 ticket_11576[0], ticket_11576[1],
-                1, 0, 5.585617332907136e-07);
+                if_typed<ct, float>(0, 1), -1, if_typed<ct, float>(0.0, 5.585617332907136e-07));
 
     {
         // Not yet valid when rescaling is turned off
@@ -370,15 +375,8 @@ void test_areal()
     TEST_INTERSECTION(case_precision_9, 1, -1, 14.0);
     TEST_INTERSECTION(case_precision_10, 1, -1, 14.0);
     TEST_INTERSECTION(case_precision_11, 1, -1, 14.0);
-
-    {
-        ut_settings settings(0.01);
-        TEST_INTERSECTION_WITH(case_precision_12, 0, 1, 1, -1, 2.0, settings);
-        TEST_INTERSECTION_WITH(case_precision_13, 0, 1, 1, -1, 2.0, settings);
-        TEST_INTERSECTION_WITH(case_precision_12, 1, 0, 1, -1, 2.0, settings);
-        TEST_INTERSECTION_WITH(case_precision_13, 1, 0, 1, -1, 2.0, settings);
-    }
-
+    TEST_INTERSECTION(case_precision_12, 1, -1, 2.0);
+    TEST_INTERSECTION(case_precision_13, 1, -1, 1.99998);
     TEST_INTERSECTION(case_precision_14, 0, -1, 0.0);
     TEST_INTERSECTION(case_precision_15, 1, -1, 14.0);
     TEST_INTERSECTION(case_precision_16, 1, -1, 14.0);
@@ -388,6 +386,10 @@ void test_areal()
     TEST_INTERSECTION(case_precision_20, 0, 0, 0.0);
     TEST_INTERSECTION(case_precision_21, 0, 0, 0.0);
     TEST_INTERSECTION(case_precision_22, 1, -1, 14.0);
+    TEST_INTERSECTION(case_precision_23, 1, -1, 14.0);
+    TEST_INTERSECTION(case_precision_24, 0, 0, 0.0);
+    TEST_INTERSECTION(case_precision_25, 0, 0, 0.0);
+    TEST_INTERSECTION(case_precision_26, 1, -1, 14.0);
 
     TEST_INTERSECTION_REV(case_precision_1, 0, 0, 0.0);
     TEST_INTERSECTION_REV(case_precision_2, 0, 0, 0.0);
@@ -400,7 +402,8 @@ void test_areal()
     TEST_INTERSECTION_REV(case_precision_9, 1, -1, 14.0);
     TEST_INTERSECTION_REV(case_precision_10, 1, -1, 14.0);
     TEST_INTERSECTION_REV(case_precision_11, 1, -1, 14.0);
-
+    TEST_INTERSECTION_REV(case_precision_12, 1, -1, 2.0);
+    TEST_INTERSECTION_REV(case_precision_13, 1, -1, 1.99998);
     TEST_INTERSECTION_REV(case_precision_14, 0, -1, 0.0);
     TEST_INTERSECTION_REV(case_precision_15, 1, -1, 14.0);
     TEST_INTERSECTION_REV(case_precision_16, 1, -1, 14.0);
@@ -410,6 +413,10 @@ void test_areal()
     TEST_INTERSECTION_REV(case_precision_20, 0, 0, 0.0);
     TEST_INTERSECTION_REV(case_precision_21, 0, 0, 0.0);
     TEST_INTERSECTION_REV(case_precision_22, 1, -1, 14.0);
+    TEST_INTERSECTION_REV(case_precision_23, 1, -1, 14.0);
+    TEST_INTERSECTION_REV(case_precision_24, 0, 0, 0.0);
+    TEST_INTERSECTION_REV(case_precision_25, 0, 0, 0.0);
+    TEST_INTERSECTION_REV(case_precision_26, 1, -1, 14.0);
 
     test_one<Polygon, Polygon, Polygon>("mysql_21964049",
         mysql_21964049[0], mysql_21964049[1],
@@ -922,7 +929,8 @@ void test_ticket_10868(std::string const& wkt_out)
 
 int test_main(int, char* [])
 {
-    test_all<bg::model::d2::point_xy<double> >();
+    BoostGeometryWriteTestConfiguration();
+    test_all<bg::model::d2::point_xy<default_test_type> >();
 
 #if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
     test_all<bg::model::d2::point_xy<float> >();