From 0a752a657543836c2903d1332e1e0b82af153546 Mon Sep 17 00:00:00 2001 From: Vissarion Fisikopoulos Date: Wed, 29 May 2024 13:50:13 +0300 Subject: [PATCH] Remove BG_IF_RESCALED macro --- test/algorithms/buffer/buffer_polygon.cpp | 7 ----- test/algorithms/buffer/test_buffer.hpp | 3 -- .../set_operations/difference/difference.cpp | 14 +++++----- .../difference/difference_multi.cpp | 28 +++++-------------- .../intersection/intersection.cpp | 2 +- .../intersection/test_intersection.hpp | 3 -- .../test_set_ops_linear_linear.hpp | 3 -- .../algorithms/set_operations/union/union.cpp | 8 +++--- .../set_operations/union/union_multi.cpp | 16 ++--------- test/geometry_test_common.hpp | 3 -- test/to_svg.hpp | 3 -- 11 files changed, 22 insertions(+), 68 deletions(-) diff --git a/test/algorithms/buffer/buffer_polygon.cpp b/test/algorithms/buffer/buffer_polygon.cpp index 392ac1307..25660be91 100644 --- a/test/algorithms/buffer/buffer_polygon.cpp +++ b/test/algorithms/buffer/buffer_polygon.cpp @@ -538,12 +538,8 @@ void test_all() join_round, end_flat, {11363180033, 11363180045}, 50.0 * 1000.0); test_one("italy_part1_60", italy_part1, join_round, end_flat, 15479097108.720, 60.0 * 1000.0); - -#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) - // Fails with rescaling after removing pretraverse test_one("italy_part2_5", italy_part2, join_round, end_flat, {12496082120, 12496082124}, 5 * 1000.0); -#endif if (! BOOST_GEOMETRY_CONDITION((std::is_same::value))) { @@ -605,10 +601,7 @@ void test_all() // Test issue 555 as reported (-0.000001) and some variants bg::strategy::buffer::join_round jr(180); bg::strategy::buffer::end_round er(180); -#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) - // With rescaling the interior ring is missing test_one("issue_555", issue_555, jr, er, 4520.7942, -0.000001); -#endif test_one("issue_555", issue_555, jr, er, 4520.7957, +0.000001); test_one("issue_555_1000", issue_555, jr, er, 4521.6280, +0.001); test_one("issue_555_1000", issue_555, jr, er, 4519.9627, -0.001); diff --git a/test/algorithms/buffer/test_buffer.hpp b/test/algorithms/buffer/test_buffer.hpp index 0cacb9ab8..a7050adae 100644 --- a/test/algorithms/buffer/test_buffer.hpp +++ b/test/algorithms/buffer/test_buffer.hpp @@ -228,9 +228,6 @@ void test_buffer(std::string const& caseid, << (end_name.empty() ? "" : "_") << end_name << (distance_strategy.negative() ? "_deflate" : "") << (bg::point_order::value == bg::counterclockwise ? "_ccw" : "") -#if defined(BOOST_GEOMETRY_USE_RESCALING) - << "_rescaled" -#endif // << "_" << point_buffer_count ; diff --git a/test/algorithms/set_operations/difference/difference.cpp b/test/algorithms/set_operations/difference/difference.cpp index 194906789..6867b6c78 100644 --- a/test/algorithms/set_operations/difference/difference.cpp +++ b/test/algorithms/set_operations/difference/difference.cpp @@ -175,7 +175,7 @@ void test_all() { ut_settings settings; - settings.validity_of_sym = BG_IF_RESCALED(false, true); + settings.validity_of_sym = true; test_one("intersect_holes_intersect_and_disjoint", intersect_holes_intersect_and_disjoint[0], intersect_holes_intersect_and_disjoint[1], 2, 16, 15.75, @@ -344,8 +344,8 @@ void test_all() { ut_settings settings; - settings.percentage = BG_IF_RESCALED(0.001, 0.1); - settings.set_test_validity(BG_IF_RESCALED(true, false)); + settings.percentage = 0.1; + settings.set_test_validity(false); settings.sym_difference = false; // Isovist - the # output polygons differ per compiler/pointtype, (very) small @@ -375,7 +375,7 @@ void test_all() { ut_settings settings; - settings.set_test_validity(BG_IF_RESCALED(false, true)); + settings.set_test_validity(true); // Output polygons for sym difference might be combined expectation_limits a{138.5312, 138.6924}; @@ -453,8 +453,8 @@ void test_all() { // With rescaling, difference of output a-b and a sym b is invalid ut_settings settings; - settings.set_test_validity(BG_IF_RESCALED(false, true)); - settings.validity_of_sym = BG_IF_RESCALED(false, true); + settings.set_test_validity(true); + settings.validity_of_sym = true; TEST_DIFFERENCE_WITH(ggl_list_20190307_matthieu_1, count_set(1, 2), 0.18461532, count_set(1, 2), 0.617978, @@ -592,7 +592,7 @@ void test_all() { ut_settings settings; - settings.set_test_validity(BG_IF_RESCALED(true, false)); + settings.set_test_validity(false); settings.validity_false_negative_a = true; TEST_DIFFERENCE_WITH(issue_838, count_set(1, 2), expectation_limits(0.000026, 0.0002823), diff --git a/test/algorithms/set_operations/difference/difference_multi.cpp b/test/algorithms/set_operations/difference/difference_multi.cpp index 2472e2221..8810f61b4 100644 --- a/test/algorithms/set_operations/difference/difference_multi.cpp +++ b/test/algorithms/set_operations/difference/difference_multi.cpp @@ -109,7 +109,7 @@ void test_areal() { ut_settings settings; - settings.sym_difference = BG_IF_RESCALED(false, true); + settings.sym_difference = true; test_one("case_108_multi", case_108_multi[0], case_108_multi[1], @@ -148,33 +148,31 @@ void test_areal() { ut_settings settings; settings.percentage = 0.001; - settings.set_test_validity(BG_IF_RESCALED(true, false)); + settings.set_test_validity(false); TEST_DIFFERENCE_WITH(0, 1, ggl_list_20120221_volker, 2, 7962.66, 2, 2775258.93, 4); } -#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) { // 1: Very small sliver for B (discarded when rescaling) // 2: sym difference is not considered as valid (without rescaling // this is a false negative) // 3: with rescaling A is considered as invalid (robustness problem) ut_settings settings; - settings.validity_of_sym = BG_IF_RESCALED(false, true); + settings.validity_of_sym = true; settings.validity_false_negative_sym = true; TEST_DIFFERENCE_WITH(0, 1, bug_21155501, (count_set(1, 4)), expectation_limits(3.75893, 3.75894), (count_set(1, 4)), (expectation_limits(1.776357e-15, 7.661281e-15)), (count_set(2, 5))); } -#endif -#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) +#if defined(BOOST_GEOMETRY_TEST_FAILURES) { // With rescaling, it is complete but invalid // Without rescaling, one ring is missing (for a and s) ut_settings settings; - settings.set_test_validity(BG_IF_RESCALED(false, true)); - settings.validity_of_sym = BG_IF_RESCALED(false, true); + settings.set_test_validity(true); + settings.validity_of_sym = true; TEST_DIFFERENCE_WITH(0, 1, ticket_9081, 2, 0.0907392476356186, 4, 0.126018011439877, @@ -189,21 +187,12 @@ void test_areal() ut_settings settings; settings.percentage = 0.001; -#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) TEST_DIFFERENCE_WITH(0, 1, issue_630_a, 0, expectation_limits(0.0), 1, (expectation_limits(2.023, 2.2004)), 1); -#endif - TEST_DIFFERENCE_WITH(0, 1, issue_630_b, 1, 0.0056089, 2, 1.498976, 3); - -#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) TEST_DIFFERENCE_WITH(0, 1, issue_630_c, 0, 0, 1, 1.493367, 1); -#endif - -#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) // Symmetrical difference fails without get_clusters settings.sym_difference = BG_IF_TEST_FAILURES; TEST_DIFFERENCE_WITH(0, 1, issue_643, 1, expectation_limits(76.5385), optional(), optional_sliver(1.0e-6), 1); -#endif } // Cases below go (or went) wrong in either a ( [0] - [1] ) or b ( [1] - [0] ) @@ -387,10 +376,7 @@ void test_areal() TEST_DIFFERENCE(case_recursive_boxes_82, 5, 7.25, 7, 4.5, 8); TEST_DIFFERENCE(case_recursive_boxes_83, 9, 5.25, 8, 5.25, 12); TEST_DIFFERENCE(case_recursive_boxes_84, 4, 8.0, 7, 9.0, 4); -#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) TEST_DIFFERENCE(case_recursive_boxes_85, 4, 4.0, 7, 3.75, 9); -#endif - TEST_DIFFERENCE(case_recursive_boxes_86, 1, 1.5, 2, 1.5, 3); TEST_DIFFERENCE(case_recursive_boxes_87, 4, 2.0, 4, 2.5, 8); TEST_DIFFERENCE(case_recursive_boxes_88, 3, 4.75, 5, 6.75, 4); @@ -402,7 +388,7 @@ void test_areal() { ut_settings settings; - settings.sym_difference = BG_IF_RESCALED(true, BG_IF_TEST_FAILURES); + settings.sym_difference = BG_IF_TEST_FAILURES; test_one("mysql_21965285_b", mysql_21965285_b[0], mysql_21965285_b[1], diff --git a/test/algorithms/set_operations/intersection/intersection.cpp b/test/algorithms/set_operations/intersection/intersection.cpp index 684e37c9a..4cfe0c86a 100644 --- a/test/algorithms/set_operations/intersection/intersection.cpp +++ b/test/algorithms/set_operations/intersection/intersection.cpp @@ -287,7 +287,7 @@ void test_areal() { // Not yet valid when rescaling is turned off ut_settings settings; - settings.set_test_validity(BG_IF_RESCALED(true, false)); + settings.set_test_validity(false); test_one("ticket_9563", ticket_9563[0], ticket_9563[1], 1, 8, 129.90381, settings); } diff --git a/test/algorithms/set_operations/intersection/test_intersection.hpp b/test/algorithms/set_operations/intersection/test_intersection.hpp index 1712670ac..828579286 100644 --- a/test/algorithms/set_operations/intersection/test_intersection.hpp +++ b/test/algorithms/set_operations/intersection/test_intersection.hpp @@ -250,9 +250,6 @@ typename bg::default_area_result::type test_intersection(std::string const& << string_from_type::name() << (is_ccw ? "_ccw" : "") << (is_open ? "_open" : "") -#if defined(BOOST_GEOMETRY_USE_RESCALING) - << "_rescaled" -#endif << ".svg"; std::ofstream svg(filename.str().c_str()); diff --git a/test/algorithms/set_operations/test_set_ops_linear_linear.hpp b/test/algorithms/set_operations/test_set_ops_linear_linear.hpp index 4c9c76ca0..3b48ec186 100644 --- a/test/algorithms/set_operations/test_set_ops_linear_linear.hpp +++ b/test/algorithms/set_operations/test_set_ops_linear_linear.hpp @@ -302,9 +302,6 @@ void set_operation_output(std::string const& set_op_id, filename << "ops_" + set_op_id + "_" << caseid << "_" << string_from_type::name() -#if defined(BOOST_GEOMETRY_USE_RESCALING) - << "_rescaled" -#endif << ".svg"; std::ofstream svg(filename.str()); diff --git a/test/algorithms/set_operations/union/union.cpp b/test/algorithms/set_operations/union/union.cpp index 3b23aaaa5..9aacb0c32 100644 --- a/test/algorithms/set_operations/union/union.cpp +++ b/test/algorithms/set_operations/union/union.cpp @@ -372,7 +372,7 @@ void test_areal() { ut_settings settings; - settings.set_test_validity(BG_IF_RESCALED(true, BG_IF_TEST_FAILURES)); + settings.set_test_validity(BG_IF_TEST_FAILURES); TEST_UNION_WITH(ggl_list_20110820_christophe, count_set(1, 2), 0, -1, 67.3550722317627); } @@ -381,7 +381,7 @@ void test_areal() // PostGIS gives: 313.360364623393 // Without rescaling, it is creates an invalidity for double ut_settings settings; - settings.set_test_validity(BG_IF_RESCALED(true, false)); + settings.set_test_validity(false); TEST_UNION_WITH(isovist, 1, 0, -1, 313.36036462); } @@ -454,8 +454,8 @@ void test_areal() TEST_UNION(issue_1081c, 1, 1, -1, 2338.08); TEST_UNION_REV(issue_1081c, 1, 1, -1, 2338.08); - TEST_UNION(issue_1100, BG_IF_RESCALED(2, 1), 0, -1, 1.46181); - TEST_UNION_REV(issue_1100, BG_IF_RESCALED(2, 1), 0, -1, 1.46181); + TEST_UNION(issue_1100, 1, 0, -1, 1.46181); + TEST_UNION_REV(issue_1100, 1, 0, -1, 1.46181); TEST_UNION(issue_1108, 1, 0, -1, 12.1742); TEST_UNION_REV(issue_1108, 1, 0, -1, 12.1742); diff --git a/test/algorithms/set_operations/union/union_multi.cpp b/test/algorithms/set_operations/union/union_multi.cpp index 906fed1c0..d325a8740 100644 --- a/test/algorithms/set_operations/union/union_multi.cpp +++ b/test/algorithms/set_operations/union/union_multi.cpp @@ -370,7 +370,7 @@ void test_areal() TEST_UNION(case_recursive_boxes_79, 1, 2, -1, 14.75); // No hole should be generated (but rescaling generates one hole) - TEST_UNION(case_recursive_boxes_80, 2, BG_IF_RESCALED(bg_if_mp(0, 1), 0), -1, 1.5); + TEST_UNION(case_recursive_boxes_80, 2, 0, -1, 1.5); TEST_UNION(case_recursive_boxes_81, 5, 0, -1, 15.5); TEST_UNION(case_recursive_boxes_82, 2, 2, -1, 20.25); @@ -396,10 +396,10 @@ void test_areal() // Generates either 4 or 3 output polygons // With rescaling the result is invalid. ut_settings settings; - settings.set_test_validity(BG_IF_RESCALED(false, true)); + settings.set_test_validity(true); test_one("ticket_9081", ticket_9081[0], ticket_9081[1], - BG_IF_RESCALED(bg_if_mp(3, 4), 3), 0, -1, 0.2187385, + 3, 0, -1, 0.2187385, settings); } @@ -413,29 +413,19 @@ void test_areal() ticket_12118[0], ticket_12118[1], 1, -1, 27, 2221.38713); -#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) - // No output if rescaling is done test_one("ticket_12125", ticket_12125[0], ticket_12125[1], 1, 0, -1, 575.831180350007); -#endif TEST_UNION(ticket_12503, 42, 1, -1, 945.625); -#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) - // Failure with rescaling TEST_UNION(issue_630_a, 1, 0, -1, 2.200326); -#endif TEST_UNION(issue_630_b, 1, 0, -1, 1.675976); -#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES) - // With rescaling the smaller rectangle is added on top of the outer polygon TEST_UNION(issue_630_c, 1, 0, -1, 1.670367); - // With rescaling the small polygon is added on top of the outer polygon TEST_UNION(issue_643, 1, 0, -1, 80.0); -#endif // It returns 3 polygons, the first with an interior // This is correct (the difference, resulting in the same spatial coverage, diff --git a/test/geometry_test_common.hpp b/test/geometry_test_common.hpp index e2b9cf461..a19f994bf 100644 --- a/test/geometry_test_common.hpp +++ b/test/geometry_test_common.hpp @@ -184,9 +184,6 @@ inline T1 const& bg_if_mp(T1 const& value_mp, T2 const& value) return std::is_same::type::value ? value_mp : value; } -//! Macro for expectations depending on rescaling -#define BG_IF_RESCALED(a, b) b - //! Macro for turning of a test setting when testing without failures #if defined(BOOST_GEOMETRY_TEST_FAILURES) #define BG_IF_TEST_FAILURES true diff --git a/test/to_svg.hpp b/test/to_svg.hpp index 99b6c19a6..99ca190ed 100644 --- a/test/to_svg.hpp +++ b/test/to_svg.hpp @@ -128,9 +128,6 @@ inline void to_svg(G1 const& g1, G2 const& g2, G3 const& g3, filename << "case_" << caseid << "_" << string_from_type::name() -#if defined(BOOST_GEOMETRY_USE_RESCALING) - << "_rescaled" -#endif << ".svg"; std::ofstream svg(filename.str());