diff --git a/include/boost/geometry/core/config.hpp b/include/boost/geometry/core/config.hpp index 3066586c4..90677cfd3 100644 --- a/include/boost/geometry/core/config.hpp +++ b/include/boost/geometry/core/config.hpp @@ -14,6 +14,16 @@ #include +// Flip around the default. This is targeted to tests. As soon as the default changes, +// some unit tests (tagged by _alternative) are tested with the non-default. +#if defined(BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE) + #if defined(BOOST_GEOMETRY_NO_ROBUSTNESS) + #undef BOOST_GEOMETRY_NO_ROBUSTNESS + #else + #define BOOST_GEOMETRY_NO_ROBUSTNESS + #endif +#endif + // NOTE: workaround for VC++ 12 (aka 2013): cannot specify explicit initializer for arrays #if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && (!defined(_MSC_VER) || (_MSC_VER >= 1900)) #define BOOST_GEOMETRY_CXX11_ARRAY_UNIFIED_INITIALIZATION diff --git a/test/algorithms/buffer/Jamfile b/test/algorithms/buffer/Jamfile index ba7388a24..735284abd 100644 --- a/test/algorithms/buffer/Jamfile +++ b/test/algorithms/buffer/Jamfile @@ -26,16 +26,15 @@ test-suite boost-geometry-algorithms-buffer [ run buffer_multi_linestring.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_buffer_multi_linestring ] [ run buffer_multi_polygon.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_buffer_multi_polygon ] [ run buffer_linestring_aimes.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_buffer_linestring_aimes ] -# TODO -# [ run buffer_linestring.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_NO_ROBUSTNESS : algorithms_buffer_linestring_norescale ] -# [ run buffer_multi_linestring.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_NO_ROBUSTNESS : algorithms_buffer_multi_linestring_norescale ] - [ run buffer_ring.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_NO_ROBUSTNESS : algorithms_buffer_ring_norescale ] - [ run buffer_polygon.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_NO_ROBUSTNESS : algorithms_buffer_polygon_norescale ] - [ run buffer_multi_point.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_NO_ROBUSTNESS : algorithms_buffer_multi_point_norescale ] - [ run buffer_multi_polygon.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_NO_ROBUSTNESS : algorithms_buffer_multi_polygon_norescale ] - [ run buffer_linestring_aimes.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_NO_ROBUSTNESS : algorithms_buffer_linestring_aimes_norescale ] + [ run buffer_linestring.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE : algorithms_buffer_linestring_alternative ] + [ run buffer_multi_linestring.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE : algorithms_buffer_multi_linestring_alternative ] + [ run buffer_ring.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE : algorithms_buffer_ring_alternative ] + [ run buffer_polygon.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE : algorithms_buffer_polygon_alternative ] + [ run buffer_multi_point.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE : algorithms_buffer_multi_point_alternative ] + [ run buffer_multi_polygon.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE : algorithms_buffer_multi_polygon_alternative ] + [ run buffer_linestring_aimes.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE : algorithms_buffer_linestring_aimes_alternative ] # Uncomment next lines if you want to test this manually; requires access to data/ folder # [ run buffer_countries.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_buffer_countries ] -# [ run buffer_countries.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_NO_ROBUSTNESS : algorithms_buffer_countries_norescale ] +# [ run buffer_countries.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE : algorithms_buffer_countries_alternative ] ; diff --git a/test/algorithms/buffer/buffer_linestring.cpp b/test/algorithms/buffer/buffer_linestring.cpp index 24c257438..04caa3e32 100644 --- a/test/algorithms/buffer/buffer_linestring.cpp +++ b/test/algorithms/buffer/buffer_linestring.cpp @@ -327,7 +327,10 @@ void test_all() // Test behaviour with different buffer sizes, generating internally turns on different locations test_one("mysql_25662426a_05", mysql_25662426a, join_round32, end_round32, 27.6156, 0.5); +#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // Fails without rescaling test_one("mysql_25662426a_1", mysql_25662426a, join_round32, end_round32, 54.9018, 1.0); +#endif test_one("mysql_25662426a_2", mysql_25662426a, join_round32, end_round32, 103.6072, 2.0); test_one("mysql_25662426a_3", mysql_25662426a, join_round32, end_round32, 152.1163, 3.0); test_one("mysql_25662426a_4", mysql_25662426a, join_round32, end_round32, 206.4831, 4.0); @@ -354,7 +357,10 @@ void test_all() // Mostly right test_one("mysql_25662426a_mostly_right_05", mysql_25662426a, join_round32, end_round32, 14.3419, 0.05, settings, 0.5); +#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) + // Fails without rescaling test_one("mysql_25662426a_mostly_right_1", mysql_25662426a, join_round32, end_round32, 27.1955, 0.1, settings, 1.0); +#endif test_one("mysql_25662426a_mostly_right_2", mysql_25662426a, join_round32, end_round32, 43.1821, 0.2, settings, 2.0); test_one("mysql_25662426a_mostly_right_3", mysql_25662426a, join_round32, end_round32, 54.4337, 0.3, settings, 3.0); test_one("mysql_25662426a_mostly_right_4", mysql_25662426a, join_round32, end_round32, 75.6376, 0.4, settings, 4.0); diff --git a/test/algorithms/buffer/buffer_multi_linestring.cpp b/test/algorithms/buffer/buffer_multi_linestring.cpp index d01459926..bc8cdfce5 100644 --- a/test/algorithms/buffer/buffer_multi_linestring.cpp +++ b/test/algorithms/buffer/buffer_multi_linestring.cpp @@ -199,9 +199,9 @@ void test_all() test_one("mysql_23023665_1_20", mysql_23023665_1, join_round32, end_flat, 1, 1, 350.1135, 2.0); -#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) +#if defined(BOOST_GEOMETRY_TEST_FAILURES) { - // Cases failing with rescaling + // Cases (railway roads) still failing ut_settings settings(10.0, false); test_one("ticket_13444_1", ticket_13444, join_round32, end_round32, 3, 0, 11801.7832, 1.0, settings); diff --git a/test/algorithms/set_operations/difference/Jamfile b/test/algorithms/set_operations/difference/Jamfile index 8acb54183..2cb8dd83d 100644 --- a/test/algorithms/set_operations/difference/Jamfile +++ b/test/algorithms/set_operations/difference/Jamfile @@ -18,8 +18,8 @@ test-suite boost-geometry-algorithms-difference : [ run difference.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_difference ] [ run difference_multi.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_difference_multi ] - [ run difference.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_NO_ROBUSTNESS : algorithms_difference_norescale ] - [ run difference_multi.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_NO_ROBUSTNESS : algorithms_difference_multi_norescale ] + [ run difference.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE : algorithms_difference_alternative ] + [ run difference_multi.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE : algorithms_difference_multi_alternative ] [ run difference_multi_spike.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_difference_multi_spike ] [ run difference_areal_linear.cpp : : : : algorithms_difference_areal_linear ] [ run difference_l_a_sph.cpp : : : : algorithms_difference_l_a_sph ] diff --git a/test/algorithms/set_operations/intersection/Jamfile b/test/algorithms/set_operations/intersection/Jamfile index e42cf7671..5be6b46d4 100644 --- a/test/algorithms/set_operations/intersection/Jamfile +++ b/test/algorithms/set_operations/intersection/Jamfile @@ -18,10 +18,11 @@ test-suite boost-geometry-algorithms-intersection : [ run intersection.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_intersection ] [ run intersection_multi.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_intersection_multi ] - [ run intersection.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_NO_ROBUSTNESS : algorithms_intersection_norescale ] - [ run intersection_multi.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_NO_ROBUSTNESS : algorithms_intersection_multi_norescale ] - [ run intersection_areal_areal_linear.cpp : : : : algorithms_intersection_areal_areal_linear ] + [ run intersection.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE : algorithms_intersection_alternative ] + [ run intersection_multi.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE : algorithms_intersection_multi_alternative ] [ run intersection_linear_linear.cpp : : : : algorithms_intersection_linear_linear ] + [ run intersection_linear_linear.cpp : : : BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE : algorithms_intersection_linear_linear_alternative ] + [ run intersection_areal_areal_linear.cpp : : : : algorithms_intersection_areal_areal_linear ] [ run intersection_pl_a.cpp : : : : algorithms_intersection_pl_a ] [ run intersection_pl_l.cpp : : : : algorithms_intersection_pl_l ] [ run intersection_pl_pl.cpp : : : : algorithms_intersection_pl_pl ] diff --git a/test/algorithms/set_operations/union/Jamfile b/test/algorithms/set_operations/union/Jamfile index 0e2e9e48d..ce3406e5f 100644 --- a/test/algorithms/set_operations/union/Jamfile +++ b/test/algorithms/set_operations/union/Jamfile @@ -18,8 +18,8 @@ test-suite boost-geometry-algorithms-union : [ run union.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_union ] [ run union_multi.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_union_multi ] - [ run union.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_NO_ROBUSTNESS : algorithms_union_norescale ] - [ run union_multi.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_NO_ROBUSTNESS : algorithms_union_multi_norescale ] + [ run union.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE : algorithms_union_alternative ] + [ run union_multi.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE : algorithms_union_multi_alternative ] [ run union_aa_geo.cpp : : : : algorithms_union_aa_geo ] [ run union_aa_sph.cpp : : : : algorithms_union_aa_sph ] [ run union_linear_linear.cpp : : : : algorithms_union_linear_linear ] diff --git a/test/geometry_test_common.hpp b/test/geometry_test_common.hpp index a2c1357cd..5eb7aa97f 100644 --- a/test/geometry_test_common.hpp +++ b/test/geometry_test_common.hpp @@ -207,8 +207,13 @@ inline void BoostGeometryWriteTestConfiguration() #if defined(BOOST_GEOMETRY_COMPILER_MODE_DEBUG) std::cout << " - Debug mode" << std::endl; #endif +#if defined(BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE) + std::cout << " - Flipping the robustness alternative" << std::endl; +#endif #if defined(BOOST_GEOMETRY_USE_RESCALING) std::cout << " - Using rescaling" << std::endl; +#else + std::cout << " - No rescaling" << std::endl; #endif #if defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) std::cout << " - Testing only one type" << std::endl;