diff --git a/test/algorithms/area/area.cpp b/test/algorithms/area/area.cpp index 7f6f28d88..ee107465e 100644 --- a/test/algorithms/area/area.cpp +++ b/test/algorithms/area/area.cpp @@ -73,13 +73,13 @@ void test_all() ("POLYGON((1 0,0 1,-1 0,0 -1,1 0))", 2); typedef typename bg::coordinate_type

::type coord_type; - if (BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + if (BOOST_GEOMETRY_CONDITION((std::is_same::value))) { test_geometry > ("POLYGON((100000001 100000000, 100000000 100000001, \ 99999999 100000000, 100000000 99999999))", 2); } - else if (BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + else if (BOOST_GEOMETRY_CONDITION((std::is_same::value))) { test_geometry > ("POLYGON((100001 100000, 100000 100001, \ diff --git a/test/algorithms/area/area_sph_geo.cpp b/test/algorithms/area/area_sph_geo.cpp index cda94d165..c9b47bfe1 100644 --- a/test/algorithms/area/area_sph_geo.cpp +++ b/test/algorithms/area/area_sph_geo.cpp @@ -6,9 +6,8 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2015, 2016, 2017. -// Modifications copyright (c) 2015-2017, Oracle and/or its affiliates. - +// This file was modified by Oracle on 2015-2021. +// Modifications copyright (c) 2015-2021, Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -430,7 +429,7 @@ void test_spherical_geo() /*if (polar) { // Create colatitudes (measured from pole) - BOOST_FOREACH(pt& p, aurha) + for (pt& p : aurha) { bg::set<1>(p, ct(90) - bg::get<1>(p)); } diff --git a/test/algorithms/buffer/buffer_linestring.cpp b/test/algorithms/buffer/buffer_linestring.cpp index 1c3f9dab4..b892ec30d 100644 --- a/test/algorithms/buffer/buffer_linestring.cpp +++ b/test/algorithms/buffer/buffer_linestring.cpp @@ -3,8 +3,8 @@ // Copyright (c) 2012-2019 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2016. -// Modifications copyright (c) 2016, Oracle and/or its affiliates. +// This file was modified by Oracle on 2016-2021. +// Modifications copyright (c) 2016-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -128,7 +128,7 @@ void test_all() ut_settings const settings; ut_settings const specific_settings - = BOOST_GEOMETRY_CONDITION((boost::is_same::value)) + = BOOST_GEOMETRY_CONDITION((std::is_same::value)) ? ut_settings(0.02) : settings; // Simplex (join-type is not relevant) @@ -258,7 +258,7 @@ void test_all() test_one("mysql_report_2015_04_01", mysql_report_2015_04_01, join_round(32), end_round(32), 632.234, d100); } - if (! BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + if (! BOOST_GEOMETRY_CONDITION((std::is_same::value))) { ut_settings settings; settings.tolerance = 0.1; @@ -313,7 +313,7 @@ void test_all() 27862.733459829971, 5.9518403867035365); - if (BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + if (BOOST_GEOMETRY_CONDITION((std::is_same::value))) { test_one("mysql_report_2015_09_08a", mysql_report_2015_09_08a, join_round32, end_round32, 0.0, 1.0); test_one("mysql_report_2015_09_08b", mysql_report_2015_09_08b, join_round32, end_round32, 0.0, 1099511627778.0); @@ -390,7 +390,7 @@ template void test_invalid() { typedef typename bg::coordinate_type

::type coor_type; - if (! BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + if (! BOOST_GEOMETRY_CONDITION((std::is_same::value))) { return; } diff --git a/test/algorithms/buffer/buffer_linestring_aimes.cpp b/test/algorithms/buffer/buffer_linestring_aimes.cpp index d82708bb0..86279e0e1 100644 --- a/test/algorithms/buffer/buffer_linestring_aimes.cpp +++ b/test/algorithms/buffer/buffer_linestring_aimes.cpp @@ -3,6 +3,10 @@ // Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -425,7 +429,7 @@ void test_aimes() typedef bg::model::polygon

polygon; typedef typename bg::coordinate_type

::type coor_type; - if (BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + if (BOOST_GEOMETRY_CONDITION((std::is_same::value))) { std::cout << "This unit test can't be tested with float," << " the coordinate values are too small." << std::endl; diff --git a/test/algorithms/buffer/buffer_multi_linestring.cpp b/test/algorithms/buffer/buffer_multi_linestring.cpp index 0c454111a..4b06877aa 100644 --- a/test/algorithms/buffer/buffer_multi_linestring.cpp +++ b/test/algorithms/buffer/buffer_multi_linestring.cpp @@ -3,8 +3,8 @@ // Copyright (c) 2012-2019 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2016. -// Modifications copyright (c) 2016, Oracle and/or its affiliates. +// This file was modified by Oracle on 2016-2021. +// Modifications copyright (c) 2016-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -141,7 +141,7 @@ void test_all() test_one("mikado4_small", mikado4, join_round32, end_flat, 1930.785, 10.0); } - if (! BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + if (! BOOST_GEOMETRY_CONDITION((std::is_same::value))) { // Coordinates in one linestring vary so much that // length = geometry::math::sqrt(dx * dx + dy * dy); returns a value of inf for length diff --git a/test/algorithms/buffer/buffer_multi_polygon.cpp b/test/algorithms/buffer/buffer_multi_polygon.cpp index edd78d591..03ab006ae 100644 --- a/test/algorithms/buffer/buffer_multi_polygon.cpp +++ b/test/algorithms/buffer/buffer_multi_polygon.cpp @@ -3,8 +3,8 @@ // Copyright (c) 2012-2019 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2016. -// Modifications copyright (c) 2016, Oracle and/or its affiliates. +// This file was modified by Oracle on 2016-2021. +// Modifications copyright (c) 2016-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -657,7 +657,7 @@ void test_all() join_round32, end_round32, 0.0, -10.0); // Check cases with extreme coordinates on assertions - if (BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + if (BOOST_GEOMETRY_CONDITION((std::is_same::value))) { test_one("mysql_report_2015_07_05_1", mysql_report_2015_07_05_1, diff --git a/test/algorithms/buffer/buffer_polygon.cpp b/test/algorithms/buffer/buffer_polygon.cpp index 6c1b70e7a..d1cd8e96a 100644 --- a/test/algorithms/buffer/buffer_polygon.cpp +++ b/test/algorithms/buffer/buffer_polygon.cpp @@ -3,8 +3,8 @@ // Copyright (c) 2012-2019 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2016, 2019. -// Modifications copyright (c) 2016, Oracle and/or its affiliates. +// This file was modified by Oracle on 2016-2021. +// Modifications copyright (c) 2016-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -535,7 +535,7 @@ void test_all() test_one("italy_part2_5", italy_part2, join_round, end_flat, {12496082120, 12496082124}, 5 * 1000.0); - if (! BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + if (! BOOST_GEOMETRY_CONDITION((std::is_same::value))) { ut_settings settings; settings.set_test_validity(false); @@ -571,7 +571,7 @@ void test_all() test_one("ticket_10398_1_25", ticket_10398_1, join_miter, end_flat, 246.7329, -2.5); } - if (! BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + if (! BOOST_GEOMETRY_CONDITION((std::is_same::value))) { // Test issue 369 as reported (1.15e-3) and some variants // Use high tolerance because output areas are very small @@ -590,7 +590,7 @@ void test_all() test_one("issue_369_1000", issue_369, jr, er, 7.881e-10, distance / 1000.0, specific); } - if (! BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + if (! BOOST_GEOMETRY_CONDITION((std::is_same::value))) { // Test issue 555 as reported (-0.000001) and some variants bg::strategy::buffer::join_round jr(180); @@ -639,7 +639,7 @@ void test_all() mysql_report_2015_02_17_3, join_round32, end_round32, 64.0, -1.0); - if (BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + if (BOOST_GEOMETRY_CONDITION((std::is_same::value))) { // These extreme testcases, containing huge coordinate differences // and huge buffer distances, are to verify assertions. diff --git a/test/algorithms/buffer/test_buffer.hpp b/test/algorithms/buffer/test_buffer.hpp index 8a3d92d12..3691e6127 100644 --- a/test/algorithms/buffer/test_buffer.hpp +++ b/test/algorithms/buffer/test_buffer.hpp @@ -24,7 +24,6 @@ #include #include -#include #include #include @@ -161,12 +160,12 @@ void test_buffer(std::string const& caseid, typedef typename bg::tag::type tag; // TODO use something different here: - std::string type = boost::is_same::value ? "poly" - : boost::is_same::value ? "line" - : boost::is_same::value ? "point" - : boost::is_same::value ? "multipoly" - : boost::is_same::value ? "multiline" - : boost::is_same::value ? "multipoint" + std::string type = std::is_same::value ? "poly" + : std::is_same::value ? "line" + : std::is_same::value ? "point" + : std::is_same::value ? "multipoly" + : std::is_same::value ? "multiline" + : std::is_same::value ? "multipoint" : "" ; @@ -184,8 +183,8 @@ void test_buffer(std::string const& caseid, std::string end_name = EndTestProperties::name(); if ( BOOST_GEOMETRY_CONDITION(( - boost::is_same::value - || boost::is_same::value )) ) + std::is_same::value + || std::is_same::value )) ) { join_name.clear(); } diff --git a/test/algorithms/buffer/test_buffer_svg.hpp b/test/algorithms/buffer/test_buffer_svg.hpp index 9d0fb9f85..f8df1b13f 100644 --- a/test/algorithms/buffer/test_buffer_svg.hpp +++ b/test/algorithms/buffer/test_buffer_svg.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2020. -// Modifications copyright (c) 2020 Oracle and/or its affiliates. +// This file was modified by Oracle on 2020-2021. +// Modifications copyright (c) 2020-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -28,8 +28,8 @@ # endif #endif -#include #include +#include #include @@ -116,8 +116,7 @@ private : std::map > offsets; - for (typename boost::range_iterator::type it = - boost::begin(turns); it != boost::end(turns); ++it) + for (auto it = boost::begin(turns); it != boost::end(turns); ++it) { if (m_zoom && bg::disjoint(it->point, m_alternate_box)) { @@ -192,9 +191,7 @@ private : typedef typename boost::range_value::type ring_type; typedef typename bg::point_type::type point_type; - for(typename boost::range_iterator::type it = boost::begin(pieces); - it != boost::end(pieces); - ++it) + for (auto it = boost::begin(pieces); it != boost::end(pieces); ++it) { const piece_type& piece = *it; bg::segment_identifier seg_id = piece.first_seg_id; @@ -274,8 +271,7 @@ private : template inline void map_traversed_rings(TraversedRings const& traversed_rings) { - for(typename boost::range_iterator::type it - = boost::begin(traversed_rings); it != boost::end(traversed_rings); ++it) + for (auto it = boost::begin(traversed_rings); it != boost::end(traversed_rings); ++it) { m_mapper.map(*it, "opacity:0.4;fill:none;stroke:rgb(0,255,0);stroke-width:2"); } @@ -284,8 +280,7 @@ private : template inline void map_offsetted_rings(OffsettedRings const& offsetted_rings) { - for(typename boost::range_iterator::type it - = boost::begin(offsetted_rings); it != boost::end(offsetted_rings); ++it) + for (auto it = boost::begin(offsetted_rings); it != boost::end(offsetted_rings); ++it) { if (it->discarded()) { @@ -349,14 +344,7 @@ public : void map_input_output(Mapper& mapper, Geometry const& geometry, GeometryBuffer const& buffered, bool negative) { - bool const areal = boost::is_same - < - typename bg::tag_cast - < - typename bg::tag::type, - bg::areal_tag - >::type, bg::areal_tag - >::type::value; + bool const areal = bg::util::is_areal::value; if (m_zoom) { @@ -385,7 +373,7 @@ public : bg::detail::overlay::assign_null_policy >(geometry, strategy, rescale_policy, turns, policy); - BOOST_FOREACH(turn_info const& turn, turns) + for (turn_info const& turn : turns) { mapper.map(turn.point, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1", 3); } diff --git a/test/algorithms/buffer/test_buffer_svg_per_turn.hpp b/test/algorithms/buffer/test_buffer_svg_per_turn.hpp index e48d333d1..be01f4b95 100644 --- a/test/algorithms/buffer/test_buffer_svg_per_turn.hpp +++ b/test/algorithms/buffer/test_buffer_svg_per_turn.hpp @@ -2,6 +2,11 @@ // Unit Test Helper // Copyright (c) 2010-2019 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -132,7 +137,7 @@ public : return; } - BOOST_FOREACH(pair_type const& p, points) + for (pair_type const& p : points) { mappers.push_back(new mapper_visitor(complete_caseid, p.second, p.first)); } diff --git a/test/algorithms/centroid.cpp b/test/algorithms/centroid.cpp index 248ebc72b..e418cedce 100644 --- a/test/algorithms/centroid.cpp +++ b/test/algorithms/centroid.cpp @@ -5,9 +5,8 @@ // Copyright (c) 2008-2015 Bruno Lalande, Paris, France. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2014, 2015. -// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. - +// This file was modified by Oracle on 2014-2021. +// Modifications copyright (c) 2014-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library @@ -91,7 +90,7 @@ void test_2d() coord_type m = (std::numeric_limits::max)(); bg::append(ls, P(coord_type(m), coord_type(-m))); bg::append(ls, P(coord_type(0.0001), coord_type(0.000))); - if (BOOST_GEOMETRY_CONDITION((boost::is_same::type, double>::value))) + if (BOOST_GEOMETRY_CONDITION((std::is_same::type, double>::value))) { // for doubles the INF is detected and the calculation stopped // currently for Geometries for which the centroid can't be calculated diff --git a/test/algorithms/check_validity.hpp b/test/algorithms/check_validity.hpp index 388ca6fad..c02ff3f01 100644 --- a/test/algorithms/check_validity.hpp +++ b/test/algorithms/check_validity.hpp @@ -2,6 +2,10 @@ // Copyright (c) 2017 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -9,8 +13,6 @@ #ifndef BOOST_GEOMETRY_TEST_CHECK_VALIDITY_HPP #define BOOST_GEOMETRY_TEST_CHECK_VALIDITY_HPP -#include - #include template @@ -64,7 +66,7 @@ struct check_validity std::string& message) { typedef typename boost::range_value::type single_type; - BOOST_FOREACH(single_type const& element, geometry) + for (single_type const& element : geometry) { if (! is_output_valid(element, case_id, g1, g2, message)) { diff --git a/test/algorithms/comparable_distance.cpp b/test/algorithms/comparable_distance.cpp index bb96dc205..1df2e6a45 100644 --- a/test/algorithms/comparable_distance.cpp +++ b/test/algorithms/comparable_distance.cpp @@ -6,9 +6,8 @@ // Copyright (c) 2009-2014 Mateusz Loskot, London, UK. // Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014, 2017. -// Modifications copyright (c) 2014-2017, Oracle and/or its affiliates. - +// This file was modified by Oracle on 2014-2021. +// Modifications copyright (c) 2014-2021, 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 @@ -22,9 +21,6 @@ #include -#include -#include -#include #include #include @@ -188,8 +184,8 @@ struct test_variant_different_default_strategy variant_type v1, v2; - BOOST_MPL_ASSERT(( - boost::is_same + BOOST_GEOMETRY_STATIC_ASSERT( + (std::is_same < typename bg::comparable_distance_result < @@ -199,8 +195,8 @@ struct test_variant_different_default_strategy < point_type, point_type, bg::default_strategy >::type - > - )); + >::value), + "Unexpected result type"); // Default strategy v1 = point; @@ -261,27 +257,27 @@ struct test_variant_same_default_strategy variant_type v1, v2; - BOOST_MPL_ASSERT(( - boost::is_same + BOOST_GEOMETRY_STATIC_ASSERT( + (std::is_same < typename bg::comparable_distance_result < variant_type, variant_type, bg::default_strategy >::type, ExpectedResultType - > - )); + >::value), + "Unexpected result type"); - BOOST_MPL_ASSERT(( - boost::is_same + BOOST_GEOMETRY_STATIC_ASSERT( + (std::is_same < typename bg::comparable_distance_result < point_type, point_type, bg::default_strategy >::type, ExpectedResultType - > - )); + >::value), + "Unexpected result type"); // Default strategy v1 = point; @@ -352,27 +348,27 @@ struct test_variant_with_strategy strategy_type strategy; - BOOST_MPL_ASSERT(( - boost::is_same + BOOST_GEOMETRY_STATIC_ASSERT( + (std::is_same < typename bg::comparable_distance_result < variant_type, variant_type, strategy_type >::type, ExpectedResultType - > - )); + >::value), + "Unexpected result type"); - BOOST_MPL_ASSERT(( - boost::is_same + BOOST_GEOMETRY_STATIC_ASSERT( + (std::is_same < typename bg::comparable_distance_result < segment_type, linestring_type, strategy_type >::type, ExpectedResultType - > - )); + >::value), + "Unexpected result type"); // Passed strategy v1 = seg; @@ -422,7 +418,7 @@ struct test_variant_with_strategy } }; -template ::value> +template ::value> struct check_result { template @@ -459,23 +455,24 @@ struct test_variant_boxes variant_type v1 = box1, v2 = box2; - typedef typename boost::mpl::if_c + typedef typename std::conditional < - boost::is_float::value, + std::is_floating_point::value, double, typename bg::util::detail::default_integral::type >::type expected_result_type; - BOOST_MPL_ASSERT(( - boost::is_same + BOOST_GEOMETRY_STATIC_ASSERT( + (std::is_same < typename bg::comparable_distance_result < variant_type, variant_type, bg::default_strategy >::type, expected_result_type - > - )); + >::value), + "Unexpected result type" + ); // Default strategy check_result::apply(bg::comparable_distance(v1, v2), @@ -491,7 +488,7 @@ struct test_variant_boxes int test_main(int, char* []) { test_double_result_from_integer(); - test_double_result_from_integer(); + test_double_result_from_integer(); test_all >(); test_all >(); diff --git a/test/algorithms/covered_by/covered_by_sph_geo.cpp b/test/algorithms/covered_by/covered_by_sph_geo.cpp index 665b2802f..94730d52c 100644 --- a/test/algorithms/covered_by/covered_by_sph_geo.cpp +++ b/test/algorithms/covered_by/covered_by_sph_geo.cpp @@ -1,6 +1,6 @@ // Boost.Geometry -// Copyright (c) 2016 Oracle and/or its affiliates. +// Copyright (c) 2016-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -82,12 +82,12 @@ void test_box_box() template void test_point_polygon() { - typename boost::mpl::if_ + std::conditional_t < - boost::is_same::type, bg::geographic_tag>, + std::is_same::type, bg::geographic_tag>::value, bg::strategy::within::geographic_winding

, bg::strategy::within::spherical_winding

- >::type s; + > s; typedef bg::model::polygon

poly; diff --git a/test/algorithms/detail/calculate_point_order.cpp b/test/algorithms/detail/calculate_point_order.cpp index 401136313..38922155f 100644 --- a/test/algorithms/detail/calculate_point_order.cpp +++ b/test/algorithms/detail/calculate_point_order.cpp @@ -1,8 +1,7 @@ // Boost.Geometry // Unit Test -// Copyright (c) 2019, Oracle and/or its affiliates. - +// Copyright (c) 2019-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Licensed under the Boost Software License version 1.0. @@ -89,7 +88,7 @@ inline void test_one(std::string const& ring_wkt, bg::order_selector expected) std::rotate(boost::begin(ring), boost::begin(ring) + 1, boost::end(ring)); // it seems that area method doesn't work for invalid "opened" polygons - //if (! boost::is_same::value) + //if (! std::is_same::value) { P p = bg::range::front(ring); bg::range::push_back(ring, p); diff --git a/test/algorithms/detail/partition.cpp b/test/algorithms/detail/partition.cpp index 9d63668d8..c1549f729 100644 --- a/test/algorithms/detail/partition.cpp +++ b/test/algorithms/detail/partition.cpp @@ -3,8 +3,8 @@ // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. // -// This file was modified by Oracle on 2017, 2018. -// Modifications copyright (c) 2017-2018 Oracle and/or its affiliates. +// This file was modified by Oracle on 2017-2021. +// Modifications copyright (c) 2017-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // // Use, modification and distribution is subject to the Boost Software License, @@ -15,19 +15,20 @@ #include +#include +#include +#include +#include +#include -#include #include #include #include -#include - -#include - #if defined(TEST_WITH_SVG) # include #endif +#include #include #include @@ -151,7 +152,7 @@ void test_boxes(std::string const& wkt_box_list, double expected_area, int expec std::vector boxes; int index = 1; - BOOST_FOREACH(std::string const& wkt, wkt_boxes) + for (std::string const& wkt : wkt_boxes) { boxes.push_back(sample(index++, wkt)); } @@ -229,10 +230,10 @@ void test_points(std::string const& wkt1, std::string const& wkt2, int expected_ bg::read_wkt(wkt2, mp2); int id = 1; - BOOST_FOREACH(point_item& p, mp1) + for (point_item& p : mp1) { p.id = id++; } id = 1; - BOOST_FOREACH(point_item& p, mp2) + for (point_item& p : mp2) { p.id = id++; } point_visitor visitor; @@ -352,9 +353,9 @@ void test_many_points(int seed, int size, int count) // Test equality in quadratic loop int expected_count = 0; - BOOST_FOREACH(point_item const& item1, mp1) + for (point_item const& item1 : mp1) { - BOOST_FOREACH(point_item const& item2, mp2) + for (point_item const& item2 : mp2) { if (bg::equals(item1, item2)) { @@ -395,11 +396,11 @@ void test_many_points(int seed, int size, int count) BOOST_CHECK_EQUAL(visitor.count, expected_count); #if defined(TEST_WITH_SVG) - BOOST_FOREACH(point_item const& item, mp1) + for (point_item const& item : mp1) { mapper.map(item, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1", 8); } - BOOST_FOREACH(point_item const& item, mp2) + for (point_item const& item : mp2) { mapper.map(item, "fill:rgb(0,128,255);stroke:rgb(0,0,100);stroke-width:1", 4); } @@ -447,9 +448,9 @@ void test_many_boxes(int seed, int size, int count) // Test equality in quadratic loop int expected_count = 0; double expected_area = 0.0; - BOOST_FOREACH(box_item const& item1, boxes) + for (box_item const& item1 : boxes) { - BOOST_FOREACH(box_item const& item2, boxes) + for (box_item const& item2 : boxes) { if (item1.id < item2.id) { @@ -478,7 +479,7 @@ void test_many_boxes(int seed, int size, int count) p.x = size + 1; p.y = size + 1; mapper.add(p); } - BOOST_FOREACH(box_item const& item, boxes) + for (box_item const& item : boxes) { mapper.map(item.box, "opacity:0.6;fill:rgb(50,50,210);stroke:rgb(0,0,0);stroke-width:1"); } @@ -515,9 +516,9 @@ void test_two_collections(int seed1, int seed2, int size, int count) // Get expectations in quadratic loop int expected_count = 0; double expected_area = 0.0; - BOOST_FOREACH(box_item const& item1, boxes1) + for (box_item const& item1 : boxes1) { - BOOST_FOREACH(box_item const& item2, boxes2) + for (box_item const& item2 : boxes2) { if (bg::intersects(item1.box, item2.box)) { @@ -543,11 +544,11 @@ void test_two_collections(int seed1, int seed2, int size, int count) p.x = size + 1; p.y = size + 1; mapper.add(p); } - BOOST_FOREACH(box_item const& item, boxes1) + for (box_item const& item : boxes1) { mapper.map(item.box, "opacity:0.6;fill:rgb(50,50,210);stroke:rgb(0,0,0);stroke-width:1"); } - BOOST_FOREACH(box_item const& item, boxes2) + for (box_item const& item : boxes2) { mapper.map(item.box, "opacity:0.6;fill:rgb(0,255,0);stroke:rgb(0,0,0);stroke-width:1"); } @@ -584,9 +585,9 @@ void test_heterogenuous_collections(int seed1, int seed2, int size, int count) // Get expectations in quadratic loop int expected_count = 0; - BOOST_FOREACH(point_item const& point, points) + for (point_item const& point : points) { - BOOST_FOREACH(box_item const& box_item, boxes) + for (box_item const& box_item : boxes) { if (bg::within(point, box_item.box)) { @@ -609,11 +610,11 @@ void test_heterogenuous_collections(int seed1, int seed2, int size, int count) p.x = size + 1; p.y = size + 1; mapper.add(p); } - BOOST_FOREACH(point_item const& point, points) + for (point_item const& point : points) { mapper.map(point, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1", 8); } - BOOST_FOREACH(box_item const& item, boxes) + for (box_item const& item : boxes) { mapper.map(item.box, "opacity:0.6;fill:rgb(0,255,0);stroke:rgb(0,0,0);stroke-width:1"); } diff --git a/test/algorithms/detail/sections/range_by_section.cpp b/test/algorithms/detail/sections/range_by_section.cpp index 1069c4905..b963a759d 100644 --- a/test/algorithms/detail/sections/range_by_section.cpp +++ b/test/algorithms/detail/sections/range_by_section.cpp @@ -11,7 +11,7 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include + #include #define BOOST_GEOMETRY_UNIT_TEST_SECTIONALIZE @@ -58,7 +58,7 @@ void test_sectionalize(std::string const /*caseid*/, Geometry const& geometry, s view_type const >::type range_iterator; - BOOST_FOREACH(typename sections::value_type const& sec, s) + for (typename sections::value_type const& sec : s) { cview_type cview(bg::range_by_section(geometry, sec)); view_type view(cview); diff --git a/test/algorithms/detail/sections/sectionalize.cpp b/test/algorithms/detail/sections/sectionalize.cpp index ce448a1fd..6493c2561 100644 --- a/test/algorithms/detail/sections/sectionalize.cpp +++ b/test/algorithms/detail/sections/sectionalize.cpp @@ -5,8 +5,8 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2020. -// Modifications copyright (c) 2020, Oracle and/or its affiliates. +// This file was modified by Oracle on 2020-2021. +// Modifications copyright (c) 2020-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library @@ -102,7 +102,7 @@ void test_sectionalize(std::string const& caseid, G const& g, std::size_t sectio // Check if sections are consecutive and consistent int previous_index = -1; - BOOST_FOREACH(typename sections::value_type const& sec, s) + for (typename sections::value_type const& sec : s) { if (sec.begin_index > 0) { diff --git a/test/algorithms/detail/tupled_output.cpp b/test/algorithms/detail/tupled_output.cpp index 3454f307b..8b9265a2b 100644 --- a/test/algorithms/detail/tupled_output.cpp +++ b/test/algorithms/detail/tupled_output.cpp @@ -1,8 +1,7 @@ // Boost.Geometry // Unit Test -// Copyright (c) 2019 Oracle and/or its affiliates. - +// Copyright (c) 2019-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -34,14 +33,14 @@ template void test_range_values() { typedef typename bgd::tupled_range_values::type tuple_s; - BOOST_CHECK_EQUAL((boost::is_same::value), true); + BOOST_CHECK_EQUAL((std::is_same::value), true); } template void test_back_inserters() { typedef typename bgd::tupled_back_inserters::type tuple_bi; - BOOST_CHECK_EQUAL((boost::is_same::value), true); + BOOST_CHECK_EQUAL((std::is_same::value), true); TupleM tup; bgd::tupled_back_inserters::apply(tup); diff --git a/test/algorithms/distance/distance.cpp b/test/algorithms/distance/distance.cpp index 30e8eb63f..dbf66afe0 100644 --- a/test/algorithms/distance/distance.cpp +++ b/test/algorithms/distance/distance.cpp @@ -5,6 +5,9 @@ // Copyright (c) 2008-2015 Bruno Lalande, Paris, France. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +// Copyright (c) 2021 Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -20,8 +23,6 @@ #include "test_distance.hpp" #include -#include -#include #include #include @@ -81,7 +82,9 @@ void test_distance_point() BOOST_CONCEPT_ASSERT( (bg::concepts::PointDistanceStrategy) ); typedef typename services::return_type::type cab_return_type; - BOOST_MPL_ASSERT((boost::is_same::type>)); + BOOST_GEOMETRY_STATIC_ASSERT( + (std::is_same::type>::value), + "Unexpected result type"); taxicab_distance tcd; cab_return_type d = bg::distance(p1, p2, tcd); @@ -412,8 +415,8 @@ void test_large_integers() bg::read_wkt(a, da); bg::read_wkt(b, db); - BOOST_AUTO(idist, bg::distance(ia, ib)); - BOOST_AUTO(ddist, bg::distance(da, db)); + auto const idist = bg::distance(ia, ib); + auto const ddist = bg::distance(da, db); BOOST_CHECK_MESSAGE(std::abs(idist - ddist) < 0.1, "within different from within"); @@ -431,8 +434,8 @@ void test_large_integers() bg::read_wkt(a, da); bg::read_wkt(b, db); - BOOST_AUTO(idist, bg::distance(ia, ib)); - BOOST_AUTO(ddist, bg::distance(da, db)); + auto const idist = bg::distance(ia, ib); + auto const ddist = bg::distance(da, db); BOOST_CHECK_MESSAGE(std::abs(idist - ddist) < 0.1, "within different from within"); @@ -457,16 +460,16 @@ void test_variant() variant_type v1, v2; - BOOST_MPL_ASSERT(( - boost::is_same + BOOST_GEOMETRY_STATIC_ASSERT( + (std::is_same < typename bg::distance_result < variant_type, variant_type, bg::default_strategy >::type, double - > - )); + >::value), + "Unexpected result type"); // Default strategy v1 = point; diff --git a/test/algorithms/distance/distance_brute_force.hpp b/test/algorithms/distance/distance_brute_force.hpp index 1e5b8b998..64ad16cd6 100644 --- a/test/algorithms/distance/distance_brute_force.hpp +++ b/test/algorithms/distance/distance_brute_force.hpp @@ -1,8 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2014-2020 Oracle and/or its affiliates. - +// Copyright (c) 2014-2021 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -15,8 +14,6 @@ #include -#include -#include #include #include #include @@ -46,17 +43,13 @@ struct distance_from_bg { template struct use_distance_from_bg - { - typedef typename boost::mpl::or_ + : util::bool_constant < - boost::is_same::type, point_tag>, - typename boost::mpl::or_ - < - boost::is_same::type, segment_tag>, - boost::is_same::type, box_tag> - >::type - >::type type; - }; + std::is_same::type, point_tag>::value + || std::is_same::type, segment_tag>::value + || std::is_same::type, box_tag>::value + > + {}; template static inline @@ -65,8 +58,10 @@ struct distance_from_bg Geometry2 const& geometry2, Strategy const& strategy) { - BOOST_MPL_ASSERT((typename use_distance_from_bg::type)); - BOOST_MPL_ASSERT((typename use_distance_from_bg::type)); + BOOST_GEOMETRY_STATIC_ASSERT((use_distance_from_bg::value), + "Unexpected kind of Geometry1"); + BOOST_GEOMETRY_STATIC_ASSERT((use_distance_from_bg::value), + "Unexpected kind of Geometry1"); return geometry::distance(geometry1, geometry2, strategy); } diff --git a/test/algorithms/distance/distance_geo_linear_box.cpp b/test/algorithms/distance/distance_geo_linear_box.cpp index b7287201d..bb9abac29 100644 --- a/test/algorithms/distance/distance_geo_linear_box.cpp +++ b/test/algorithms/distance/distance_geo_linear_box.cpp @@ -1,25 +1,24 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2017-2020 Oracle and/or its affiliates. - +// Copyright (c) 2017-2021 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, 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 +#ifdef BOOST_GEOMETRY_TEST_DEBUG #include +#endif + +#include #ifndef BOOST_TEST_MODULE #define BOOST_TEST_MODULE test_distance_geographic_linear_areal #endif -#include - #include -#include -#include #include "test_distance_geo_common.hpp" //#include "test_empty_geometry.hpp" diff --git a/test/algorithms/distance/distance_se_geo_ar_ar.cpp b/test/algorithms/distance/distance_se_geo_ar_ar.cpp index 449ea50b0..a0b809af9 100644 --- a/test/algorithms/distance/distance_se_geo_ar_ar.cpp +++ b/test/algorithms/distance/distance_se_geo_ar_ar.cpp @@ -1,8 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2017-2020 Oracle and/or its affiliates. - +// Copyright (c) 2017-2021 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -13,11 +12,7 @@ #define BOOST_TEST_MODULE test_distance_geographic_areal_areal #endif -#include - #include -#include -#include #include "test_distance_geo_common.hpp" #include "test_empty_geometry.hpp" diff --git a/test/algorithms/distance/distance_se_geo_l_ar.cpp b/test/algorithms/distance/distance_se_geo_l_ar.cpp index dca46a264..ae26ce6b7 100644 --- a/test/algorithms/distance/distance_se_geo_l_ar.cpp +++ b/test/algorithms/distance/distance_se_geo_l_ar.cpp @@ -1,25 +1,22 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2017-2020 Oracle and/or its affiliates. - +// Copyright (c) 2017-2021 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, 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 +#ifdef BOOST_GEOMETRY_TEST_DEBUG #include +#endif #ifndef BOOST_TEST_MODULE #define BOOST_TEST_MODULE test_distance_geographic_linear_areal #endif -#include - #include -#include -#include #include "test_distance_geo_common.hpp" #include "test_empty_geometry.hpp" diff --git a/test/algorithms/distance/distance_se_geo_l_l.cpp b/test/algorithms/distance/distance_se_geo_l_l.cpp index 7f0119f59..75d3b9b5e 100644 --- a/test/algorithms/distance/distance_se_geo_l_l.cpp +++ b/test/algorithms/distance/distance_se_geo_l_l.cpp @@ -1,25 +1,22 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2018-2020 Oracle and/or its affiliates. - +// Copyright (c) 2018-2021 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, 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 +#ifdef BOOST_GEOMETRY_TEST_DEBUG #include +#endif #ifndef BOOST_TEST_MODULE #define BOOST_TEST_MODULE test_distance_geographic_linear_linear #endif -#include - #include -#include -#include #include "test_distance_geo_common.hpp" #include "test_empty_geometry.hpp" diff --git a/test/algorithms/distance/distance_se_geo_pl_ar.cpp b/test/algorithms/distance/distance_se_geo_pl_ar.cpp index bd8fce71b..67ca9fadd 100644 --- a/test/algorithms/distance/distance_se_geo_pl_ar.cpp +++ b/test/algorithms/distance/distance_se_geo_pl_ar.cpp @@ -1,25 +1,22 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2017-2020, Oracle and/or its affiliates. - +// Copyright (c) 2017-2021 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, 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 +#ifdef BOOST_GEOMETRY_TEST_DEBUG #include +#endif #ifndef BOOST_TEST_MODULE #define BOOST_TEST_MODULE test_distance_geographic_pointlike_areal #endif -#include - #include -#include -#include #include "test_distance_geo_common.hpp" #include "test_empty_geometry.hpp" diff --git a/test/algorithms/distance/test_distance_common.hpp b/test/algorithms/distance/test_distance_common.hpp index fb8002f99..88c2747d5 100644 --- a/test/algorithms/distance/test_distance_common.hpp +++ b/test/algorithms/distance/test_distance_common.hpp @@ -1,8 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2014-2017, Oracle and/or its affiliates. - +// Copyright (c) 2014-2021, 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 @@ -16,28 +15,16 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include + +#include #include #include -#include -#include -#include - #include #include @@ -207,11 +194,11 @@ private: Strategy, G1, G2 >::type distance_result_from_strategy; - static const bool same_regular = boost::is_same + static const bool same_regular = std::is_same < default_distance_result, distance_result_from_strategy - >::type::value; + >::value; BOOST_CHECK( same_regular ); @@ -231,11 +218,11 @@ private: G2 >::type comparable_distance_result_from_strategy; - static const bool same_comparable = boost::is_same + static const bool same_comparable = std::is_same < default_comparable_distance_result, comparable_distance_result_from_strategy - >::type::value; + >::value; BOOST_CHECK( same_comparable ); diff --git a/test/algorithms/distance/test_distance_geo_common.hpp b/test/algorithms/distance/test_distance_geo_common.hpp index 7620c883a..58695c16c 100644 --- a/test/algorithms/distance/test_distance_geo_common.hpp +++ b/test/algorithms/distance/test_distance_geo_common.hpp @@ -1,9 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2016-2017, Oracle and/or its affiliates. - +// Copyright (c) 2016-2021, Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, 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 @@ -14,29 +14,18 @@ #include #include -#include -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include #include -#include -#include - #include +#include + #include #include @@ -229,7 +218,7 @@ template struct dispatch }; // Specialization for segments -template <> struct dispatch +template <> struct dispatch { template static inline Segment swap(Segment const& s) @@ -259,7 +248,7 @@ template <> struct dispatch }; // Specialization for boxes -template <> struct dispatch +template <> struct dispatch { template static inline T swap(T const& t) @@ -283,7 +272,7 @@ template <> struct dispatch // Specialization for points -template <> struct dispatch +template <> struct dispatch { template static inline T swap(T const& t) @@ -412,11 +401,11 @@ struct test_distance_of_geometries Strategy, Geometry1, Geometry2 >::type distance_result_from_strategy; - static const bool same_regular = boost::is_same + static const bool same_regular = std::is_same < default_distance_result, distance_result_from_strategy - >::type::value; + >::value; BOOST_CHECK(same_regular); @@ -482,12 +471,12 @@ struct test_distance_of_geometries { Geometry1 g1 = dispatch < - typename boost::geometry::tag::type + typename bg::tag::type >::swap(geometry1); Geometry2 g2 = dispatch < - typename boost::geometry::tag::type + typename bg::tag::type >::swap(geometry2); // check distance with given strategy @@ -510,12 +499,12 @@ struct test_distance_of_geometries { Geometry1 g1 = dispatch < - typename boost::geometry::tag::type + typename bg::tag::type >::mirror(geometry1); Geometry2 g2 = dispatch < - typename boost::geometry::tag::type + typename bg::tag::type >::mirror(geometry2); // check distance with given strategy diff --git a/test/algorithms/distance/test_distance_se_common.hpp b/test/algorithms/distance/test_distance_se_common.hpp index 1909c27f9..e8febcd75 100644 --- a/test/algorithms/distance/test_distance_se_common.hpp +++ b/test/algorithms/distance/test_distance_se_common.hpp @@ -1,8 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2014-2017, Oracle and/or its affiliates. - +// Copyright (c) 2014-2021, 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 @@ -12,31 +11,21 @@ #ifndef BOOST_GEOMETRY_TEST_DISTANCE_SE_COMMON_HPP #define BOOST_GEOMETRY_TEST_DISTANCE_SE_COMMON_HPP +#ifdef BOOST_GEOMETRY_TEST_DEBUG #include +#endif + #include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - #include #include #include +#include + +#include +#include + #include #include @@ -192,11 +181,11 @@ struct test_distance_of_geometries Strategy, Geometry1, Geometry2 >::type distance_result_from_strategy; - static const bool same_regular = boost::is_same + static const bool same_regular = std::is_same < default_distance_result, distance_result_from_strategy - >::type::value; + >::value; BOOST_CHECK(same_regular); @@ -212,11 +201,11 @@ struct test_distance_of_geometries Geometry2 >::type comparable_distance_result_from_strategy; - static const bool same_comparable = boost::is_same + static const bool same_comparable = std::is_same < default_comparable_distance_result, comparable_distance_result_from_strategy - >::type::value; + >::value; BOOST_CHECK( same_comparable ); diff --git a/test/algorithms/envelope_expand/envelope_on_spheroid.cpp b/test/algorithms/envelope_expand/envelope_on_spheroid.cpp index 047955ecd..d09e7ddc3 100644 --- a/test/algorithms/envelope_expand/envelope_on_spheroid.cpp +++ b/test/algorithms/envelope_expand/envelope_on_spheroid.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2015-2020, Oracle and/or its affiliates. +// Copyright (c) 2015-2021, Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle @@ -22,34 +22,24 @@ #include #include -#include -#include - #include -#include -#include -#include -#include - -#include - -#include - -#include -#include +#include +#include +#include "test_envelope_expand_on_spheroid.hpp" #include #include #include - +#include +#include +#include +#include #include - -#include "test_envelope_expand_on_spheroid.hpp" - -//TEMP -#include -#include +#include +#include +#include +#include template @@ -74,22 +64,22 @@ struct test_envelope typedef bg::strategy::envelope::spherical_box box_strategy_t; typedef bg::strategy::envelope::geographic, double> strategy_t; - typename boost::mpl::if_c + std::conditional_t < - boost::is_same::type, bg::point_tag>::value, + std::is_same::type, bg::point_tag>::value, point_strategy_t, - typename boost::mpl::if_c + std::conditional_t < - boost::is_same::type, bg::multi_point_tag>::value, + std::is_same::type, bg::multi_point_tag>::value, multi_point_strategy_t, - typename boost::mpl::if_c + std::conditional_t < - boost::is_same::type, bg::box_tag>::value, + std::is_same::type, bg::box_tag>::value, box_strategy_t, strategy_t - >::type - >::type - >::type strategy; + > + > + > strategy; bg::envelope(geometry, detected, strategy); } @@ -327,26 +317,16 @@ public: // test the reverse of a geometry if it is either linear or ring -template ::type> +template struct test_reverse_geometry { - static bool const is_linear = - boost::is_same::value - || boost::is_same::value - || boost::is_same::value; + static bool const is_linear = bg::util::is_linear::value; // currently disable rings static bool const is_ring = false; - // static bool const is_ring = boost::is_same::value; + // static bool const is_ring = bg::util::is_ring::value; - typedef typename boost::mpl::if_c - < - is_linear || is_ring, - boost::true_type, - boost::false_type - >::type type; - - static bool const value = type::value; + static bool const value = (is_linear || is_ring); }; template diff --git a/test/algorithms/envelope_expand/expand_on_spheroid.cpp b/test/algorithms/envelope_expand/expand_on_spheroid.cpp index 16c3a24bd..50e0fc387 100644 --- a/test/algorithms/envelope_expand/expand_on_spheroid.cpp +++ b/test/algorithms/envelope_expand/expand_on_spheroid.cpp @@ -1,8 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2015-2020, Oracle and/or its affiliates. - +// Copyright (c) 2015-2021, Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -17,41 +16,32 @@ #include #include - #include #include #include #include -#include - -#include -#include -#include - -#include - -#include - -#include - -#include -#include - #include #include #include #include #include -#include "test_envelope_expand_on_spheroid.hpp" +#include +#include +#include -// TEMP -#include -#include -#include -#include +#include + +#include +#include + +#include + +#include + +#include "test_envelope_expand_on_spheroid.hpp" class test_expand_on_spheroid @@ -353,7 +343,7 @@ public: basic_tester < - boost::is_same + std::is_same < typename bg::tag::type, bg::box_tag @@ -1070,7 +1060,7 @@ void test_expand_make_inverse() typedef bg::model::segment segment_type; typedef test_expand_on_spheroid tester; - box_type box = boost::geometry::make_inverse(); + box_type box = bg::make_inverse(); tester::apply("bi01", box, diff --git a/test/algorithms/envelope_expand/test_envelope.hpp b/test/algorithms/envelope_expand/test_envelope.hpp index c0dc91639..64792366c 100644 --- a/test/algorithms/envelope_expand/test_envelope.hpp +++ b/test/algorithms/envelope_expand/test_envelope.hpp @@ -2,6 +2,11 @@ // Unit Test // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -28,13 +33,13 @@ struct check_result template struct check_result { - typedef typename bg::coordinate_type::type ctype; - typedef typename boost::mpl::if_ - < - boost::is_arithmetic, - double, - ctype - >::type type; + using ctype = typename bg::coordinate_type::type; + using type = std::conditional_t + < + (std::is_integral::value || std::is_floating_point::value), + double, + ctype + >; static void apply(Box const& b, const type& x1, const type& y1, const type& /*z1*/, const type& x2, const type& y2, const type& /*z2*/) @@ -50,13 +55,13 @@ struct check_result template struct check_result { - typedef typename bg::coordinate_type::type ctype; - typedef typename boost::mpl::if_ - < - boost::is_arithmetic, - double, - ctype - >::type type; + using ctype = typename bg::coordinate_type::type; + using type = std::conditional_t + < + (std::is_integral::value || std::is_floating_point::value), + double, + ctype + >; static void apply(Box const& b, const type& x1, const type& y1, const type& z1, const type& x2, const type& y2, const type& z2) diff --git a/test/algorithms/envelope_expand/test_envelope_expand_on_spheroid.hpp b/test/algorithms/envelope_expand/test_envelope_expand_on_spheroid.hpp index cd6c0e2a8..caf5402f4 100644 --- a/test/algorithms/envelope_expand/test_envelope_expand_on_spheroid.hpp +++ b/test/algorithms/envelope_expand/test_envelope_expand_on_spheroid.hpp @@ -1,8 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2015-2017, Oracle and/or its affiliates. - +// Copyright (c) 2015-2021, 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 @@ -18,8 +17,6 @@ #include #include -#include - #include #include #include @@ -66,7 +63,7 @@ struct rng template char const* units2string() { - if (BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + if (BOOST_GEOMETRY_CONDITION((std::is_same::value))) { return "degrees"; } diff --git a/test/algorithms/equals/equals.cpp b/test/algorithms/equals/equals.cpp index 8e0d23848..dd347709d 100644 --- a/test/algorithms/equals/equals.cpp +++ b/test/algorithms/equals/equals.cpp @@ -3,9 +3,8 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2013-2020. -// Modifications copyright (c) 2013-2020 Oracle and/or its affiliates. - +// This file was modified by Oracle on 2013-2021. +// Modifications copyright (c) 2013-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -14,8 +13,6 @@ #include "test_equals.hpp" -#include - #include #include @@ -59,7 +56,8 @@ void test_segment_segment() template void test_linestring_linestring() { - typedef bgm::linestring

ls; + using coord_t = typename bg::coordinate_type

::type; + using ls = bgm::linestring

; test_geometry("ls2d_1", "LINESTRING(1 1, 3 3)", "LINESTRING(3 3, 1 1)", true); test_geometry("ls2d_2", "LINESTRING(1 1, 3 3, 2 5)", "LINESTRING(1 1, 2 2, 3 3, 2 5)", true); @@ -82,8 +80,7 @@ void test_linestring_linestring() test_geometry("ls2d_overl_ring2", "LINESTRING(0 0,5 0,5 5,0 5,0 0)", "LINESTRING(5 5,5 0,0 0,0 5,5 5,5 0)", true); // https://svn.boost.org/trac/boost/ticket/10904 - if ( BOOST_GEOMETRY_CONDITION( - boost::is_floating_point::type>::value ) ) + if ( BOOST_GEOMETRY_CONDITION(std::is_floating_point::value) ) { test_geometry("ls2d_small1", "LINESTRING(5.6956521739130430148634331999347 -0.60869565217391330413931882503675,5.5 -0.50000000000000066613381477509392)", diff --git a/test/algorithms/overlay/assemble.cpp b/test/algorithms/overlay/assemble.cpp index 78965692a..d53bd9d4a 100644 --- a/test/algorithms/overlay/assemble.cpp +++ b/test/algorithms/overlay/assemble.cpp @@ -3,9 +3,8 @@ // Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2019. -// Modifications copyright (c) 2019, Oracle and/or its affiliates. - +// This file was modified by Oracle on 2019-2021. +// Modifications copyright (c) 2019-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -19,24 +18,22 @@ #include -#include - #include #include #include #include #include #include -#include #include #include -#include - #include #include +#include + +#include #if defined(TEST_WITH_SVG) @@ -60,19 +57,19 @@ inline void test_assemble(std::string const& id, Geometry const& p, Geometry con type area_i = 0, area_u = 0, area_d1 = 0, area_d2 = 0; - BOOST_FOREACH(Geometry const& g, u) + for (Geometry const& g : u) { area_u += bg::area(g); } - BOOST_FOREACH(Geometry const& g, i) + for (Geometry const& g : i) { area_i += bg::area(g); } - BOOST_FOREACH(Geometry const& g, d1) + for (Geometry const& g : d1) { area_d1 += bg::area(g); } - BOOST_FOREACH(Geometry const& g, d2) + for (Geometry const& g : d2) { area_d2 += bg::area(g); } @@ -111,7 +108,7 @@ inline void test_assemble(std::string const& id, Geometry const& p, Geometry con : d2 ; - BOOST_FOREACH(Geometry const& geometry, v) + for (Geometry const& geometry : v) { mapper.map(geometry, linestyle + "stroke-width:3;stroke-linejoin:round;stroke-linecap:square;stroke-dasharray:12,12;stroke:rgb(255,0,0);"); @@ -123,7 +120,6 @@ inline void test_assemble(std::string const& id, Geometry const& p, Geometry con template inline bool int_ok(Polygon const& poly) { - typename bg::point_type::type const& pi = bg::interior_rings(poly)[0].front(); diff --git a/test/algorithms/overlay/dissolver.cpp b/test/algorithms/overlay/dissolver.cpp index c928fa7b3..2d8e28a0f 100644 --- a/test/algorithms/overlay/dissolver.cpp +++ b/test/algorithms/overlay/dissolver.cpp @@ -3,6 +3,10 @@ // Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021 Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -46,7 +50,7 @@ void test_dissolve_plusmin(std::string const& caseid, Collection const& input, T positive_area = T(); T negative_area = T(); - BOOST_FOREACH(geometry_type const& geometry, output) + for (geometry_type const& geometry : output) { T a = bg::area(geometry); if (a > zero) @@ -74,17 +78,17 @@ void test_dissolve_plusmin(std::string const& caseid, Collection const& input, bg::svg_mapper mapper(svg, 500, 500); typedef typename boost::range_value::type value_type; - BOOST_FOREACH(value_type const& geometry, input) + for (value_type const& geometry : input) { mapper.add(geometry); } - BOOST_FOREACH(value_type const& geometry, input) + for (value_type const& geometry : input) { mapper.map(geometry, "opacity:0.6;fill:rgb(0,255,0);stroke:rgb(0,0,0);stroke-width:0.5"); } - BOOST_FOREACH(geometry_type const& geometry, output) + for (geometry_type const& geometry : output) { mapper.map(geometry, bg::area(geometry) > 0 @@ -116,7 +120,7 @@ void test_geometry(std::string const& caseid, std::string const& wkt, typedef typename boost::range_value::type polygon_type; typedef typename bg::ring_type::type ring_type; std::vector rings; - BOOST_FOREACH(polygon_type const& polygon, multi_polygon) + for (polygon_type const& polygon : multi_polygon) { rings.push_back(bg::exterior_ring(polygon)); } diff --git a/test/algorithms/overlay/get_turn_info.cpp b/test/algorithms/overlay/get_turn_info.cpp index a70093de4..d8bb78356 100644 --- a/test/algorithms/overlay/get_turn_info.cpp +++ b/test/algorithms/overlay/get_turn_info.cpp @@ -3,31 +3,26 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2017-2020. -// Modifications copyright (c) 2017-2020, Oracle and/or its affiliates. +// This file was modified by Oracle on 2017-2021. +// Modifications copyright (c) 2017-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) + #include #include -#include -#include - +#include +#include #include #include -#include -#include #include -// TEMP -#include - #if defined(TEST_WITH_SVG) # include #endif @@ -57,7 +52,7 @@ struct sub_range_from_points } private : - boost::array m_points; + Point m_points[3]; }; template diff --git a/test/algorithms/overlay/get_turns.cpp b/test/algorithms/overlay/get_turns.cpp index 5db074ab3..14b7b0f04 100644 --- a/test/algorithms/overlay/get_turns.cpp +++ b/test/algorithms/overlay/get_turns.cpp @@ -5,8 +5,8 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2017. -// Modifications copyright (c) 2017, Oracle and/or its affiliates. +// This file was modified by Oracle on 2017-2021. +// Modifications copyright (c) 2017-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library @@ -122,7 +122,7 @@ struct test_get_turns "stroke:rgb(51,51,153);stroke-width:3"); int index = 0; - BOOST_FOREACH(turn_info const& turn, turns) + for (turn_info const& turn : turns) { mapper.map(turn.point, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1"); diff --git a/test/algorithms/overlay/get_turns_linear_linear.cpp b/test/algorithms/overlay/get_turns_linear_linear.cpp index b6d0c8266..5cda27c34 100644 --- a/test/algorithms/overlay/get_turns_linear_linear.cpp +++ b/test/algorithms/overlay/get_turns_linear_linear.cpp @@ -5,9 +5,8 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2014, 2015. -// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. - +// This file was modified by Oracle on 2014-2021. +// Modifications copyright (c) 2014-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library @@ -215,7 +214,7 @@ void test_all() expected("muu++")); // 29.01.2015 - if ( BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) + if ( BOOST_GEOMETRY_CONDITION((std::is_same::value)) ) { // FAILING - possibly wrong IPs test_geometry("LINESTRING(3 -0.6,0 -0.9)", @@ -308,7 +307,7 @@ void test_all() // determinants. // See also: https://svn.boost.org/trac/boost/ticket/8379 // https://github.com/boostorg/geometry/pull/259 - if ( BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) + if ( BOOST_GEOMETRY_CONDITION((std::is_same::value)) ) { test_geometry("LINESTRING(0 0, 10 0, 20 1)", "LINESTRING(12 10, 13 0.3, 14 0.4, 15 0.5)", @@ -370,7 +369,7 @@ void test_all() //test_geometry("LINESTRING(0 0,2 2,3 3,4 4)", "LINESTRING(0 0,1 1,4 4)", "1FFF0FFF2"); - //if ( boost::is_same::value ) + //if ( std::is_same::value ) //{ // to_svg("LINESTRING(0 0,1 0,2 0,2.5 0,3 1)", "LINESTRING(0 0,2 0,2.5 0,3 1)", "test11.svg"); // to_svg("LINESTRING(0 0,1 0,2 0,2.5 0,3 1)", "LINESTRING(3 1,2.5 0,2 0,0 0)", "test12.svg"); @@ -520,7 +519,7 @@ void test_all() expected("tiu+=")("mui=+")); // parts of boundaries taken from union A/A buffer_mp1 - if ( BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) + if ( BOOST_GEOMETRY_CONDITION((std::is_same::value)) ) { test_geometry("LINESTRING(6.95629520146761 5.415823381635526,6.989043790736545 5.209056926535316,7 5,6.989043790736547 4.790943073464693,6.956295201467611 4.584176618364482)", "LINESTRING(7.415823381635519 5.043704798532389,7.209056926535308 5.010956209263453,7.000000000000001 5,6.790943073464693 5.010956209263453,6.584176618364483 5.043704798532389)", diff --git a/test/algorithms/overlay/get_turns_linear_linear_sph.cpp b/test/algorithms/overlay/get_turns_linear_linear_sph.cpp index a6fdd1330..1de65088f 100644 --- a/test/algorithms/overlay/get_turns_linear_linear_sph.cpp +++ b/test/algorithms/overlay/get_turns_linear_linear_sph.cpp @@ -1,7 +1,7 @@ // Boost.Geometry // Unit Test -// Copyright (c) 2016, Oracle and/or its affiliates. +// Copyright (c) 2016-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -73,7 +73,7 @@ void test_all() "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", expected("tuu==")("ecc==")("mii++")("muu==")("mii++")("muu==")("mii++")); - if (BOOST_GEOMETRY_CONDITION((boost::is_same::value))) + if (BOOST_GEOMETRY_CONDITION((std::is_same::value))) { test_geometry("LINESTRING(-1 0,1 0,2 1.0004570537241201524198894179384922,3 2)", "LINESTRING(4 5,3 2,1 0,0 0)", @@ -223,7 +223,7 @@ void test_all() "LINESTRING(2 0,0 0,-10 0)", expected("tiu+=")("mui=+")); - if ( BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) + if ( BOOST_GEOMETRY_CONDITION((std::is_same::value)) ) { test_geometry("LINESTRING(0 -1, 10 -1, 20 1)", "LINESTRING(12 10, 12.5 -0.50051443471392, 15 0, 17.5 0.50051443471392)", @@ -276,7 +276,7 @@ void test_all() //test_geometry("LINESTRING(0 0,2 2,3 3,4 4)", "LINESTRING(0 0,1 1,4 4)", "1FFF0FFF2"); - //if ( boost::is_same::value ) + //if ( std::is_same::value ) //{ // to_svg("LINESTRING(0 0,1 0,2 0,2.5 0,3 1)", "LINESTRING(0 0,2 0,2.5 0,3 1)", "test11.svg"); // to_svg("LINESTRING(0 0,1 0,2 0,2.5 0,3 1)", "LINESTRING(3 1,2.5 0,2 0,0 0)", "test12.svg"); diff --git a/test/algorithms/overlay/overlay.cpp b/test/algorithms/overlay/overlay.cpp index 5d3c04b21..ee1463216 100644 --- a/test/algorithms/overlay/overlay.cpp +++ b/test/algorithms/overlay/overlay.cpp @@ -3,8 +3,8 @@ // Copyright (c) 2015 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2017-2020. -// Modifications copyright (c) 2017-2020, Oracle and/or its affiliates. +// This file was modified by Oracle on 2017-2021. +// Modifications copyright (c) 2017-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -18,8 +18,6 @@ #include #include -#include - #if defined(TEST_WITH_SVG) # include #endif @@ -27,8 +25,9 @@ #include #include -#include +#include #include +#include #include //#include @@ -37,6 +36,8 @@ # include #endif +#include + #include "multi_overlay_cases.hpp" @@ -72,7 +73,7 @@ struct map_visitor { typedef typename boost::range_value::type turn_type; int index = 0; - BOOST_FOREACH(turn_type const& turn, turns) + for (turn_type const& turn : turns) { switch (phase) { @@ -129,7 +130,7 @@ struct map_visitor { typedef typename boost::range_value::type turn_type; int index = 0; - BOOST_FOREACH(turn_type const& turn, turns) + for (turn_type const& turn : turns) { if (turn.cluster_id >= 0) { diff --git a/test/algorithms/overlay/relative_order.cpp b/test/algorithms/overlay/relative_order.cpp index 8d2a5b47a..89fa77067 100644 --- a/test/algorithms/overlay/relative_order.cpp +++ b/test/algorithms/overlay/relative_order.cpp @@ -3,8 +3,8 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2017. -// Modifications copyright (c) 2017, Oracle and/or its affiliates. +// This file was modified by Oracle on 2017-2021. +// Modifications copyright (c) 2017-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -16,13 +16,9 @@ #include - -#include - -#include - #include #include +#include #include #include @@ -31,8 +27,8 @@ # include #endif -#include #include +#include template diff --git a/test/algorithms/overlay/select_rings.cpp b/test/algorithms/overlay/select_rings.cpp index 89f43732f..2870691f5 100644 --- a/test/algorithms/overlay/select_rings.cpp +++ b/test/algorithms/overlay/select_rings.cpp @@ -2,8 +2,8 @@ // // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // -// This file was modified by Oracle on 2017-2020. -// Modifications copyright (c) 2017-2020 Oracle and/or its affiliates. +// This file was modified by Oracle on 2017-2021. +// Modifications copyright (c) 2017-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // // Use, modification and distribution is subject to the Boost Software License, @@ -12,14 +12,10 @@ #include -#include -#include -#include -#include +#include #include -#include #include #include @@ -28,18 +24,15 @@ #include -#include - - template < typename Geometry1, typename Geometry2, bg::overlay_type OverlayType, - typename RingIdVector + typename RingId > void test_geometry(std::string const& wkt1, std::string const& wkt2, - RingIdVector const& expected_ids) + std::initializer_list const& expected_ids) { typedef bg::detail::overlay::ring_properties < @@ -68,8 +61,8 @@ void test_geometry(std::string const& wkt1, std::string const& wkt2, if (selected.size() <= expected_ids.size()) { - BOOST_AUTO(eit, expected_ids.begin()); - for(typename map_type::const_iterator it = selected.begin(); it != selected.end(); ++it, ++eit) + auto eit = expected_ids.begin(); + for (auto it = selected.begin(); it != selected.end(); ++it, ++eit) { bg::ring_identifier const ring_id = it->first; BOOST_CHECK_EQUAL(ring_id.source_index, eit->source_index); @@ -90,21 +83,19 @@ void test_all() test_geometry, bg::model::polygon

, bg::overlay_union>( winded[0], winded[1], - boost::assign::list_of - (rid(0,-1,-1)) - (rid(0,-1, 0)) - (rid(0,-1, 1)) - (rid(0,-1, 3)) - (rid(1,-1, 1)) - (rid(1,-1, 2))); + { rid(0,-1,-1), + rid(0,-1, 0), + rid(0,-1, 1), + rid(0,-1, 3), + rid(1,-1, 1), + rid(1,-1, 2) }); test_geometry, bg::model::polygon

, bg::overlay_intersection>( winded[0], winded[1], - boost::assign::list_of - (rid(0,-1, 2)) - (rid(1,-1,-1)) - (rid(1,-1, 0)) - (rid(1,-1, 3))); + { rid(0,-1, 2), + rid(1,-1,-1), + rid(1,-1, 0), + rid(1,-1, 3), }); } diff --git a/test/algorithms/overlay/self_intersection_points.cpp b/test/algorithms/overlay/self_intersection_points.cpp index 16b8ed24f..54d853ae2 100644 --- a/test/algorithms/overlay/self_intersection_points.cpp +++ b/test/algorithms/overlay/self_intersection_points.cpp @@ -5,8 +5,8 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2017-2020. -// Modifications copyright (c) 2017-2020, Oracle and/or its affiliates. +// This file was modified by Oracle on 2017-2021. +// Modifications copyright (c) 2017-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library @@ -77,7 +77,7 @@ static void test_self_intersection_points(std::string const& case_id, typedef typename bg::coordinate_type::type ct; ct zero = ct(); ct x = zero, y = zero; - BOOST_FOREACH(turn_info const& turn, turns) + for (turn_info const& turn : turns) { x += bg::get<0>(turn.point); y += bg::get<1>(turn.point); @@ -141,7 +141,7 @@ static void test_self_intersection_points(std::string const& case_id, mapper.map(geometry, "fill:rgb(255,255,128);stroke:rgb(0,0,0);stroke-width:1"); - BOOST_FOREACH(turn_info const& turn, turns) + for (turn_info const& turn : turns) { mapper.map(turn.point, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1"); } diff --git a/test/algorithms/overlay/sort_by_side.cpp b/test/algorithms/overlay/sort_by_side.cpp index 2966d2a44..c8ecc6b97 100644 --- a/test/algorithms/overlay/sort_by_side.cpp +++ b/test/algorithms/overlay/sort_by_side.cpp @@ -4,8 +4,8 @@ // Copyright (c) 2016 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2017-2020. -// Modifications copyright (c) 2017-2020, Oracle and/or its affiliates. +// This file was modified by Oracle on 2017-2021. +// Modifications copyright (c) 2017-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -14,11 +14,11 @@ #include -#include +#include #include +#include #include -#include -#include +#include #include "multi_overlay_cases.hpp" @@ -31,7 +31,7 @@ std::string as_string(std::vector const& v) { std::stringstream out; bool first = true; - BOOST_FOREACH(T const& value, v) + for (T const& value : v) { out << (first ? "[" : " , ") << value; first = false; @@ -217,13 +217,11 @@ void test_sort_by_side(std::string const& case_id, // Define two small macro's to avoid repetitions of testcases/names etc -#define TEST_INT(caseid, exp) { (test_sort_by_side) \ - ( #caseid "_int", caseid[0], caseid[1], exp); } +#define TEST_INT(caseid, exp, ...) { (test_sort_by_side) \ + ( #caseid "_int", caseid[0], caseid[1], exp, __VA_ARGS__); } -#define TEST_UNION(caseid, exp) { (test_sort_by_side) \ - ( #caseid "_union", caseid[0], caseid[1], exp); } - -using boost::assign::list_of; +#define TEST_UNION(caseid, exp, ...) { (test_sort_by_side) \ + ( #caseid "_union", caseid[0], caseid[1], exp, __VA_ARGS__); } template void test_all() @@ -234,31 +232,31 @@ void test_all() // Selection of test cases having only one cluster - TEST_INT(case_64_multi, list_of(1)); - TEST_INT(case_72_multi, list_of(3)); - TEST_INT(case_107_multi, list_of(2)); - TEST_INT(case_123_multi, list_of(3)); - TEST_INT(case_124_multi, list_of(3)); - TEST_INT(case_recursive_boxes_10, list_of(2)); - TEST_INT(case_recursive_boxes_20, list_of(2)); - TEST_INT(case_recursive_boxes_21, list_of(1)); - TEST_INT(case_recursive_boxes_22, list_of(0)); + TEST_INT(case_64_multi, {1}); + TEST_INT(case_72_multi, {3}); + TEST_INT(case_107_multi, {2}); + TEST_INT(case_123_multi, {3}); + TEST_INT(case_124_multi, {3}); + TEST_INT(case_recursive_boxes_10, {2}); + TEST_INT(case_recursive_boxes_20, {2}); + TEST_INT(case_recursive_boxes_21, {2}); + TEST_INT(case_recursive_boxes_22, {0}); - TEST_UNION(case_recursive_boxes_46, list_of(2)(1)(2)(1)(1)(2)(1)); + TEST_UNION(case_recursive_boxes_46, {2, 1, 2, 1, 1, 2, 1}); - TEST_UNION(case_62_multi, list_of(2)); - TEST_UNION(case_63_multi, list_of(2)); - TEST_UNION(case_64_multi, list_of(1)); - TEST_UNION(case_107_multi, list_of(1)); - TEST_UNION(case_123_multi, list_of(1)); - TEST_UNION(case_124_multi, list_of(1)); - TEST_UNION(case_recursive_boxes_10, list_of(1)); - TEST_UNION(case_recursive_boxes_18, list_of(3)); - TEST_UNION(case_recursive_boxes_19, list_of(3)); - TEST_UNION(case_recursive_boxes_20, list_of(2)); - TEST_UNION(case_recursive_boxes_21, list_of(1)); - TEST_UNION(case_recursive_boxes_22, list_of(1)); - TEST_UNION(case_recursive_boxes_23, list_of(3)); + TEST_UNION(case_62_multi, {2}); + TEST_UNION(case_63_multi, {2}); + TEST_UNION(case_64_multi, {1}); + TEST_UNION(case_107_multi, {1}); + TEST_UNION(case_123_multi, {1}); + TEST_UNION(case_124_multi, {1}); + TEST_UNION(case_recursive_boxes_10, {1}); + TEST_UNION(case_recursive_boxes_18, {3}); + TEST_UNION(case_recursive_boxes_19, {3}); + TEST_UNION(case_recursive_boxes_20, {2}); + TEST_UNION(case_recursive_boxes_21, {1}); + TEST_UNION(case_recursive_boxes_22, {1}); + TEST_UNION(case_recursive_boxes_23, {3}); } int test_main(int, char* []) diff --git a/test/algorithms/overlay/sort_by_side_basic.cpp b/test/algorithms/overlay/sort_by_side_basic.cpp index a77f2e4dd..4ce87c724 100644 --- a/test/algorithms/overlay/sort_by_side_basic.cpp +++ b/test/algorithms/overlay/sort_by_side_basic.cpp @@ -4,8 +4,8 @@ // Copyright (c) 2017 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2017-2020. -// Modifications copyright (c) 2017-2020, Oracle and/or its affiliates. +// This file was modified by Oracle on 2017-2021. +// Modifications copyright (c) 2017-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -14,18 +14,13 @@ #include -#include - -#include // for equals/within +#include #include #include -#include +#include #include -#include #include - -#include -#include +#include #if defined(TEST_WITH_SVG) #include "debug_sort_by_side_svg.hpp" @@ -40,7 +35,7 @@ std::string as_string(std::vector const& v) { std::stringstream out; bool first = true; - BOOST_FOREACH(T const& value, v) + for (T const& value : v) { out << (first ? "[" : " , ") << value; first = false; @@ -268,8 +263,6 @@ void test_basic(std::string const& case_id, expected_open_count, expected_max_rank, expected_right_count); } -using boost::assign::list_of; - template void test_all() { @@ -277,67 +270,67 @@ void test_all() "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)))", "MULTIPOLYGON(((1 0,1 1,2 1,2 0,1, 0)))", "POINT(1 1)", "POINT(1 0)", - 2, 3, list_of(-1)(1)(-1)(1)); + 2, 3, {-1, 1, -1, 1}); test_basic("dup1", "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)))", "MULTIPOLYGON(((1 0,1 1,2 1,2 0,1, 0)),((0 2,1 2,1 1,0 1,0 2)))", "POINT(1 1)", "POINT(1 0)", - 2, 3, list_of(-1)(1)(-1)(2)); + 2, 3, {-1, 1, -1, 2}); test_basic("dup2", "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)),((1 0,1 1,2 1,2 0,1, 0)))", "MULTIPOLYGON(((1 0,1 1,2 1,2 0,1, 0)))", "POINT(1 1)", "POINT(1 0)", - 2, 3, list_of(-1)(2)(-1)(1)); + 2, 3, {-1, 2, -1, 1}); test_basic("dup3", "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)),((1 0,1 1,2 1,2 0,1, 0)))", "MULTIPOLYGON(((1 0,1 1,2 1,2 0,1, 0)),((0 2,1 2,1 1,0 1,0 2)))", "POINT(1 1)", "POINT(1 0)", - 2, 3, list_of(-1)(2)(-1)(2)); + 2, 3, {-1, 2, -1, 2}); test_basic("threequart1", "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)),((1 0,1 1,2 1,2 0,1, 0)))", "MULTIPOLYGON(((1 2,2 2,2 1,1 1,1 2)))", "POINT(1 1)", "POINT(1 0)", - 1, 3, list_of(-1)(1)(1)(1)); + 1, 3, {-1, 1, 1, 1}); test_basic("threequart2", "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)),((1 0,1 1,2 1,2 0,1, 0)))", "MULTIPOLYGON(((1 2,2 2,2 1,1 1,1 2)),((2 0,1 0,1 1,2 0)))", "POINT(1 1)", "POINT(1 0)", - 1, 4, list_of(-1)(2)(1)(1)(1)); + 1, 4, {-1, 2, 1, 1, 1}); test_basic("threequart3", "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)),((1 0,1 1,2 1,2 0,1, 0)))", "MULTIPOLYGON(((1 2,2 2,2 1,1 1,1 2)),((2 0,1 0,1 1,2 0)),((0 1,0 2,1 1,0 1)))", "POINT(1 1)", "POINT(1 0)", - 1, 5, list_of(-1)(2)(1)(1)(-1)(2)); + 1, 5, {-1, 2, 1, 1, -1, 2}); test_basic("full1", "MULTIPOLYGON(((0 2,1 2,1 1,0 1,0 2)),((1 0,1 1,2 1,2 0,1, 0)))", "MULTIPOLYGON(((1 2,2 2,2 1,1 1,1 2)),((0 0,0 1,1 1,1 0,0 0)))", "POINT(1 1)", "POINT(1 0)", - 0, 3, list_of(1)(1)(1)(1)); + 0, 3, {1, 1, 1, 1}); test_basic("hole1", "MULTIPOLYGON(((0 0,0 3,2 3,2 2,3 2,3 0,0 0),(1 1,2 1,2 2,1 2,1 1)),((4 2,3 2,3 3,4 3,4 2)))", "MULTIPOLYGON(((1 0,1 1,2 1,2 2,1 2,1 4,4 4,4 0,1, 0),(3 2,3 3,2 3,2 2,3 2)))", "POINT(1 2)", "POINT(2 2)", - 1, 2, list_of(-1)(2)(1)); + 1, 2, {-1, 2, 1}); test_basic("hole2", "MULTIPOLYGON(((0 0,0 3,2 3,2 2,3 2,3 0,0 0),(1 1,2 1,2 2,1 2,1 1)),((4 2,3 2,3 3,4 3,4 2)))", "MULTIPOLYGON(((1 0,1 1,2 1,2 2,1 2,1 4,4 4,4 0,1, 0),(3 2,3 3,2 3,2 2,3 2)))", "POINT(2 2)", "POINT(2 1)", - 2, 3, list_of(-1)(2)(-1)(2)); + 2, 3, {-1, 2, -1, 2}); test_basic("hole3", "MULTIPOLYGON(((0 0,0 3,2 3,2 2,3 2,3 0,0 0),(1 1,2 1,2 2,1 2,1 1)),((4 2,3 2,3 3,4 3,4 2)))", "MULTIPOLYGON(((1 0,1 1,2 1,2 2,1 2,1 4,4 4,4 0,1, 0),(3 2,3 3,2 3,2 2,3 2)))", "POINT(3 2)", "POINT(2 2)", - 1, 3, list_of(-1)(2)(-1)(2)); + 1, 3, {-1, 2, -1, 2}); } diff --git a/test/algorithms/overlay/split_rings.cpp b/test/algorithms/overlay/split_rings.cpp index 00cf9f85b..90704de0e 100644 --- a/test/algorithms/overlay/split_rings.cpp +++ b/test/algorithms/overlay/split_rings.cpp @@ -5,6 +5,10 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -62,7 +66,7 @@ struct test_split_rings mapper.map(geometry, "fill:rgb(255,255,128);stroke:rgb(0,0,0);stroke-width:1"); - BOOST_FOREACH(ring_type const& ring, rings) + for (ring_type const& ring : rings) { std::string style = "opacity:0.6;fill:rgb"; std::string color = bg::area(ring) > 0 ? "(255,0,0)" : "(0,0,255)"; diff --git a/test/algorithms/overlay/traverse.cpp b/test/algorithms/overlay/traverse.cpp index 2e4f801cc..50bd474fc 100644 --- a/test/algorithms/overlay/traverse.cpp +++ b/test/algorithms/overlay/traverse.cpp @@ -3,6 +3,10 @@ // Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -17,8 +21,6 @@ #include #include -#include - #include @@ -34,32 +36,28 @@ # define BOOST_GEOMETRY_DEBUG_IDENTIFIER #endif -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include - #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include - #if defined(TEST_WITH_SVG) # include #endif +#include + #include #include @@ -143,10 +141,10 @@ struct test_traverse //std::cout << bg::area(g1) << " " << bg::area(g2) << std::endl; #endif - typedef typename bg::strategy::side::services::default_strategy - < - typename bg::cs_tag::type - >::type side_strategy_type; + typename bg::strategy::intersection::services::default_strategy + < + typename bg::cs_tag::type + >::type strategy; typedef typename bg::point_type::type point_type; typedef typename bg::rescale_policy_type::type @@ -162,15 +160,11 @@ struct test_traverse > turn_info; std::vector turns; - bg::detail::overlay::operation_type const op = - OverlayType == bg::overlay_union - ? bg::detail::overlay::operation_union - : bg::detail::overlay::operation_intersection; + std::map clusters; bg::detail::get_turns::no_interrupt_policy policy; - bg::get_turns(g1, g2, rescale_policy, turns, policy); - bg::enrich_intersection_points(turns, op, - g1, g2, rescale_policy, side_strategy_type()); + bg::get_turns(g1, g2, strategy, rescale_policy, turns, policy); + bg::enrich_intersection_points(turns, clusters, g1, g2, rescale_policy, strategy); typedef bg::model::ring::type> ring_type; typedef std::vector out_vector; @@ -178,11 +172,13 @@ struct test_traverse bg::detail::overlay::overlay_null_visitor visitor; + // TODO: this function requires additional arguments bg::detail::overlay::traverse < Reverse1, Reverse2, - G1, G2 - >::apply(g1, g2, op, rescale_policy, turns, v, visitor); + G1, G2, + OverlayType + >::apply(g1, g2, strategy, rescale_policy, turns, v, visitor); // Check number of resulting rings BOOST_CHECK_MESSAGE(expected_count == boost::size(v), @@ -196,7 +192,7 @@ struct test_traverse // Check total area of resulting rings typename bg::default_area_result::type total_area = 0; - BOOST_FOREACH(ring_type const& ring, v) + for (ring_type const& ring : v) { total_area += bg::area(ring); //std::cout << bg::wkt(ring) << std::endl; @@ -225,7 +221,7 @@ struct test_traverse "stroke:rgb(51,51,153);stroke-width:3"); // Traversal rings in magenta outline/red fill -> over blue/green this gives brown - BOOST_FOREACH(ring_type const& ring, v) + for (ring_type const& ring : v) { mapper.map(ring, "fill-opacity:0.2;stroke-opacity:0.4;fill:rgb(255,0,0);" "stroke:rgb(255,0,255);stroke-width:8"); @@ -239,7 +235,7 @@ struct test_traverse int index = 0; int const margin = 5; - BOOST_FOREACH(turn_info const& turn, turns) + for (turn_info const& turn : turns) { int lineheight = 8; mapper.map(turn.point, "fill:rgb(255,128,0);" @@ -771,8 +767,7 @@ void test_all(bool test_self_tangencies = true, bool test_mixed = false) } */ - static const bool is_float - = boost::is_same::value; + static const bool is_float = std::is_same::value; static const double float_might_deviate_more = is_float ? 0.1 : 0.001; // In some cases up to 1 promille permitted diff --git a/test/algorithms/overlay/traverse_ccw.cpp b/test/algorithms/overlay/traverse_ccw.cpp index f93980860..a3f643606 100644 --- a/test/algorithms/overlay/traverse_ccw.cpp +++ b/test/algorithms/overlay/traverse_ccw.cpp @@ -3,6 +3,10 @@ // Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -13,11 +17,11 @@ #include #include -#include - #include -#include +#include +#include +#include #include #include #include @@ -26,14 +30,12 @@ # include #endif -#include #include #include template -struct rev : boost::mpl::if_c::value == bg::counterclockwise, boost::true_type, boost::false_type>::type -{}; +using rev = bg::util::bool_constant::value == bg::counterclockwise>; template inline typename bg::coordinate_type::type @@ -89,7 +91,7 @@ intersect(Geometry1 const& g1, Geometry2 const& g2, std::string const& name, >::apply(g1, g2, op, rescale_policy, turns, v); typename bg::coordinate_type::type result = 0.0; - BOOST_FOREACH(ring_type& ring, v) + for (ring_type& ring : v) { result += bg::area(ring); } @@ -117,7 +119,7 @@ intersect(Geometry1 const& g1, Geometry2 const& g2, std::string const& name, "stroke:rgb(51,51,153);stroke-width:3"); // Traversal rings in magenta/light yellow fill - BOOST_FOREACH(ring_type const& ring, v) + for (ring_type const& ring : v) { mapper.map(ring, "fill-opacity:0.3;stroke-opacity:0.4;fill:rgb(255,255,0);" "stroke:rgb(255,0,255);stroke-width:8"); @@ -132,7 +134,7 @@ intersect(Geometry1 const& g1, Geometry2 const& g2, std::string const& name, int const lineheight = 10; int const margin = 5; - BOOST_FOREACH(turn_info const& turn, turns) + for (turn_info const& turn : turns) { mapper.map(turn.point, "fill:rgb(255,128,0);" "stroke:rgb(0,0,0);stroke-width:1", 3); diff --git a/test/algorithms/point_on_surface.cpp b/test/algorithms/point_on_surface.cpp index 7ee5eb880..048635ecb 100644 --- a/test/algorithms/point_on_surface.cpp +++ b/test/algorithms/point_on_surface.cpp @@ -6,9 +6,8 @@ // Copyright (c) 2009-2015 Mateusz Loskot, London, UK. // Copyright (c) 2013-2017 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014, 2015. -// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. - +// This file was modified by Oracle on 2014-2021. +// Modifications copyright (c) 2014-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library @@ -101,7 +100,7 @@ void test_geometry(std::string const& case_id, Geometry const& geometry, double // Top (red/magenta) mapper.map(top_points, "stroke:rgb(255,0,0);stroke-width:2"); - BOOST_FOREACH(intruder_type const& intruder, top_intruders) + for (intruder_type const& intruder : top_intruders) { mapper.map(intruder, "stroke:rgb(255,0,255);stroke-width:2"); } @@ -111,7 +110,7 @@ void test_geometry(std::string const& case_id, Geometry const& geometry, double //// Right (blue/cyan) // (mostly commented, makes the picture less clear) //mapper.map(right_points, "stroke:rgb(0,0,255);stroke-width:2"); - //BOOST_FOREACH(intruder_type const& intruder, right_intruders) + //for (intruder_type const& intruder : right_intruders) //{ // mapper.map(intruder, "stroke:rgb(0,255,255);stroke-width:2"); //} diff --git a/test/algorithms/relate/nan_cases.hpp b/test/algorithms/relate/nan_cases.hpp index 24306202d..bbd888831 100644 --- a/test/algorithms/relate/nan_cases.hpp +++ b/test/algorithms/relate/nan_cases.hpp @@ -1,7 +1,6 @@ // Boost.Geometry -// Copyright (c) 2015 Oracle and/or its affiliates. - +// Copyright (c) 2015-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -14,7 +13,6 @@ #include #include -#include template struct pusher @@ -125,6 +123,6 @@ struct is_nan_case_supported { typedef typename bg::coordinate_type::type coord_t; - static const bool value = boost::is_same::value + static const bool value = std::is_same::value && std::numeric_limits::has_quiet_NaN; }; diff --git a/test/algorithms/relate/relate_areal_areal.cpp b/test/algorithms/relate/relate_areal_areal.cpp index 739a37a35..bee45efa9 100644 --- a/test/algorithms/relate/relate_areal_areal.cpp +++ b/test/algorithms/relate/relate_areal_areal.cpp @@ -2,9 +2,8 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2013, 2014, 2015. -// Modifications copyright (c) 2013-2015 Oracle and/or its affiliates. - +// This file was modified by Oracle on 2013-2021. +// Modifications copyright (c) 2013-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -19,8 +18,9 @@ template void test_polygon_polygon() { - typedef bg::model::polygon

poly; - typedef bg::model::ring

ring; + using coord_t = typename bg::coordinate_type

::type; + using poly = bg::model::polygon

; + using ring = bg::model::ring

; // touching test_geometry("POLYGON((0 0,0 10,10 10,10 0,0 0))", @@ -306,8 +306,7 @@ void test_polygon_polygon() "212101212"); } - if ( BOOST_GEOMETRY_CONDITION(( - boost::is_same::type, double>::value )) ) + if ( BOOST_GEOMETRY_CONDITION((std::is_same::value)) ) { // original - assertion for CCW //"POLYGON((-0.593220338983050821113352 -8.05084745762711939676137,1.14285714285714279370154 -4,1.50731707317073171381594 1.10243902439024443751237,1.73758865248226967992196 1.37588652482269591104114,1.21739130434782616418943 -3.82608695652173924628414,2 -2,2 1.68750000000000044408921,2.35384615384615436539661 2.10769230769230775379697,2 2.16666666666666651863693,2 4,1.81967213114754100544701 2.1967213114754100544701,1.5882352941176469673934 2.2352941176470588757752,1.8148148148148146585612 5.4074074074074074403029,-0.538461538461538546940233 4.23076923076923083755219,-1.76510067114094004736558 2.89261744966443012927471,-1.64864864864864868465588 2.7567567567567570208098,-1.83962264150943455298659 2.81132075471698161805989,-1.84337349397590433142113 2.80722891566265086993326,-2.14285714285714279370154 2.85714285714285720629846,-2.11111111111111116045436 2.88888888888888883954564,-2.87234042553191448732264 3.10638297872340407579372,-2.91803278688524558859285 3.4262295081967208965068,-3.1733333333333324510761 3.26666666666666660745477,-2.99999999999999822364316 3.14285714285714234961233,-3.25490196078431326398572 3.21568627450980359938626,-3.47368421052631504153396 3.07894736842105265495206,-7.32000000000000028421709 3.72000000000000019539925,-7.54716981132075481752963 3.62264150943396234794136,-7.75 3.79166666666666651863693,-7.79999999999999982236432 3.79999999999999982236432,-7.59999999999999964472863 3.60000000000000008881784,-8.8556701030927822415606 3.06185567010309300783888,-8.82945736434108674473009 2.8914728682170549589614,-7.73333333333333339254523 2.193939393939393855959,-8 2,-5.94736842105263185942476 -1.42105263157894645686952,-5.32558139534883689947264 -0.488372093023255016142059,-5.85714285714285765038767 1.00000000000000066613381,-4.78723404255319184841255 0.319148936170212838003835,-5.32558139534883689947264 -0.488372093023255016142059,-4.74019607843137258385013 -2.12745098039215774221589,-3.17647058823529437887601 -0.705882352941176627325603,-2.93103448275862055183438 -0.862068965517241436735674,-3 -1,-4.57894736842105309904127 -2.57894736842105265495206,-4.47887323943661996850096 -2.85915492957746497637572,-7.58620689655172419918472 -5.18965517241379359347775,-7.52525252525252508206677 -5.5858585858585865224768,-4.18644067796610119813749 -3.67796610169491522412955,-3.44041450777202051369841 -5.76683937823834202873741,-3.73611111111111116045436 -6.56944444444444464181743,-2.8823529411764705621124 -7.7647058823529411242248,-2.88235294117647100620161 -7.7647058823529411242248,-0.593220338983050821113352 -8.05084745762711939676137),(1.66666666666666696272614 1.59999999999999875655021,1.43749999999999911182158 1.8750000000000002220446,0.0869565217391310429917439 2.26086956521739113057379,0.466666666666667118157363 2.60606060606060552231611,1.04878048780487764801705 2.34146341463414664474385,1.43749999999999911182158 1.8750000000000002220446,1.56756756756756754356275 1.83783783783783771781373,1.66666666666666696272614 1.59999999999999875655021))" diff --git a/test/algorithms/relate/relate_linear_areal_sph.cpp b/test/algorithms/relate/relate_linear_areal_sph.cpp index e3034301c..630b0a0f7 100644 --- a/test/algorithms/relate/relate_linear_areal_sph.cpp +++ b/test/algorithms/relate/relate_linear_areal_sph.cpp @@ -1,8 +1,7 @@ // Boost.Geometry // Unit Test -// Copyright (c) 2016, Oracle and/or its affiliates. - +// Copyright (c) 2016-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -287,8 +286,7 @@ void test_multi_linestring_polygon() "POLYGON((5 0,0 -5,-5 0,0 5,5 0))", "1F10F0212"); - if ( BOOST_GEOMETRY_CONDITION(( - boost::is_same::value )) ) + if ( BOOST_GEOMETRY_CONDITION((std::is_same::value)) ) { // assertion failure in 1.57 test_geometry("MULTILINESTRING((-0.59322033898305082 -8.0508474576271194,-2.882352941176471 -7.7647058823529411,-2.8823529411764706 -7.7647058823529411,-3.7361111111111112 -6.5694444444444446,-3.4404145077720205 -5.766839378238342,-4.1864406779661012 -3.6779661016949152,-7.5252525252525251 -5.5858585858585865,-7.5862068965517242 -5.1896551724137936,-4.47887323943662 -2.859154929577465,-4.5789473684210531 -2.5789473684210527,-3 -1,-2.9310344827586206 -0.86206896551724144,-3.1764705882352944 -0.70588235294117663,-4.7401960784313726 -2.1274509803921577,-5.3255813953488369 -0.48837209302325502,-4.7872340425531918 0.31914893617021284,-5.8571428571428577 1.0000000000000007,-5.3255813953488369 -0.48837209302325502,-5.9473684210526319 -1.4210526315789465,-8 2,-7.7333333333333334 2.1939393939393939,-8.8294573643410867 2.891472868217055,-8.8556701030927822 3.061855670103093,-7.5999999999999996 3.6000000000000001,-7.7999999999999998 3.7999999999999998,-7.75 3.7916666666666665,-7.5471698113207548 3.6226415094339623,-7.3200000000000003 3.7200000000000002,-3.473684210526315 3.0789473684210527,-3.2549019607843133 3.2156862745098036,-2.9999999999999982 3.1428571428571423,-3.1733333333333325 3.2666666666666666,-2.9180327868852456 3.4262295081967209,-2.8723404255319145 3.1063829787234041,-2.1111111111111112 2.8888888888888888,-2.1428571428571428 2.8571428571428572,-1.8433734939759043 2.8072289156626509,-1.8396226415094346 2.8113207547169816,-1.6486486486486487 2.756756756756757,-1.76510067114094 2.8926174496644301,-0.53846153846153855 4.2307692307692308,1.8148148148148147 5.4074074074074074,1.588235294117647 2.2352941176470589,1.819672131147541 2.1967213114754101,2 4,2 2.1666666666666665,2.3538461538461544 2.1076923076923078,2 1.6875000000000004,2 -2,1.2173913043478262 -3.8260869565217392,1.7375886524822697 1.3758865248226959,1.5073170731707317 1.1024390243902444,1.1428571428571428 -4,-0.59322033898305082 -8.0508474576271194),(1.666666666666667 1.5999999999999988,1.5675675675675675 1.8378378378378377,1.4374999999999991 1.8750000000000002,1.0487804878048776 2.3414634146341466,0.46666666666666712 2.6060606060606055,0.086956521739131043 2.2608695652173911,1.4374999999999991 1.8750000000000002,1.666666666666667 1.5999999999999988))", diff --git a/test/algorithms/relate/relate_linear_linear.cpp b/test/algorithms/relate/relate_linear_linear.cpp index d109e8b92..0dbf139c1 100644 --- a/test/algorithms/relate/relate_linear_linear.cpp +++ b/test/algorithms/relate/relate_linear_linear.cpp @@ -2,9 +2,8 @@ // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2013, 2014, 2015. -// Modifications copyright (c) 2013-2015 Oracle and/or its affiliates. - +// This file was modified by Oracle on 2013-2021. +// Modifications copyright (c) 2013-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -19,7 +18,8 @@ template void test_linestring_linestring() { - typedef bg::model::linestring

ls; + using coord_t = typename bg::coordinate_type

::type; + using ls = bg::model::linestring

; test_geometry("LINESTRING(0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 3 2)", "1FFF0FFF2"); test_geometry("LINESTRING(0 0,3 2)", "LINESTRING(0 0, 2 2, 3 2)", "FF1F0F1F2"); @@ -185,8 +185,7 @@ void test_linestring_linestring() // Point/Point //test_geometry("LINESTRING(0 0)", "LINESTRING(0 0)", "0FFFFFFF2"); - if ( BOOST_GEOMETRY_CONDITION( - boost::is_floating_point::type>::value ) ) + if ( BOOST_GEOMETRY_CONDITION(std::is_floating_point::value) ) { // https://svn.boost.org/trac/boost/ticket/10904 // very small segments @@ -198,8 +197,7 @@ void test_linestring_linestring() "FF1F00102", "F0FFFF102"); // on some platforms the first Linestring may be detected as degenerated to Point } - if ( BOOST_GEOMETRY_CONDITION(( - boost::is_same::type, double>::value )) ) + if ( BOOST_GEOMETRY_CONDITION((std::is_same::value)) ) { // detected as collinear test_geometry("LINESTRING(1 -10, 3.069359e+307 3.069359e+307)", @@ -247,8 +245,9 @@ void test_linestring_linestring() template void test_linestring_multi_linestring() { - typedef bg::model::linestring

ls; - typedef bg::model::multi_linestring mls; + using coord_t = typename bg::coordinate_type

::type; + using ls = bg::model::linestring

; + using mls = bg::model::multi_linestring; // LS disjoint test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,2 0),(1 1,2 1))", "101FF0102"); @@ -347,7 +346,7 @@ void test_linestring_multi_linestring() "10FF0F102"); // | // | - if ( BOOST_GEOMETRY_CONDITION(boost::is_floating_point::type>::value) ) + if ( BOOST_GEOMETRY_CONDITION(std::is_floating_point::value) ) { // related to https://svn.boost.org/trac/boost/ticket/10904 test_geometry("LINESTRING(-2305843009213693956 4611686018427387906, -33 -92, 78 83)", @@ -386,8 +385,9 @@ void test_linestring_multi_linestring() template void test_multi_linestring_multi_linestring() { - typedef bg::model::linestring

ls; - typedef bg::model::multi_linestring mls; + using coord_t = typename bg::coordinate_type

::type; + using ls = bg::model::linestring

; + using mls = bg::model::multi_linestring; test_geometry("MULTILINESTRING((0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0))", "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0))", @@ -415,8 +415,7 @@ void test_multi_linestring_multi_linestring() "MULTILINESTRING((5 5,0 5),(5 5,5 0),(10 10,10 5,5 5,5 10,10 10))", "10FFFFFF2"); - if ( BOOST_GEOMETRY_CONDITION(( - boost::is_same::type, double>::value )) ) + if ( BOOST_GEOMETRY_CONDITION((std::is_same::value)) ) { // assertion failure in 1.57 test_geometry("MULTILINESTRING((-0.59322033898305082 -8.0508474576271194,-2.882352941176471 -7.7647058823529411,-2.8823529411764706 -7.7647058823529411,-3.7361111111111112 -6.5694444444444446,-3.4404145077720205 -5.766839378238342,-4.1864406779661012 -3.6779661016949152,-7.5252525252525251 -5.5858585858585865,-7.5862068965517242 -5.1896551724137936,-4.47887323943662 -2.859154929577465,-4.5789473684210531 -2.5789473684210527,-3 -1,-2.9310344827586206 -0.86206896551724144,-3.1764705882352944 -0.70588235294117663,-4.7401960784313726 -2.1274509803921577,-5.3255813953488369 -0.48837209302325502,-4.7872340425531918 0.31914893617021284,-5.8571428571428577 1.0000000000000007,-5.3255813953488369 -0.48837209302325502,-5.9473684210526319 -1.4210526315789465,-8 2,-7.7333333333333334 2.1939393939393939,-8.8294573643410867 2.891472868217055,-8.8556701030927822 3.061855670103093,-7.5999999999999996 3.6000000000000001,-7.7999999999999998 3.7999999999999998,-7.75 3.7916666666666665,-7.5471698113207548 3.6226415094339623,-7.3200000000000003 3.7200000000000002,-3.473684210526315 3.0789473684210527,-3.2549019607843133 3.2156862745098036,-2.9999999999999982 3.1428571428571423,-3.1733333333333325 3.2666666666666666,-2.9180327868852456 3.4262295081967209,-2.8723404255319145 3.1063829787234041,-2.1111111111111112 2.8888888888888888,-2.1428571428571428 2.8571428571428572,-1.8433734939759043 2.8072289156626509,-1.8396226415094346 2.8113207547169816,-1.6486486486486487 2.756756756756757,-1.76510067114094 2.8926174496644301,-0.53846153846153855 4.2307692307692308,1.8148148148148147 5.4074074074074074,1.588235294117647 2.2352941176470589,1.819672131147541 2.1967213114754101,2 4,2 2.1666666666666665,2.3538461538461544 2.1076923076923078,2 1.6875000000000004,2 -2,1.2173913043478262 -3.8260869565217392,1.7375886524822697 1.3758865248226959,1.5073170731707317 1.1024390243902444,1.1428571428571428 -4,-0.59322033898305082 -8.0508474576271194),(1.666666666666667 1.5999999999999988,1.5675675675675675 1.8378378378378377,1.4374999999999991 1.8750000000000002,1.0487804878048776 2.3414634146341466,0.46666666666666712 2.6060606060606055,0.086956521739131043 2.2608695652173911,1.4374999999999991 1.8750000000000002,1.666666666666667 1.5999999999999988))", diff --git a/test/algorithms/relate/relate_linear_linear_sph.cpp b/test/algorithms/relate/relate_linear_linear_sph.cpp index ec472c68e..b0c9ac226 100644 --- a/test/algorithms/relate/relate_linear_linear_sph.cpp +++ b/test/algorithms/relate/relate_linear_linear_sph.cpp @@ -1,8 +1,7 @@ // Boost.Geometry // Unit Test -// Copyright (c) 2016, Oracle and/or its affiliates. - +// Copyright (c) 2016-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -16,7 +15,8 @@ template void test_linestring_linestring() { - typedef bg::model::linestring

ls; + using coord_t = typename bg::coordinate_type

::type; + using ls = bg::model::linestring

; test_geometry("LINESTRING(0 0, 2 2, 3 2)", "LINESTRING(0 0, 2 2, 3 2)", "1FFF0FFF2"); test_geometry("LINESTRING(0 0,3 2)", "LINESTRING(0 0, 2 2, 3 2)", "FF1F0F1F2"); @@ -182,8 +182,7 @@ void test_linestring_linestring() // Point/Point //test_geometry("LINESTRING(0 0)", "LINESTRING(0 0)", "0FFFFFFF2"); - if ( BOOST_GEOMETRY_CONDITION( - boost::is_floating_point::type>::value ) ) + if ( BOOST_GEOMETRY_CONDITION(std::is_floating_point::value) ) { // https://svn.boost.org/trac/boost/ticket/10904 // very small segments @@ -195,8 +194,7 @@ void test_linestring_linestring() "*********"); // TODO: be more specific with the result } - if ( BOOST_GEOMETRY_CONDITION(( - boost::is_same::type, double>::value )) ) + if ( BOOST_GEOMETRY_CONDITION((std::is_same::value)) ) { // detected as collinear test_geometry("LINESTRING(1 -10, 3.069359e+307 3.069359e+307)", @@ -244,8 +242,9 @@ void test_linestring_linestring() template void test_linestring_multi_linestring() { - typedef bg::model::linestring

ls; - typedef bg::model::multi_linestring mls; + using coord_t = typename bg::coordinate_type

::type; + using ls = bg::model::linestring

; + using mls = bg::model::multi_linestring; // LS disjoint test_geometry("LINESTRING(0 0,10 0)", "MULTILINESTRING((1 0,2 0),(1 1,2 1))", "101FF0102"); @@ -344,7 +343,7 @@ void test_linestring_multi_linestring() "10FF0F102"); // | // | - if ( BOOST_GEOMETRY_CONDITION(boost::is_floating_point::type>::value) ) + if ( BOOST_GEOMETRY_CONDITION(std::is_floating_point::value) ) { // related to https://svn.boost.org/trac/boost/ticket/10904 test_geometry("LINESTRING(-2305843009213693956 4611686018427387906, -33 -92, 78 83)", @@ -389,8 +388,9 @@ void test_linestring_multi_linestring() template void test_multi_linestring_multi_linestring() { - typedef bg::model::linestring

ls; - typedef bg::model::multi_linestring mls; + using coord_t = typename bg::coordinate_type

::type; + using ls = bg::model::linestring

; + using mls = bg::model::multi_linestring; test_geometry("MULTILINESTRING((0 0,0 0,18 0,18 0,19 0,19 0,19 0,30 0,30 0))", "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0))", @@ -418,8 +418,7 @@ void test_multi_linestring_multi_linestring() "MULTILINESTRING((5 5.0190018174896416,0 5),(5 5.0190018174896416,5 0),(10 10,10 5,5 5.0190018174896416,5 10,10 10))", "10FFFFFF2"); - if ( BOOST_GEOMETRY_CONDITION(( - boost::is_same::type, double>::value )) ) + if ( BOOST_GEOMETRY_CONDITION((std::is_same::value)) ) { // assertion failure in 1.57 test_geometry("MULTILINESTRING((-0.59322033898305082 -8.0508474576271194,-2.882352941176471 -7.7647058823529411,-2.8823529411764706 -7.7647058823529411,-3.7361111111111112 -6.5694444444444446,-3.4404145077720205 -5.766839378238342,-4.1864406779661012 -3.6779661016949152,-7.5252525252525251 -5.5858585858585865,-7.5862068965517242 -5.1896551724137936,-4.47887323943662 -2.859154929577465,-4.5789473684210531 -2.5789473684210527,-3 -1,-2.9310344827586206 -0.86206896551724144,-3.1764705882352944 -0.70588235294117663,-4.7401960784313726 -2.1274509803921577,-5.3255813953488369 -0.48837209302325502,-4.7872340425531918 0.31914893617021284,-5.8571428571428577 1.0000000000000007,-5.3255813953488369 -0.48837209302325502,-5.9473684210526319 -1.4210526315789465,-8 2,-7.7333333333333334 2.1939393939393939,-8.8294573643410867 2.891472868217055,-8.8556701030927822 3.061855670103093,-7.5999999999999996 3.6000000000000001,-7.7999999999999998 3.7999999999999998,-7.75 3.7916666666666665,-7.5471698113207548 3.6226415094339623,-7.3200000000000003 3.7200000000000002,-3.473684210526315 3.0789473684210527,-3.2549019607843133 3.2156862745098036,-2.9999999999999982 3.1428571428571423,-3.1733333333333325 3.2666666666666666,-2.9180327868852456 3.4262295081967209,-2.8723404255319145 3.1063829787234041,-2.1111111111111112 2.8888888888888888,-2.1428571428571428 2.8571428571428572,-1.8433734939759043 2.8072289156626509,-1.8396226415094346 2.8113207547169816,-1.6486486486486487 2.756756756756757,-1.76510067114094 2.8926174496644301,-0.53846153846153855 4.2307692307692308,1.8148148148148147 5.4074074074074074,1.588235294117647 2.2352941176470589,1.819672131147541 2.1967213114754101,2 4,2 2.1666666666666665,2.3538461538461544 2.1076923076923078,2 1.6875000000000004,2 -2,1.2173913043478262 -3.8260869565217392,1.7375886524822697 1.3758865248226959,1.5073170731707317 1.1024390243902444,1.1428571428571428 -4,-0.59322033898305082 -8.0508474576271194),(1.666666666666667 1.5999999999999988,1.5675675675675675 1.8378378378378377,1.4374999999999991 1.8750000000000002,1.0487804878048776 2.3414634146341466,0.46666666666666712 2.6060606060606055,0.086956521739131043 2.2608695652173911,1.4374999999999991 1.8750000000000002,1.666666666666667 1.5999999999999988))", diff --git a/test/algorithms/relate/test_relate.hpp b/test/algorithms/relate/test_relate.hpp index 859d29ade..bf8b550ee 100644 --- a/test/algorithms/relate/test_relate.hpp +++ b/test/algorithms/relate/test_relate.hpp @@ -2,8 +2,8 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2013, 2014, 2015, 2017. -// Modifications copyright (c) 2013-2017 Oracle and/or its affiliates. +// This file was modified by Oracle on 2013-2021. +// Modifications copyright (c) 2013-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -17,18 +17,11 @@ #include -#include #include #include -#include #include -#include - #include - -#include -#include -#include +#include namespace bgdr = bg::detail::relate; @@ -190,7 +183,7 @@ void check_geometry(Geometry1 const& geometry1, // brake the expected output std::string expected_interrupt = expected1; bool changed = false; - BOOST_FOREACH(char & c, expected_interrupt) + for (char & c : expected_interrupt) { if ( c >= '0' && c <= '9' ) { diff --git a/test/algorithms/set_operations/difference/difference.cpp b/test/algorithms/set_operations/difference/difference.cpp index 0565f47aa..d6fda96d1 100644 --- a/test/algorithms/set_operations/difference/difference.cpp +++ b/test/algorithms/set_operations/difference/difference.cpp @@ -3,8 +3,8 @@ // Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2015, 2016. -// Modifications copyright (c) 2015-2016, Oracle and/or its affiliates. +// This file was modified by Oracle on 2015-2021. +// Modifications copyright (c) 2015-2021, 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 @@ -293,7 +293,7 @@ void test_all() 1, 61, 10.2717, 1, 61, 10.2717); - if ( BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) + if ( BOOST_GEOMETRY_CONDITION((std::is_same::value)) ) { test_one("buffer_mp2", buffer_mp2[0], buffer_mp2[1], diff --git a/test/algorithms/set_operations/difference/difference_areal_linear.cpp b/test/algorithms/set_operations/difference/difference_areal_linear.cpp index 80e535130..046b8c800 100644 --- a/test/algorithms/set_operations/difference/difference_areal_linear.cpp +++ b/test/algorithms/set_operations/difference/difference_areal_linear.cpp @@ -3,9 +3,8 @@ // Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2015, 2017. -// Modifications copyright (c) 2015-2017, Oracle and/or its affiliates. - +// This file was modified by Oracle on 2015-2021. +// Modifications copyright (c) 2015-2021, 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 @@ -116,7 +115,7 @@ void test_areal_linear() test_one_lp("case26", "LINESTRING(4 0,4 3,4 5,7 5)", poly_9, 2, 5, 5.0); test_one_lp("case27", "LINESTRING(4 4,4 5,5 5)", poly_9, 1, 3, 2.0); - if (BOOST_GEOMETRY_CONDITION( (! boost::is_same::value)) ) + if (BOOST_GEOMETRY_CONDITION( (! std::is_same::value)) ) { // Fails for float test_one_lp("case28", diff --git a/test/algorithms/set_operations/difference/difference_tupled.cpp b/test/algorithms/set_operations/difference/difference_tupled.cpp index 30ecd2d50..631bb2d89 100644 --- a/test/algorithms/set_operations/difference/difference_tupled.cpp +++ b/test/algorithms/set_operations/difference/difference_tupled.cpp @@ -1,29 +1,25 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2020, Oracle and/or its affiliates. +// Copyright (c) 2020-2021, Oracle and/or its affiliates. // 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 + #include +#include + +#include + #include #include #include #include #include -#include -#include -#include - -#include - -// TEMP -#include -#include -#include +#include typedef bg::model::point Pt; @@ -34,12 +30,6 @@ typedef bg::model::multi_point MPt; typedef bg::model::multi_linestring MLs; typedef bg::model::multi_polygon MPo; -#ifdef BOOST_GEOMETRY_CXX11_TUPLE - -#include - -#endif - template inline void check(std::string const& wkt1, std::string const& wkt2, @@ -83,8 +73,6 @@ inline void check(std::string const& wkt1, check(wkt1, wkt2, pair.second, out_str); } -#ifdef BOOST_GEOMETRY_CXX11_TUPLE - template inline void check(std::string const& wkt1, std::string const& wkt2, @@ -94,22 +82,13 @@ inline void check(std::string const& wkt1, check(wkt1, wkt2, std::get(tup), out_str); } -#endif - template -struct out_id - : boost::mpl::if_c - < - boost::is_base_of::type>::value, - boost::mpl::int_<0>, - typename boost::mpl::if_c - < - boost::is_base_of::type>::value, - boost::mpl::int_<1>, - boost::mpl::int_<2> - >::type - >::type -{}; +using out_id = std::integral_constant + < + int, + (bg::util::is_pointlike::value ? 0 : + (bg::util::is_linear::value ? 1 : 2)) + >; template inline void test_one(std::string const& in1_str, @@ -403,10 +382,7 @@ int test_main(int, char* []) { test_pair >(); test_tuple >(); - -#ifdef BOOST_GEOMETRY_CXX11_TUPLE test_tuple >(); -#endif return 0; } diff --git a/test/algorithms/set_operations/difference/test_difference.hpp b/test/algorithms/set_operations/difference/test_difference.hpp index 3c9ce08a5..c700d2957 100644 --- a/test/algorithms/set_operations/difference/test_difference.hpp +++ b/test/algorithms/set_operations/difference/test_difference.hpp @@ -25,7 +25,6 @@ #include "../setop_output_type.hpp" #include -#include #include #include diff --git a/test/algorithms/set_operations/intersection/intersection.cpp b/test/algorithms/set_operations/intersection/intersection.cpp index d2b93b7e2..7f3b4938e 100644 --- a/test/algorithms/set_operations/intersection/intersection.cpp +++ b/test/algorithms/set_operations/intersection/intersection.cpp @@ -5,8 +5,8 @@ // Copyright (c) 2008-2015 Bruno Lalande, Paris, France. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2015, 2016, 2017. -// Modifications copyright (c) 2015-2017, Oracle and/or its affiliates. +// This file was modified by Oracle on 2015-2021. +// Modifications copyright (c) 2015-2021, 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 @@ -941,9 +941,7 @@ int test_main(int, char* []) test_ticket_10868("MULTIPOLYGON(((33520458 6878575,33480192 14931538,31446819 18947953,30772384 19615678,30101303 19612322,30114725 16928001,33520458 6878575)))"); } -#if defined(BOOST_HAS_LONG_LONG) - test_ticket_10868("MULTIPOLYGON(((33520458 6878575,33480192 14931538,31446819 18947953,30772384 19615678,30101303 19612322,30114725 16928001,33520458 6878575)))"); -#endif + test_ticket_10868("MULTIPOLYGON(((33520458 6878575,33480192 14931538,31446819 18947953,30772384 19615678,30101303 19612322,30114725 16928001,33520458 6878575)))"); #endif #endif diff --git a/test/algorithms/set_operations/intersection/test_intersection.hpp b/test/algorithms/set_operations/intersection/test_intersection.hpp index 12071d1b6..4583969ff 100644 --- a/test/algorithms/set_operations/intersection/test_intersection.hpp +++ b/test/algorithms/set_operations/intersection/test_intersection.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2016-2020. -// Modifications copyright (c) 2016-2020, Oracle and/or its affiliates. +// This file was modified by Oracle on 2016-2021. +// Modifications copyright (c) 2016-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -17,7 +17,6 @@ #include #include -#include #include #include @@ -31,10 +30,9 @@ #include -#include - #include +#include #if defined(TEST_WITH_SVG) # include @@ -73,9 +71,7 @@ void check_result(IntersectionOutput const& intersection_output, typename bg::default_area_result::type length_or_area = 0; int n = 0; std::size_t nholes = 0; - for (typename IntersectionOutput::const_iterator it = intersection_output.begin(); - it != intersection_output.end(); - ++it) + for (auto it = intersection_output.begin(); it != intersection_output.end(); ++it) { if (! expected_count.empty()) { diff --git a/test/algorithms/set_operations/intersection/test_intersection_linear_linear.hpp b/test/algorithms/set_operations/intersection/test_intersection_linear_linear.hpp index 0b47c4f75..99c18ba96 100644 --- a/test/algorithms/set_operations/intersection/test_intersection_linear_linear.hpp +++ b/test/algorithms/set_operations/intersection/test_intersection_linear_linear.hpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014-2020, Oracle and/or its affiliates. +// Copyright (c) 2014-2021, 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 @@ -14,7 +14,6 @@ #include #include -#include #include #include "../test_set_ops_linear_linear.hpp" @@ -212,19 +211,8 @@ public: Geometry2 rg2(geometry2); bg::reverse(rg2); - typedef typename bg::tag_cast - < - Geometry1, bg::linear_tag - >::type tag1_type; - - typedef typename bg::tag_cast - < - Geometry2, bg::linear_tag - >::type tag2_type; - - bool const are_linear - = boost::is_same::value - && boost::is_same::value; + static const bool are_linear = bg::util::is_linear::value + && bg::util::is_linear::value; test_get_turns_ll_invariance::apply(geometry1, geometry2); #ifdef BOOST_GEOMETRY_TEST_DEBUG 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 d9bf57c2c..1692fca4d 100644 --- a/test/algorithms/set_operations/test_set_ops_linear_linear.hpp +++ b/test/algorithms/set_operations/test_set_ops_linear_linear.hpp @@ -1,7 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014-2020, Oracle and/or its affiliates. - +// Copyright (c) 2014-2021, 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 @@ -23,7 +22,6 @@ #include #include #include -#include #include #include @@ -35,14 +33,9 @@ namespace bg = ::boost::geometry; -template struct ls_less { - typedef typename boost::range_iterator::type Iterator1; - typedef typename boost::range_iterator::type Iterator2; - - typedef bg::less::type> point_less; - + template bool operator()(Linestring1 const& linestring1, Linestring2 const& linestring2) const { @@ -51,9 +44,10 @@ struct ls_less return boost::size(linestring1) < boost::size(linestring2); } - Iterator1 it1 = boost::begin(linestring1); - Iterator2 it2 = boost::begin(linestring2); - point_less less; + bg::less::type> less; + + auto it1 = boost::begin(linestring1); + auto it2 = boost::begin(linestring2); for (; it1 != boost::end(linestring1); ++it1, ++it2) { if (less(*it1, *it2)) @@ -70,21 +64,19 @@ struct ls_less }; -template struct ls_equal { + template bool operator()(Linestring1 const& linestring1, Linestring2 const& linestring2) const { - ls_less less; - + ls_less less; return ! less(linestring1, linestring2) && ! less(linestring2, linestring1); } }; -template class pt_equal { private: @@ -106,6 +98,7 @@ private: public: pt_equal(double tolerence) : m_tolerence(tolerence) {} + template bool operator()(Point1 const& point1, Point2 const& point2) const { // allow for some tolerence in testing equality of points @@ -121,11 +114,6 @@ struct multilinestring_equals template struct unique { - typedef typename boost::range_value::type Linestring; - typedef typename bg::point_type::type point_type; - typedef ls_equal linestring_equal; - typedef pt_equal point_equal; - template void apply_to_range(Range& range, EqualTo const& equal_to) { @@ -139,9 +127,9 @@ struct multilinestring_equals for (typename boost::range_iterator::type it = boost::begin(mls); it != boost::end(mls); ++it) { - apply_to_range(*it, point_equal(tolerance)); + apply_to_range(*it, pt_equal(tolerance)); } - apply_to_range(mls, linestring_equal()); + apply_to_range(mls, ls_equal()); } }; @@ -159,50 +147,11 @@ struct multilinestring_equals MultiLinestring2 const& multilinestring2, double tolerance) { - typedef typename boost::range_iterator - < - MultiLinestring1 const - >::type ls1_iterator; - - typedef typename boost::range_iterator - < - MultiLinestring2 const - >::type ls2_iterator; - - typedef typename boost::range_value::type Linestring1; - - typedef typename boost::range_value::type Linestring2; - - typedef typename boost::range_iterator - < - Linestring1 const - >::type point1_iterator; - - typedef typename boost::range_iterator - < - Linestring2 const - >::type point2_iterator; - - typedef ls_less linestring_less; - - typedef pt_equal - < - typename boost::range_value - < - typename boost::range_value::type - >::type, - typename boost::range_value - < - typename boost::range_value::type - >::type - > point_equal; - - MultiLinestring1 mls1 = multilinestring1; MultiLinestring2 mls2 = multilinestring2; - std::sort(boost::begin(mls1), boost::end(mls1), linestring_less()); - std::sort(boost::begin(mls2), boost::end(mls2), linestring_less()); + std::sort(boost::begin(mls1), boost::end(mls1), ls_less()); + std::sort(boost::begin(mls2), boost::end(mls2), ls_less()); unique()(mls1, tolerance); unique()(mls2, tolerance); @@ -212,19 +161,19 @@ struct multilinestring_equals return false; } - ls1_iterator it1 = boost::begin(mls1); - ls2_iterator it2 = boost::begin(mls2); + auto it1 = boost::begin(mls1); + auto it2 = boost::begin(mls2); for (; it1 != boost::end(mls1); ++it1, ++it2) { if (boost::size(*it1) != boost::size(*it2)) { return false; } - point1_iterator pit1 = boost::begin(*it1); - point2_iterator pit2 = boost::begin(*it2); + auto pit1 = boost::begin(*it1); + auto pit2 = boost::begin(*it2); for (; pit1 != boost::end(*it1); ++pit1, ++pit2) { - if (! point_equal(tolerance)(*pit1, *pit2)) + if (! pt_equal(tolerance)(*pit1, *pit2)) { return false; } @@ -257,9 +206,7 @@ private: convert_isolated_points_to_segments(MultiLinestring const& multilinestring, OutputIterator oit) { - BOOST_AUTO_TPL(it, boost::begin(multilinestring)); - - for (; it != boost::end(multilinestring); ++it) + for (auto it = boost::begin(multilinestring) ; it != boost::end(multilinestring); ++it) { if (boost::size(*it) == 1) { diff --git a/test/algorithms/set_operations/test_set_ops_pointlike.hpp b/test/algorithms/set_operations/test_set_ops_pointlike.hpp index 1cbe5de84..d9ac392ce 100644 --- a/test/algorithms/set_operations/test_set_ops_pointlike.hpp +++ b/test/algorithms/set_operations/test_set_ops_pointlike.hpp @@ -1,7 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014-2020, Oracle and/or its affiliates. - +// Copyright (c) 2014-2021, 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 @@ -12,30 +11,27 @@ #define BOOST_GEOMETRY_TEST_SET_OPS_POINTLIKE_HPP -#include - -namespace bg = ::boost::geometry; - #include #include #include #include + #include #include #include #include -#include - -#include -#include - -#include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include +#include + +namespace bg = ::boost::geometry; //================================================================== @@ -69,8 +65,7 @@ void set_operation_output(std::string const& set_op_id, mapper.map(g2, "stroke-opacity:1;stroke:rgb(153,204,0);stroke-width:4"); mapper.map(g1, "stroke-opacity:1;stroke:rgb(51,51,153);stroke-width:2"); - BOOST_AUTO_TPL(it, output.begin()); - for (; it != output.end(); ++it) + for (auto it = output.begin(); it != output.end(); ++it) { mapper.map(*it, "fill:rgb(255,0,255);stroke:rgb(0,0,0);stroke-width:1", @@ -106,8 +101,8 @@ struct equals return false; } - BOOST_AUTO_TPL(it1, boost::begin(mp1)); - BOOST_AUTO_TPL(it2, boost::begin(mp2)); + auto it1 = boost::begin(mp1); + auto it2 = boost::begin(mp2); for (; it1 != boost::end(mp1); ++it1, ++it2) { if ( !bg::equals(*it1, *it2) ) diff --git a/test/algorithms/set_operations/union/test_union.hpp b/test/algorithms/set_operations/union/test_union.hpp index e17012265..55c468134 100644 --- a/test/algorithms/set_operations/union/test_union.hpp +++ b/test/algorithms/set_operations/union/test_union.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2015-2020. -// Modifications copyright (c) 2015-2020 Oracle and/or its affiliates. +// This file was modified by Oracle on 2015-2021. +// Modifications copyright (c) 2015-2021 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 @@ -24,7 +24,6 @@ #include "../setop_output_type.hpp" #include -#include #include #include #include @@ -41,15 +40,15 @@ #include -#include - #include - #if defined(TEST_WITH_SVG) # include #endif +#include + + struct ut_settings : public ut_base_settings { ut_settings() @@ -80,8 +79,7 @@ template inline std::size_t num_points(Range const& rng, bool add_for_open = false) { std::size_t result = 0; - for (typename boost::range_iterator::type it = boost::begin(rng); - it != boost::end(rng); ++it) + for (auto it = boost::begin(rng); it != boost::end(rng); ++it) { result += bg::num_points(*it, add_for_open); } @@ -139,8 +137,7 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2, typename bg::default_area_result::type area = 0; std::size_t n = 0; std::size_t holes = 0; - for (typename result_type::iterator it = clip.begin(); - it != clip.end(); ++it) + for (auto it = clip.begin(); it != clip.end(); ++it) { area += bg::area(*it); holes += bg::num_interior_rings(*it); @@ -158,9 +155,7 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2, typename bg::default_area_result::type area_inserted = 0; int index = 0; - for (typename result_type::iterator it = inserted.begin(); - it != inserted.end(); - ++it, ++index) + for (auto it = inserted.begin(); it != inserted.end(); ++it, ++index) { // Skip the empty polygon created above to avoid the empty_input_exception if (! bg::is_empty(*it)) diff --git a/test/algorithms/set_operations/union/union.cpp b/test/algorithms/set_operations/union/union.cpp index 31b7c6204..7daec1990 100644 --- a/test/algorithms/set_operations/union/union.cpp +++ b/test/algorithms/set_operations/union/union.cpp @@ -5,8 +5,8 @@ // Copyright (c) 2008-2016 Bruno Lalande, Paris, France. // Copyright (c) 2009-2016 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2016,2017. -// Modifications copyright (c) 2016-2017, Oracle and/or its affiliates. +// This file was modified by Oracle on 2016-2021. +// Modifications copyright (c) 2016-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library @@ -45,7 +45,7 @@ void test_areal() typedef typename bg::coordinate_type::type ct; ut_settings ignore_validity_for_float; - if (BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) + if (BOOST_GEOMETRY_CONDITION((std::is_same::value)) ) { ignore_validity_for_float.set_test_validity(false); } diff --git a/test/algorithms/simplify_countries.cpp b/test/algorithms/simplify_countries.cpp index 87f674339..3b5dbb834 100644 --- a/test/algorithms/simplify_countries.cpp +++ b/test/algorithms/simplify_countries.cpp @@ -3,23 +3,32 @@ // Copyright (c) 2018 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include - -#include #include +#include + +#include +#include + +#include + +#include +#include + #if defined(TEST_WITH_SVG) # include #endif - template std::string read_from_file(std::string const& filename) { @@ -102,7 +111,7 @@ void test_one(std::string const& caseid, std::string const& wkt, mapper.map(geometry, "fill-opacity:0.5;fill:rgb(153,204,0);" "stroke:rgb(153,204,0);stroke-width:1"); - BOOST_FOREACH(polygon const& pol, simplified) + for (polygon const& pol : simplified) { mapper.map(pol, bg::area(pol) > 0 ? "fill:none;stroke:rgb(255,0,0);stroke-width:1" diff --git a/test/algorithms/transform.cpp b/test/algorithms/transform.cpp index bc938845d..9f88e0e89 100644 --- a/test/algorithms/transform.cpp +++ b/test/algorithms/transform.cpp @@ -5,6 +5,10 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -15,7 +19,6 @@ #include #include -#include #include #include @@ -71,10 +74,10 @@ void test_transform_linestring(Value value) boost::variant v(line1); line2_type expected; - for (BOOST_AUTO(p, line1.begin()); p != line1.end(); ++p) + for (auto it = line1.begin(); it != line1.end(); ++it) { P2 new_point; - bg::assign(new_point, *p); + bg::assign(new_point, *it); bg::multiply_value(new_point, value); expected.push_back(new_point); } diff --git a/test/algorithms/within/within_pointlike_geometry.cpp b/test/algorithms/within/within_pointlike_geometry.cpp index d04b0762d..84028ee90 100644 --- a/test/algorithms/within/within_pointlike_geometry.cpp +++ b/test/algorithms/within/within_pointlike_geometry.cpp @@ -3,8 +3,8 @@ // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014, 2015, 2016, 2017. -// Modifications copyright (c) 2014-2017 Oracle and/or its affiliates. +// This file was modified by Oracle on 2014-2021. +// Modifications copyright (c) 2014-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -154,19 +154,19 @@ void test_spherical_geographic() { bg::model::polygon wrangel; - typename boost::mpl::if_ + std::conditional_t < - boost::is_same::type, bg::geographic_tag>, + std::is_same::type, bg::geographic_tag>::value, bg::strategy::within::geographic_winding, bg::strategy::within::spherical_winding - >::type ws; + > ws; - typename boost::mpl::if_ + std::conditional_t < - boost::is_same::type, bg::geographic_tag>, + std::is_same::type, bg::geographic_tag>::value, bg::strategy::side::geographic<>, bg::strategy::side::spherical_side_formula<> - >::type ss; + > ss; boost::ignore_unused(ws, ss); @@ -390,8 +390,8 @@ void test_large_integers() void test_tickets() { - typedef boost::geometry::model::d2::point_xy pt; - typedef boost::geometry::model::ring ring; + typedef bg::model::d2::point_xy pt; + typedef bg::model::ring ring; // https://svn.boost.org/trac/boost/ticket/9628 { @@ -408,9 +408,9 @@ void test_tickets() pt p( -12260.669324773118, 54820.312032458634 ); - //boost::geometry::correct(r); + //bg::correct(r); - bool within = boost::geometry::within(p, r); + bool within = bg::within(p, r); BOOST_CHECK_EQUAL(within, false); } // similar @@ -423,7 +423,7 @@ void test_tickets() pt p( -13826.0, 54820.312032458634 ); - bool within = boost::geometry::within(p, r); + bool within = bg::within(p, r); BOOST_CHECK_EQUAL(within, false); } @@ -433,9 +433,9 @@ void test_tickets() ring r; bg::read_wkt("POINT(0.1377 5.00)", p); bg::read_wkt("POLYGON((0.1277 4.97, 0.1277 5.00, 0.1278 4.9999999999999982, 0.1278 4.97, 0.1277 4.97))", r); - bool within = boost::geometry::within(p, r); + bool within = bg::within(p, r); BOOST_CHECK_EQUAL(within, false); - bool covered_by = boost::geometry::covered_by(p, r); + bool covered_by = bg::covered_by(p, r); BOOST_CHECK_EQUAL(covered_by, false); } } diff --git a/test/core/point_type.cpp b/test/core/point_type.cpp index be98d2edb..6829450f2 100644 --- a/test/core/point_type.cpp +++ b/test/core/point_type.cpp @@ -5,7 +5,6 @@ // This file was modified by Oracle on 2014-2021. // Modifications copyright (c) 2014-2021 Oracle and/or its affiliates. - // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -15,8 +14,6 @@ #include -#include - #include #include @@ -45,7 +42,7 @@ void test_geometry() BOOST_CHECK_EQUAL(typeid(typename bg::point_type::type).name(), typeid(Expected).name()); - static const bool is_same = boost::is_same::type, Expected>::value; + static const bool is_same = std::is_same::type, Expected>::value; BOOST_CHECK(is_same); } diff --git a/test/core/tag.cpp b/test/core/tag.cpp index f67c58d4b..36bf3403b 100644 --- a/test/core/tag.cpp +++ b/test/core/tag.cpp @@ -3,9 +3,8 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014 Oracle and/or its affiliates. - +// This file was modified by Oracle on 2014-2021. +// Modifications copyright (c) 2014-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -15,8 +14,6 @@ #include -#include - #include #include @@ -42,7 +39,7 @@ void test_geometry() BOOST_CHECK_EQUAL(typeid(typename bg::tag::type).name(), typeid(Expected).name()); - static const bool is_same = boost::is_same::type, Expected>::value; + static const bool is_same = std::is_same::type, Expected>::value; BOOST_CHECK(is_same); } diff --git a/test/geometry_test_common.hpp b/test/geometry_test_common.hpp index 96866bde3..0c34e463a 100644 --- a/test/geometry_test_common.hpp +++ b/test/geometry_test_common.hpp @@ -4,6 +4,10 @@ // Copyright (c) 2008-2015 Bruno Lalande, Paris, France. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021 Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -50,7 +54,6 @@ #include #include #include -#include #include @@ -171,14 +174,14 @@ using default_test_type = double; template inline T if_typed(T value_typed, T value) { - return boost::is_same::value ? value_typed : value; + return std::is_same::value ? value_typed : value; } //! Compile time function for expectations depending on high precision template inline T1 const& bg_if_mp(T1 const& value_mp, T2 const& value) { - return boost::is_same::type::value ? value_mp : value; + return std::is_same::type::value ? value_mp : value; } //! Macro for expectations depending on rescaling diff --git a/test/iterators/flatten_iterator.cpp b/test/iterators/flatten_iterator.cpp index 9f989594e..69acae554 100644 --- a/test/iterators/flatten_iterator.cpp +++ b/test/iterators/flatten_iterator.cpp @@ -1,9 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2014, Oracle and/or its affiliates. - +// Copyright (c) 2014-2021, 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 @@ -14,26 +14,24 @@ #include +#include #include #include +#include +#include #include #include -#include -#include - +#include #include -#include -#include -#include -#include #include #include -#include +#include + +#include #include "test_iterator_common.hpp" -#include using namespace boost::assign; @@ -41,12 +39,12 @@ using namespace boost::assign; template struct access_begin { - typedef typename boost::mpl::if_ - < - typename boost::is_const::type, - typename InnerContainer::const_iterator, - typename InnerContainer::iterator - >::type return_type; + using return_type = std::conditional_t + < + std::is_const::value, + typename InnerContainer::const_iterator, + typename InnerContainer::iterator + >; static inline return_type apply(InnerContainer& inner) { @@ -58,12 +56,12 @@ struct access_begin template struct access_end { - typedef typename boost::mpl::if_ - < - typename boost::is_const::type, - typename InnerContainer::const_iterator, - typename InnerContainer::iterator - >::type return_type; + using return_type = std::conditional_t + < + std::is_const::value, + typename InnerContainer::const_iterator, + typename InnerContainer::iterator + >; static inline return_type apply(InnerContainer& inner) { diff --git a/test/iterators/point_iterator.cpp b/test/iterators/point_iterator.cpp index 346021420..80af60a94 100644 --- a/test/iterators/point_iterator.cpp +++ b/test/iterators/point_iterator.cpp @@ -3,8 +3,7 @@ // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. -// Copyright (c) 2014-2017, Oracle and/or its affiliates. - +// Copyright (c) 2014-2021, 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 @@ -28,9 +27,11 @@ #include #include #include -#include #include -#include + +#include +#include +#include #include @@ -39,31 +40,23 @@ #include #include -#include -#include -#include - -#include - -#include - #include #include #include #include +#include + #include +#include + #include #include -// At the end because of conflicts with Boost.QVM -#include - namespace bg = ::boost::geometry; -namespace ba = ::boost::assign; typedef bg::model::point point_type; typedef bg::model::point point_type_3d; @@ -100,7 +93,7 @@ template inline Geometry from_wkt(std::string const& wkt) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); return geometry; } @@ -147,7 +140,7 @@ template < typename Geometry, bool Enable = true, - bool IsConst = boost::is_const::value + bool IsConst = std::is_const::value > struct test_iterator_concepts { @@ -456,7 +449,7 @@ struct test_point_iterator_of_geometry // testing dereferencing/assignment - bool const is_reference = boost::is_reference + bool const is_reference = std::is_reference < typename std::iterator_traits::reference >::value; @@ -535,7 +528,7 @@ BOOST_AUTO_TEST_CASE( test_linestring_point_iterator ) ); tester::apply(from_wkt("LINESTRING(3 3,4 4,5 5)"), - ba::tuple_list_of(3,3)(4,4)(5,5) + TMP{{3,3},{4,4},{5,5}} ); #ifdef BOOST_GEOMETRY_TEST_DEBUG @@ -568,15 +561,15 @@ BOOST_AUTO_TEST_CASE( test_polygon_point_iterator ) ); tester::apply(from_wkt

("POLYGON((1 1,9 1,9 9,1 9),(5 5,6 5,6 6,5 6))"), - ba::tuple_list_of(1,1)(9,1)(9,9)(1,9)(5,5)(6,5)(6,6)(5,6) + TMP{{1,1},{9,1},{9,9},{1,9},{5,5},{6,5},{6,6},{5,6}} ); tester::apply(from_wkt

("POLYGON((3 3,4 4,5 5),(),(),(),(6 6,7 7,8 8),(),(),(9 9),())"), - ba::tuple_list_of(3,3)(4,4)(5,5)(6,6)(7,7)(8,8)(9,9) + TMP{{3,3},{4,4},{5,5},{6,6},{7,7},{8,8},{9,9}} ); tester::apply(from_wkt

("POLYGON((),(3 3,4 4,5 5),(),(),(6 6,7 7,8 8),(),(),(9 9),())"), - ba::tuple_list_of(3,3)(4,4)(5,5)(6,6)(7,7)(8,8)(9,9) + TMP{{3,3},{4,4},{5,5},{6,6},{7,7},{8,8},{9,9}} ); #ifdef BOOST_GEOMETRY_TEST_DEBUG @@ -605,7 +598,7 @@ BOOST_AUTO_TEST_CASE( test_multipoint_point_iterator ) ); tester::apply(from_wkt("MULTIPOINT(3 3,4 4,5 5)"), - ba::tuple_list_of(3,3)(4,4)(5,5) + TMP{{3,3},{4,4},{5,5}} ); #ifdef BOOST_GEOMETRY_TEST_DEBUG @@ -634,7 +627,7 @@ BOOST_AUTO_TEST_CASE( test_multipoint_3d_point_iterator ) ); tester::apply(from_wkt("MULTIPOINT(3 3 3,4 4 4,5 5 5)"), - ba::tuple_list_of(3,3,3)(4,4,4)(5,5,5) + TMP{{3,3,3},{4,4,4},{5,5,5}} ); #ifdef BOOST_GEOMETRY_TEST_DEBUG @@ -671,11 +664,11 @@ BOOST_AUTO_TEST_CASE( test_multilinestring_point_iterator ) ); tester::apply(from_wkt("MULTILINESTRING((1 1,2 2,3 3),(3 3,4 4,5 5),(6 6))"), - ba::tuple_list_of(1,1)(2,2)(3,3)(3,3)(4,4)(5,5)(6,6) + TMP{{1,1},{2,2},{3,3},{3,3},{4,4},{5,5},{6,6}} ); tester::apply(from_wkt("MULTILINESTRING((),(),(1 1,2 2,3 3),(),(),(3 3,4 4,5 5),(),(6 6),(),(),())"), - ba::tuple_list_of(1,1)(2,2)(3,3)(3,3)(4,4)(5,5)(6,6) + TMP{{1,1},{2,2},{3,3},{3,3},{4,4},{5,5},{6,6}} ); #ifdef BOOST_GEOMETRY_TEST_DEBUG @@ -716,18 +709,18 @@ BOOST_AUTO_TEST_CASE( test_multipolygon_point_iterator ) ); tester::apply(from_wkt("MULTIPOLYGON(((3 3,4 4,5 5),(6 6,7 7,8 8),(9 9)),((1 1,2 2,10 10),(11 11,12 12)))"), - ba::tuple_list_of(3,3)(4,4)(5,5)(6,6)(7,7)(8,8)(9,9)\ - (1,1)(2,2)(10,10)(11,11)(12,12) + TMP{{3,3},{4,4},{5,5},{6,6},{7,7},{8,8},{9,9}, + {1,1},{2,2},{10,10},{11,11},{12,12}} ); tester::apply(from_wkt("MULTIPOLYGON(((3 3,4 4,5 5),(),(),(),(6 6,7 7,8 8),(),(),(9 9),()),((),(1 1,2 2,10 10),(),(),(),(11 11,12 12),(),(),(13 13),()))"), - ba::tuple_list_of(3,3)(4,4)(5,5)(6,6)(7,7)(8,8)(9,9)\ - (1,1)(2,2)(10,10)(11,11)(12,12)(13,13) + TMP{{3,3},{4,4},{5,5},{6,6},{7,7},{8,8},{9,9}, + {1,1},{2,2},{10,10},{11,11},{12,12},{13,13}} ); tester::apply(from_wkt("MULTIPOLYGON(((3 3,4 4,5 5),(),(),(),(6 6,7 7,8 8),(),(),(9 9),()),((),(1 1,2 2,10 10),(),(),(),(11 11,12 12),(),(),(13 13),()),((),(),()))"), - ba::tuple_list_of(3,3)(4,4)(5,5)(6,6)(7,7)(8,8)(9,9)\ - (1,1)(2,2)(10,10)(11,11)(12,12)(13,13) + TMP{{3,3},{4,4},{5,5},{6,6},{7,7},{8,8},{9,9}, + {1,1},{2,2},{10,10},{11,11},{12,12},{13,13}} ); #ifdef BOOST_GEOMETRY_TEST_DEBUG @@ -765,8 +758,8 @@ BOOST_AUTO_TEST_CASE( test_multipoint_of_point_pointers ) typedef test_point_iterator_of_geometry tester; tester::apply(multipoint, - ba::tuple_list_of(1,-1)(2,-2)(3,-3)(4,-4)(5,-5)(6,-6)\ - (7,-7)(8,-8)(9,-9), + TMP{{1,-1},{2,-2},{3,-3},{4,-4},{5,-5},{6,-6}, + {7,-7},{8,-8},{9,-9}}, zero ); @@ -807,8 +800,8 @@ BOOST_AUTO_TEST_CASE( test_linestring_of_point_pointers ) typedef test_point_iterator_of_geometry tester; tester::apply(linestring, - ba::tuple_list_of(1,-1)(2,-2)(3,-3)(4,-4)(5,-5)(6,-6)\ - (7,-7)(8,-8)(9,-9), + TMP{{1,-1},{2,-2},{3,-3},{4,-4},{5,-5},{6,-6}, + {7,-7},{8,-8},{9,-9}}, zero ); @@ -849,8 +842,8 @@ BOOST_AUTO_TEST_CASE( test_multipoint_copy_on_dereference ) tester::apply(multipoint, // from_wkt("MULTIPOINT(1 -1,2 -2,3 -3,4 -4,5 -5,6 -6, 7 -7,8 -8,9 -9)"), - ba::tuple_list_of(1,-1)(2,-2)(3,-3)(4,-4)(5,-5)(6,-6)\ - (7,-7)(8,-8)(9,-9) + TMP{{1,-1},{2,-2},{3,-3},{4,-4},{5,-5},{6,-6}, + {7,-7},{8,-8},{9,-9}} ); } @@ -875,7 +868,7 @@ BOOST_AUTO_TEST_CASE( test_linestring_copy_on_dereference ) > tester; tester::apply(from_wkt("LINESTRING(1 -1,2 -2,3 -3,4 -4,5 -5,6 -6, 7 -7,8 -8,9 -9)"), - ba::tuple_list_of(1,-1)(2,-2)(3,-3)(4,-4)(5,-5)(6,-6)\ - (7,-7)(8,-8)(9,-9) + TMP{{1,-1},{2,-2},{3,-3},{4,-4},{5,-5},{6,-6}, + {7,-7},{8,-8},{9,-9}} ); } diff --git a/test/iterators/segment_iterator.cpp b/test/iterators/segment_iterator.cpp index fdfe90ef5..53bd5ce63 100644 --- a/test/iterators/segment_iterator.cpp +++ b/test/iterators/segment_iterator.cpp @@ -3,9 +3,9 @@ // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. -// Copyright (c) 2014, Oracle and/or its affiliates. - +// Copyright (c) 2014-2021, 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 @@ -23,12 +23,17 @@ #include -#include #include #include #include #include +#include +#include +#include + +#include + #include #include #include @@ -37,25 +42,13 @@ #include #include -#include - -#include -#include -#include - -#include - #include -// TEMP -#include -#include -#include +#include #include #include -namespace ba = ::boost::assign; namespace bg = ::boost::geometry; namespace bgm = bg::model; @@ -87,7 +80,7 @@ template inline Geometry from_wkt(std::string const& wkt) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); return geometry; } @@ -325,22 +318,23 @@ BOOST_AUTO_TEST_CASE( test_linestring_segment_iterator ) typedef test_segment_iterator_of_geometry tester; tester::apply(from_wkt("LINESTRING(0 0,1 1,2 2,3 3,4 4)"), - ba::list_of - ( ba::tuple_list_of(0,0)(1,1) ) - ( ba::tuple_list_of(1,1)(2,2) ) - ( ba::tuple_list_of(2,2)(3,3) ) - ( ba::tuple_list_of(3,3)(4,4) ) - ); + TML{ + {{0,0},{1,1}}, + {{1,1},{2,2}}, + {{2,2},{3,3}}, + {{3,3},{4,4}} + }); // linestring with no points tester::apply(from_wkt("LINESTRING()"), - ba::list_of() + TML() ); // linestring with a single point tester::apply(from_wkt("LINESTRING(1 0)"), - ba::list_of - ( ba::tuple_list_of(1,0)(1,0) ), + TML{ + {{1,0},{1,0}} + }, false ); @@ -365,80 +359,82 @@ BOOST_AUTO_TEST_CASE( test_ring_segment_iterator ) typedef dual_tester tester; tester::apply(from_wkt("POLYGON((0 0,0 10,10 10,10 0))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,10) ) - ( ba::tuple_list_of(0,10)(10,10) ) - ( ba::tuple_list_of(10,10)(10,0) ) - ( ba::tuple_list_of(10,0)(0,0) ) - ); + TML{ + {{0,0},{0,10}}, + {{0,10},{10,10}}, + {{10,10},{10,0}}, + {{10,0},{0,0}} + }); // open ring with no points tester::apply(from_wkt("POLYGON(())"), - ba::list_of() + TML() ); // open ring with a single point (one segment) tester::apply(from_wkt("POLYGON((0 0))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,0) ), + TML{ + {{0,0},{0,0}} + }, false ); // open ring with a two points (two segments) tester::apply(from_wkt("POLYGON((0 0,0 10))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,10) ) - ( ba::tuple_list_of(0,10)(0,0) ) - ); + TML{ + {{0,0},{0,10}}, + {{0,10},{0,0}} + }); // open ring with a three points (three segments) tester::apply(from_wkt("POLYGON((0 0,0 10,10 10))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,10) ) - ( ba::tuple_list_of(0,10)(10,10) ) - ( ba::tuple_list_of(10,10)(0,0) ) - ); + TML{ + {{0,0},{0,10}}, + {{0,10},{10,10}}, + {{10,10},{0,0}} + }); tester::apply(from_wkt("POLYGON((0 0,0 10,10 10,10 0,0 0))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,10) ) - ( ba::tuple_list_of(0,10)(10,10) ) - ( ba::tuple_list_of(10,10)(10,0) ) - ( ba::tuple_list_of(10,0)(0,0) ) - ); + TML{ + {{0,0},{0,10}}, + {{0,10},{10,10}}, + {{10,10},{10,0}}, + {{10,0},{0,0}} + }); // closed ring with no points tester::apply(from_wkt("POLYGON(())"), - ba::list_of() + TML() ); // closed ring with a single point (one segment) tester::apply(from_wkt("POLYGON((0 0))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,0) ), + TML{ + {{0,0},{0,0}} + }, false ); // closed ring with two points (one segment) tester::apply(from_wkt("POLYGON((0 0,0 0))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,0) ) - ); + TML{ + {{0,0},{0,0}} + }); // closed ring with three points (two segments) tester::apply(from_wkt("POLYGON((0 0,0 10,0 0))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,10) ) - ( ba::tuple_list_of(0,10)(0,0) ) - ); + TML{ + {{0,0},{0,10}}, + {{0,10},{0,0}} + }); // closed ring with four points (three segments) tester::apply(from_wkt("POLYGON((0 0,0 10,10 10,0 0))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,10) ) - ( ba::tuple_list_of(0,10)(10,10) ) - ( ba::tuple_list_of(10,10)(0,0) ) - ); + TML{ + {{0,0},{0,10}}, + {{0,10},{10,10}}, + {{10,10},{0,0}} + }); #ifdef BOOST_GEOMETRY_TEST_DEBUG std::cout << std::endl << std::endl << std::endl; @@ -461,85 +457,89 @@ BOOST_AUTO_TEST_CASE( test_polygon_segment_iterator ) typedef dual_tester tester; tester::apply(from_wkt("POLYGON((0 0,0 10,10 10,10 0),(1 1,9 1,9 9,1 9))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,10) ) - ( ba::tuple_list_of(0,10)(10,10) ) - ( ba::tuple_list_of(10,10)(10,0) ) - ( ba::tuple_list_of(10,0)(0,0) ) - ( ba::tuple_list_of(1,1)(9,1) ) - ( ba::tuple_list_of(9,1)(9,9) ) - ( ba::tuple_list_of(9,9)(1,9) ) - ( ba::tuple_list_of(1,9)(1,1) ) - ); + TML{ + {{0,0},{0,10}}, + {{0,10},{10,10}}, + {{10,10},{10,0}}, + {{10,0},{0,0}}, + {{1,1},{9,1}}, + {{9,1},{9,9}}, + {{9,9},{1,9}}, + {{1,9},{1,1}} + }); // open polygon with no points tester::apply(from_wkt("POLYGON(())"), - ba::list_of() + TML() ); // open polygons with single-point rings tester::apply(from_wkt("POLYGON((0 0,0 10,10 10,10 0),(1 1))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,10) ) - ( ba::tuple_list_of(0,10)(10,10) ) - ( ba::tuple_list_of(10,10)(10,0) ) - ( ba::tuple_list_of(10,0)(0,0) ) - ( ba::tuple_list_of(1,1)(1,1) ), + TML{ + {{0,0},{0,10}}, + {{0,10},{10,10}}, + {{10,10},{10,0}}, + {{10,0},{0,0}}, + {{1,1},{1,1}} + }, false ); tester::apply(from_wkt("POLYGON((0 0),(1 1,9 1,9 9,1 9))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,0) ) - ( ba::tuple_list_of(1,1)(9,1) ) - ( ba::tuple_list_of(9,1)(9,9) ) - ( ba::tuple_list_of(9,9)(1,9) ) - ( ba::tuple_list_of(1,9)(1,1) ), + TML{ + {{0,0},{0,0}}, + {{1,1},{9,1}}, + {{9,1},{9,9}}, + {{9,9},{1,9}}, + {{1,9},{1,1}} + }, false ); tester::apply(from_wkt("POLYGON((0 0,0 10,10 10,10 0,0 0),(1 1,9 1,9 9,1 9,1 1))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,10) ) - ( ba::tuple_list_of(0,10)(10,10) ) - ( ba::tuple_list_of(10,10)(10,0) ) - ( ba::tuple_list_of(10,0)(0,0) ) - ( ba::tuple_list_of(1,1)(9,1) ) - ( ba::tuple_list_of(9,1)(9,9) ) - ( ba::tuple_list_of(9,9)(1,9) ) - ( ba::tuple_list_of(1,9)(1,1) ) - ); + TML{ + {{0,0},{0,10}}, + {{0,10},{10,10}}, + {{10,10},{10,0}}, + {{10,0},{0,0}}, + {{1,1},{9,1}}, + {{9,1},{9,9}}, + {{9,9},{1,9}}, + {{1,9},{1,1}} + }); // closed polygons with no points tester::apply(from_wkt("POLYGON(())"), - ba::list_of() + TML() ); tester::apply(from_wkt("POLYGON((),())"), - ba::list_of() + TML() ); tester::apply(from_wkt("POLYGON((),(),())"), - ba::list_of() + TML() ); // closed polygons with single-point rings tester::apply(from_wkt("POLYGON((0 0,0 10,10 10,10 0,0 0),(1 1))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,10) ) - ( ba::tuple_list_of(0,10)(10,10) ) - ( ba::tuple_list_of(10,10)(10,0) ) - ( ba::tuple_list_of(10,0)(0,0) ) - ( ba::tuple_list_of(1,1)(1,1) ), + TML{ + {{0,0},{0,10}}, + {{0,10},{10,10}}, + {{10,10},{10,0}}, + {{10,0},{0,0}}, + {{1,1},{1,1}}, + }, false ); tester::apply(from_wkt("POLYGON((0 0),(1 1,9 1,9 9,1 9,1 1))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,0) ) - ( ba::tuple_list_of(1,1)(9,1) ) - ( ba::tuple_list_of(9,1)(9,9) ) - ( ba::tuple_list_of(9,9)(1,9) ) - ( ba::tuple_list_of(1,9)(1,1) ), + TML{ + {{0,0},{0,0}}, + {{1,1},{9,1}}, + {{9,1},{9,9}}, + {{9,9},{1,9}}, + {{1,9},{1,1}} + }, false ); @@ -563,37 +563,38 @@ BOOST_AUTO_TEST_CASE( test_multi_linestring_segment_iterator ) typedef test_segment_iterator_of_geometry tester; tester::apply(from_wkt("MULTILINESTRING((0 0,1 1,2 2,3 3,4 4),(5 5,6 6,7 7,8 8),(9 9,10 10))"), - ba::list_of - ( ba::tuple_list_of(0,0)(1,1) ) - ( ba::tuple_list_of(1,1)(2,2) ) - ( ba::tuple_list_of(2,2)(3,3) ) - ( ba::tuple_list_of(3,3)(4,4) ) - ( ba::tuple_list_of(5,5)(6,6) ) - ( ba::tuple_list_of(6,6)(7,7) ) - ( ba::tuple_list_of(7,7)(8,8) ) - ( ba::tuple_list_of(9,9)(10,10) ) - ); + TML{ + {{0,0},{1,1}}, + {{1,1},{2,2}}, + {{2,2},{3,3}}, + {{3,3},{4,4}}, + {{5,5},{6,6}}, + {{6,6},{7,7}}, + {{7,7},{8,8}}, + {{9,9},{10,10}} + }); // empty multi-linestrings tester::apply(from_wkt("MULTILINESTRING()"), - ba::list_of() + TML() ); tester::apply(from_wkt("MULTILINESTRING(())"), - ba::list_of() + TML() ); tester::apply(from_wkt("MULTILINESTRING((),())"), - ba::list_of() + TML() ); // multi-linestring with a linestring with one point tester::apply(from_wkt("MULTILINESTRING((0 0,1 1,2 2,3 3,4 4),(5 5),(9 9,10 10))"), - ba::list_of - ( ba::tuple_list_of(0,0)(1,1) ) - ( ba::tuple_list_of(1,1)(2,2) ) - ( ba::tuple_list_of(2,2)(3,3) ) - ( ba::tuple_list_of(3,3)(4,4) ) - ( ba::tuple_list_of(5,5)(5,5) ) - ( ba::tuple_list_of(9,9)(10,10) ), + TML{ + {{0,0},{1,1}}, + {{1,1},{2,2}}, + {{2,2},{3,3}}, + {{3,3},{4,4}}, + {{5,5},{5,5}}, + {{9,9},{10,10}} + }, false ); @@ -618,63 +619,63 @@ BOOST_AUTO_TEST_CASE( test_multi_polygon_segment_iterator ) typedef dual_tester tester; tester::apply(from_wkt("MULTIPOLYGON(((0 0,0 10,10 10,10 0),(1 1,9 1,9 9,1 9)),((20 0,20 10,30 10,30 0),(21 1,29 1,29 9,21 9)))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,10) ) - ( ba::tuple_list_of(0,10)(10,10) ) - ( ba::tuple_list_of(10,10)(10,0) ) - ( ba::tuple_list_of(10,0)(0,0) ) - ( ba::tuple_list_of(1,1)(9,1) ) - ( ba::tuple_list_of(9,1)(9,9) ) - ( ba::tuple_list_of(9,9)(1,9) ) - ( ba::tuple_list_of(1,9)(1,1) ) - ( ba::tuple_list_of(20,0)(20,10) ) - ( ba::tuple_list_of(20,10)(30,10) ) - ( ba::tuple_list_of(30,10)(30,0) ) - ( ba::tuple_list_of(30,0)(20,0) ) - ( ba::tuple_list_of(21,1)(29,1) ) - ( ba::tuple_list_of(29,1)(29,9) ) - ( ba::tuple_list_of(29,9)(21,9) ) - ( ba::tuple_list_of(21,9)(21,1) ) - ); + TML{ + {{0,0},{0,10}}, + {{0,10},{10,10}}, + {{10,10},{10,0}}, + {{10,0},{0,0}}, + {{1,1},{9,1}}, + {{9,1},{9,9}}, + {{9,9},{1,9}}, + {{1,9},{1,1}}, + {{20,0},{20,10}}, + {{20,10},{30,10}}, + {{30,10},{30,0}}, + {{30,0},{20,0}}, + {{21,1},{29,1}}, + {{29,1},{29,9}}, + {{29,9},{21,9}}, + {{21,9},{21,1}} + }); tester::apply(from_wkt("MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(1 1,9 1,9 9,1 9,1 1)),((20 0,20 10,30 10,30 0,20 0),(21 1,29 1,29 9,21 9,21 1)))"), - ba::list_of - ( ba::tuple_list_of(0,0)(0,10) ) - ( ba::tuple_list_of(0,10)(10,10) ) - ( ba::tuple_list_of(10,10)(10,0) ) - ( ba::tuple_list_of(10,0)(0,0) ) - ( ba::tuple_list_of(1,1)(9,1) ) - ( ba::tuple_list_of(9,1)(9,9) ) - ( ba::tuple_list_of(9,9)(1,9) ) - ( ba::tuple_list_of(1,9)(1,1) ) - ( ba::tuple_list_of(20,0)(20,10) ) - ( ba::tuple_list_of(20,10)(30,10) ) - ( ba::tuple_list_of(30,10)(30,0) ) - ( ba::tuple_list_of(30,0)(20,0) ) - ( ba::tuple_list_of(21,1)(29,1) ) - ( ba::tuple_list_of(29,1)(29,9) ) - ( ba::tuple_list_of(29,9)(21,9) ) - ( ba::tuple_list_of(21,9)(21,1) ) - ); + TML{ + {{0,0},{0,10}}, + {{0,10},{10,10}}, + {{10,10},{10,0}}, + {{10,0},{0,0}}, + {{1,1},{9,1}}, + {{9,1},{9,9}}, + {{9,9},{1,9}}, + {{1,9},{1,1}}, + {{20,0},{20,10}}, + {{20,10},{30,10}}, + {{30,10},{30,0}}, + {{30,0},{20,0}}, + {{21,1},{29,1}}, + {{29,1},{29,9}}, + {{29,9},{21,9}}, + {{21,9},{21,1}} + }); // test empty closed multi-polygons tester::apply(from_wkt("MULTIPOLYGON()"), - ba::list_of() + TML() ); tester::apply(from_wkt("MULTIPOLYGON((()))"), - ba::list_of() + TML() ); tester::apply(from_wkt("MULTIPOLYGON(((),()))"), - ba::list_of() + TML() ); tester::apply(from_wkt("MULTIPOLYGON(((),(),()))"), - ba::list_of() + TML() ); tester::apply(from_wkt("MULTIPOLYGON(((),(),()),(()))"), - ba::list_of() + TML() ); tester::apply(from_wkt("MULTIPOLYGON(((),(),()),((),()))"), - ba::list_of() + TML() ); #ifdef BOOST_GEOMETRY_TEST_DEBUG @@ -711,16 +712,16 @@ BOOST_AUTO_TEST_CASE( test_linestring_of_point_pointers ) typedef test_segment_iterator_of_geometry tester; tester::apply(linestring, - ba::list_of - ( ba::tuple_list_of(1,-1)(2,-2) ) - ( ba::tuple_list_of(2,-2)(3,-3) ) - ( ba::tuple_list_of(3,-3)(4,-4) ) - ( ba::tuple_list_of(4,-4)(5,-5) ) - ( ba::tuple_list_of(5,-5)(6,-6) ) - ( ba::tuple_list_of(6,-6)(7,-7) ) - ( ba::tuple_list_of(7,-7)(8,-8) ) - ( ba::tuple_list_of(8,-8)(9,-9) ) - ); + TML{ + {{1,-1},{2,-2}}, + {{2,-2},{3,-3}}, + {{3,-3},{4,-4}}, + {{4,-4},{5,-5}}, + {{5,-5},{6,-6}}, + {{6,-6},{7,-7}}, + {{7,-7},{8,-8}}, + {{8,-8},{9,-9}} + }); for (unsigned int i = 0; i < linestring.size(); i++) { @@ -744,14 +745,14 @@ BOOST_AUTO_TEST_CASE( test_linestring_copy_on_dereference ) typedef test_segment_iterator_of_geometry tester; tester::apply(from_wkt("LINESTRING(1 -1,2 -2,3 -3,4 -4,5 -5,6 -6, 7 -7,8 -8,9 -9)"), - ba::list_of - ( ba::tuple_list_of(1,-1)(2,-2) ) - ( ba::tuple_list_of(2,-2)(3,-3) ) - ( ba::tuple_list_of(3,-3)(4,-4) ) - ( ba::tuple_list_of(4,-4)(5,-5) ) - ( ba::tuple_list_of(5,-5)(6,-6) ) - ( ba::tuple_list_of(6,-6)(7,-7) ) - ( ba::tuple_list_of(7,-7)(8,-8) ) - ( ba::tuple_list_of(8,-8)(9,-9) ) - ); + TML{ + {{1,-1},{2,-2}}, + {{2,-2},{3,-3}}, + {{3,-3},{4,-4}}, + {{4,-4},{5,-5}}, + {{5,-5},{6,-6}}, + {{6,-6},{7,-7}}, + {{7,-7},{8,-8}}, + {{8,-8},{9,-9}} + }); } diff --git a/test/policies/rescale_policy.cpp b/test/policies/rescale_policy.cpp index c91f31988..f86b95bd7 100644 --- a/test/policies/rescale_policy.cpp +++ b/test/policies/rescale_policy.cpp @@ -5,6 +5,10 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021 Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -15,21 +19,15 @@ #include #include -#include - #include #include #include #include -#include -#include -#include -#include -#include - #include - - +#include +#include +#include +#include #include @@ -94,14 +92,14 @@ static std::string simplex_large[2] = template void test_rescale(std::string const& expected_normal, std::string const& expected_large) { - typedef bg::model::polygon

polygon; + using polygon = bg::model::polygon

; - typedef typename boost::mpl::if_c + using rescale_policy_type = std::conditional_t < Rescale, - typename bg::rescale_policy_type

::type , + typename bg::rescale_policy_type

::type, bg::detail::no_rescale_policy - >::type rescale_policy_type; + >; test_one( simplex_normal[0], simplex_normal[1], @@ -125,7 +123,7 @@ int test_main(int, char* []) test_all("-5000000 -3000000", "-5000000 -3000000"); test_all("-5000000 -3000000", "-5000000 -3000000"); test_all("0 1", "0 1000"); - test_all("0 1", "0 1000"); + test_all("0 1", "0 1000"); // test_all(); // compiles but overflows return 0; diff --git a/test/robustness/overlay/areal_areal/general_intersection_precision.cpp b/test/robustness/overlay/areal_areal/general_intersection_precision.cpp index 6413f2d18..afd1bdbac 100644 --- a/test/robustness/overlay/areal_areal/general_intersection_precision.cpp +++ b/test/robustness/overlay/areal_areal/general_intersection_precision.cpp @@ -3,6 +3,10 @@ // Copyright (c) 2019 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -13,8 +17,6 @@ #include #include -#include - #include #include diff --git a/test/robustness/overlay/areal_areal/test_overlay_p_q.hpp b/test/robustness/overlay/areal_areal/test_overlay_p_q.hpp index 57813450f..2e1f421ce 100644 --- a/test/robustness/overlay/areal_areal/test_overlay_p_q.hpp +++ b/test/robustness/overlay/areal_areal/test_overlay_p_q.hpp @@ -1,7 +1,12 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Robustness Test -// + // Copyright (c) 2009-2020 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -14,8 +19,6 @@ #include #include -#include - #include // For mixing int/float @@ -274,12 +277,12 @@ static bool test_overlay_p_q(std::string const& caseid, if (settings.also_difference) { - for (BOOST_AUTO(it, out_d1.begin()); it != out_d1.end(); ++it) + for (auto it = out_d1.begin(); it != out_d1.end(); ++it) { mapper.map(*it, "opacity:0.8;fill:none;stroke:rgb(255,128,0);stroke-width:4;stroke-dasharray:1,7;stroke-linecap:round"); } - for (BOOST_AUTO(it, out_d2.begin()); it != out_d2.end(); ++it) + for (auto it = out_d2.begin(); it != out_d2.end(); ++it) { mapper.map(*it, "opacity:0.8;fill:none;stroke:rgb(255,0,255);stroke-width:4;stroke-dasharray:1,7;stroke-linecap:round"); diff --git a/test/robustness/overlay/areal_areal/ticket_9081.cpp b/test/robustness/overlay/areal_areal/ticket_9081.cpp index 91f336c6f..6de0d1ce6 100644 --- a/test/robustness/overlay/areal_areal/ticket_9081.cpp +++ b/test/robustness/overlay/areal_areal/ticket_9081.cpp @@ -2,6 +2,10 @@ // Copyright (c) 2013-2015 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -11,23 +15,30 @@ #define CHECK_SELF_INTERSECTIONS #define LIST_WKT - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - -#include -#include -#include -#include #include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +namespace bg = boost::geometry; typedef boost::geometry::model::d2::point_xy pt; typedef boost::geometry::model::polygon polygon; @@ -62,7 +73,7 @@ inline void debug_with_svg(int index, char method, Geometry const& a, Geometry c mapper.map(a, "fill-opacity:0.5;fill:rgb(153,204,0);stroke:rgb(153,204,0);stroke-width:2"); mapper.map(b, "fill-opacity:0.3;fill:rgb(51,51,153);stroke:rgb(51,51,153);stroke-width:2"); - BOOST_FOREACH(polygon const& g, output) + for(polygon const& g : output) { mapper.map(g, "opacity:0.8;fill:none;stroke:rgb(255,128,0);stroke-width:4;stroke-dasharray:1,7;stroke-linecap:round"); } @@ -87,6 +98,14 @@ int main() std::string wkt1, wkt2, operation; + + typename bg::strategies::relate::services::default_strategy + < + multi_polygon, multi_polygon + >::type strategy; + + using rescale_policy_type = typename bg::rescale_policy_type::type; + try { @@ -94,19 +113,23 @@ int main() boost::timer t; std::vector poly_list; - for(int i=0;i(mp, strategy); + + bg::detail::overlay::has_self_intersections(mp, strategy, robust_policy); std::ostringstream out; out << "original " << poly_list.size(); @@ -119,7 +142,7 @@ int main() } - for(int j=0;j(mp_i, strategy); + try { - boost::geometry::detail::overlay::has_self_intersections(mp_i); + boost::geometry::detail::overlay::has_self_intersections(mp_i, strategy, robust_policy_i); } catch(...) { @@ -162,7 +189,7 @@ int main() std::cout << boost::geometry::wkt(mp_i) << std::endl; try { - boost::geometry::detail::overlay::has_self_intersections(mp_i); + boost::geometry::detail::overlay::has_self_intersections(mp_i, strategy, robust_policy_i); } catch(...) { @@ -170,9 +197,12 @@ int main() break; } + rescale_policy_type robust_policy_d + = bg::get_rescale_policy(mp_d, strategy); + try { - boost::geometry::detail::overlay::has_self_intersections(mp_d); + boost::geometry::detail::overlay::has_self_intersections(mp_d, strategy, robust_policy_d); } catch(...) { @@ -182,9 +212,13 @@ int main() std::cout << boost::geometry::wkt(mp_d) << std::endl; break; } + + rescale_policy_type robust_policy_e + = bg::get_rescale_policy(mp_e, strategy); + try { - boost::geometry::detail::overlay::has_self_intersections(mp_e); + boost::geometry::detail::overlay::has_self_intersections(mp_e, strategy, robust_policy_e); } catch(...) { diff --git a/test/robustness/overlay/buffer/multi_point_growth.cpp b/test/robustness/overlay/buffer/multi_point_growth.cpp index 4aed939cf..5058346eb 100644 --- a/test/robustness/overlay/buffer/multi_point_growth.cpp +++ b/test/robustness/overlay/buffer/multi_point_growth.cpp @@ -3,16 +3,24 @@ // Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include - -#include -#include +#include #include +#include + +#include + +#include +#include +#include +#include namespace bg = boost::geometry; @@ -73,7 +81,7 @@ double test_growth(Geometry const& geometry, int n, int d, double distance) typename bg::default_area_result::type area = 0; - BOOST_FOREACH(GeometryOut const& polygon, buffered) + for (GeometryOut const& polygon : buffered) { area += bg::area(polygon); } @@ -82,7 +90,7 @@ double test_growth(Geometry const& geometry, int n, int d, double distance) // Map input geometry in green mapper.map(geometry, "opacity:0.5;fill:rgb(0,128,0);stroke:rgb(0,128,0);stroke-width:10"); - BOOST_FOREACH(GeometryOut const& polygon, buffered) + for (GeometryOut const& polygon : buffered) { mapper.map(polygon, "opacity:0.4;fill:rgb(255,255,128);stroke:rgb(0,0,0);stroke-width:3"); } diff --git a/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp b/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp index 3fe64a3bc..13dba836b 100644 --- a/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp +++ b/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp @@ -3,10 +3,10 @@ // Copyright (c) 2012-2020 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2015. -// Modifications copyright (c) 2015 Oracle and/or its affiliates. - +// This file was modified by Oracle on 2015-2021. +// Modifications copyright (c) 2015-2021 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 // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -39,8 +39,8 @@ #include #include -#include -#include +#include +#include struct buffer_settings : public common_settings diff --git a/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp b/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp index b3a5311b4..adb6a65ac 100644 --- a/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp +++ b/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp @@ -3,6 +3,10 @@ // Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -15,7 +19,6 @@ #include #include -#include #include #include #include @@ -23,15 +26,21 @@ #include #include -#include +#include +#include +#include +#include +#include + +#include + #include #include #include -#include -#include -#include +#include +#include namespace bg = boost::geometry; @@ -197,20 +206,18 @@ public : typedef typename bg::point_type::type pt; typedef bg::model::segment segment_type; - typedef bg::strategy::intersection::relate_cartesian_segments - < - bg::policies::relate::segments_intersection_points - < - segment_type, - segment_type, - bg::segment_intersection_points - > - > policy; + bg::strategy::intersection::cartesian_segments<> strategy; + bg::policies::relate::segments_intersection_points + < + bg::segment_intersection_points + > policy; segment_type seg1, seg2; bg::convert(m_segment, seg1); bg::convert(segment, seg2); - bg::segment_intersection_points is = policy::apply(seg1, seg2); + + // TODO: this function requires unique subranges now + bg::segment_intersection_points is = strategy.apply(seg1, seg2); if (is.count == 2) { @@ -297,7 +304,7 @@ bool verify(std::string const& caseid, MultiPolygon const& mp, Linestring const& bg::for_each_segment(difference, bc); // 3) check also the mid-points from the difference to remove false positives - BOOST_FOREACH(Linestring const& d, difference) + for (Linestring const& d : difference) { Linestring difference_midpoints; bg::midpoints(d, false, std::back_inserter(difference_midpoints)); diff --git a/test/srs/proj4.hpp b/test/srs/proj4.hpp index 10a7f4dd5..e59970136 100644 --- a/test/srs/proj4.hpp +++ b/test/srs/proj4.hpp @@ -1,6 +1,6 @@ // Boost.Geometry -// Copyright (c) 2017-2019, Oracle and/or its affiliates. +// Copyright (c) 2017-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -14,6 +14,7 @@ #include #include +#include #if defined(TEST_WITH_PROJ6) #define TEST_WITH_PROJ5 @@ -152,30 +153,14 @@ struct pj_transformation forward(in_xy[i], out_xy[i]); } - template - void forward(In const& in, Out & out, - typename boost::enable_if_c - < - boost::is_same - < - typename boost::geometry::tag::type, - boost::geometry::point_tag - >::value - >::type* dummy = 0) const + template = 0> + void forward(In const& in, Out & out) const { transform_point(in, out, m_from, m_to); } - template - void inverse(In const& in, Out & out, - typename boost::enable_if_c - < - boost::is_same - < - typename boost::geometry::tag::type, - boost::geometry::point_tag - >::value - >::type* dummy = 0) const + template = 0> + void inverse(In const& in, Out & out) const { transform_point(in, out, m_to, m_from); } @@ -256,16 +241,8 @@ struct proj5_transformation out = std::move(in); } - template - void forward(In const& in, Out & out, - typename boost::enable_if_c - < - boost::is_same - < - typename boost::geometry::tag::type, - boost::geometry::point_tag - >::value - >::type* dummy = 0) const + template = 0> + void forward(In const& in, Out & out) const { PJ_COORD c; c.lp.lam = boost::geometry::get_as_radian<0>(in); @@ -300,16 +277,8 @@ struct proj6_transformation out = std::move(in); } - template - void forward(In const& in, Out & out, - typename boost::enable_if_c - < - boost::is_same - < - typename boost::geometry::tag::type, - boost::geometry::point_tag - >::value - >::type* dummy = 0) const + template = 0> + void forward(In const& in, Out & out) const { PJ_COORD c; c.lp.lam = boost::geometry::get_as_radian<0>(in); diff --git a/test/srs/projection_interface_s.cpp b/test/srs/projection_interface_s.cpp index 571eb3ac9..9e260bf05 100644 --- a/test/srs/projection_interface_s.cpp +++ b/test/srs/projection_interface_s.cpp @@ -82,8 +82,8 @@ int test_main(int, char*[]) // compile-time errors { - point_ll pt_ll(1, 1); - point_xy pt_xy(0, 0); + //point_ll pt_ll(1, 1); + //point_xy pt_xy(0, 0); //projection > prj1; //projection prj2; diff --git a/test/srs/spar.cpp b/test/srs/spar.cpp index c8650d8b8..76701f61a 100644 --- a/test/srs/spar.cpp +++ b/test/srs/spar.cpp @@ -1,7 +1,7 @@ // Boost.Geometry // Unit Test -// Copyright (c) 2018, Oracle and/or its affiliates. +// Copyright (c) 2018-2021, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, @@ -27,30 +27,40 @@ int test_main(int, char* []) typedef par::o_proj o_proj; typedef par::guam guam; - BOOST_MPL_ASSERT_MSG((par::detail::is_param_tr::pred::value), - PROJ, (proj)); - BOOST_MPL_ASSERT_MSG((!par::detail::is_param_tr::pred::value), - NOT_PROJ, (int)); + BOOST_GEOMETRY_STATIC_ASSERT( + (par::detail::is_param_tr::pred::value), + "proj", proj); + BOOST_GEOMETRY_STATIC_ASSERT( + (!par::detail::is_param_tr::pred::value), + "not proj", int); - BOOST_MPL_ASSERT_MSG((par::detail::is_param_tr::pred::value), - ELLPS, (ellps)); - BOOST_MPL_ASSERT_MSG((!par::detail::is_param_tr::pred::value), - NOT_ELLPS, (int)); + BOOST_GEOMETRY_STATIC_ASSERT( + (par::detail::is_param_tr::pred::value), + "ellps", ellps); + BOOST_GEOMETRY_STATIC_ASSERT( + (!par::detail::is_param_tr::pred::value), + "not ellps", int); - BOOST_MPL_ASSERT_MSG((par::detail::is_param_tr::pred::value), - DATUM, (datum)); - BOOST_MPL_ASSERT_MSG((!par::detail::is_param_tr::pred::value), - NOT_DATUM, (int)); + BOOST_GEOMETRY_STATIC_ASSERT( + (par::detail::is_param_tr::pred::value), + "datum", datum); + BOOST_GEOMETRY_STATIC_ASSERT( + (!par::detail::is_param_tr::pred::value), + "not datum", int); - BOOST_MPL_ASSERT_MSG((par::detail::is_param_t::pred::value), - O_PROJ, (o_proj)); - BOOST_MPL_ASSERT_MSG((!par::detail::is_param_t::pred::value), - NOT_O_PROJ, (int)); + BOOST_GEOMETRY_STATIC_ASSERT( + (par::detail::is_param_t::pred::value), + "o_proj", o_proj); + BOOST_GEOMETRY_STATIC_ASSERT( + (!par::detail::is_param_t::pred::value), + "not o_proj", int); - BOOST_MPL_ASSERT_MSG((par::detail::is_param::pred::value), - GUAM, (guam)); - BOOST_MPL_ASSERT_MSG((!par::detail::is_param::pred::value), - NOT_GUAM, (int)); + BOOST_GEOMETRY_STATIC_ASSERT( + (par::detail::is_param::pred::value), + "guam", guam); + BOOST_GEOMETRY_STATIC_ASSERT( + (!par::detail::is_param::pred::value), + "not guam", int); typedef par::parameters params; typedef par::parameters params_e; diff --git a/test/strategies/distance.cpp b/test/strategies/distance.cpp index f4dd5381a..e2ff21944 100644 --- a/test/strategies/distance.cpp +++ b/test/strategies/distance.cpp @@ -1,8 +1,8 @@ // Boost.Geometry -// Copyright (c) 2017 Oracle and/or its affiliates. - +// Copyright (c) 2017-2021 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -28,8 +28,8 @@ typedef bg::strategy::vincenty vincenty_formula; template bool non_precise_ct() { - typedef typename bg::coordinate_type

::type ct; - return boost::is_integral::value || boost::is_float::value; + using ct = typename bg::coordinate_type

::type; + return std::is_integral::value || std::is_floating_point::value; } template diff --git a/test/strategies/distance_default_result.cpp b/test/strategies/distance_default_result.cpp index 4ee721bbd..a51404cfa 100644 --- a/test/strategies/distance_default_result.cpp +++ b/test/strategies/distance_default_result.cpp @@ -1,9 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2014, Oracle and/or its affiliates. - +// Copyright (c) 2014-2021, 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 @@ -17,10 +17,6 @@ #include -#include -#include -#include - #include #include @@ -35,17 +31,12 @@ namespace bg = ::boost::geometry; template -struct assert_equal_types +inline void assert_equal_types() { - assert_equal_types() - { - static const bool are_same = - boost::is_same::type::value; - - BOOST_MPL_ASSERT_MSG((are_same), - WRONG_DEFAULT_DISTANCE_RESULT, - (types)); - } + BOOST_GEOMETRY_STATIC_ASSERT( + (std::is_same::value), + "Wrong default distance result", + DefaultResult, ExpectedResult); }; //========================================================================= @@ -179,20 +170,20 @@ struct test_distance_result_box template inline void test_segment_all() { - typedef typename boost::mpl::if_ + using fp_return_type = std::conditional_t < - typename boost::is_same::type, + std::is_same::value, double, float - >::type float_return_type; + >; test_distance_result_segment(); test_distance_result_segment(); test_distance_result_segment(); test_distance_result_segment(); - test_distance_result_segment(); - test_distance_result_segment(); + test_distance_result_segment(); + test_distance_result_segment(); test_distance_result_segment(); test_distance_result_segment(); diff --git a/test/strategies/douglas_peucker.cpp b/test/strategies/douglas_peucker.cpp index c9216d555..c3a6193b9 100644 --- a/test/strategies/douglas_peucker.cpp +++ b/test/strategies/douglas_peucker.cpp @@ -2,7 +2,6 @@ // Unit Test // Copyright (c) 2015-2021, 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 @@ -24,11 +23,20 @@ #include #include +#include #include +#include + +#include +#include +#include #include #include +#include +#include + #include #include @@ -36,21 +44,8 @@ #include #include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - namespace bg = ::boost::geometry; -namespace ba = ::boost::assign; namespace services = bg::strategy::distance::services; typedef boost::tuple tuple_point_type; @@ -91,7 +86,7 @@ template inline Geometry from_wkt(std::string const& wkt) { Geometry geometry; - boost::geometry::read_wkt(wkt, geometry); + bg::read_wkt(wkt, geometry); return geometry; } @@ -151,14 +146,15 @@ struct equals template struct test_one_case { - template + using point_type = typename bg::point_type::type; + + template static inline void apply(std::string const& case_id, std::string const& wkt, double max_distance, Strategy const& strategy, - Range const& expected_result) + std::initializer_list const& expected_result) { - typedef typename bg::point_type::type point_type; std::vector result; Geometry geometry = from_wkt(wkt); @@ -227,7 +223,7 @@ inline void test_with_strategy(std::string label) "LINESTRING(12 -3, 4 8,-6 -13,-9 4,0 -15,-12 5)", 10, strategy, - ba::tuple_list_of(12,-3)(4,8)(-6,-13)(-12,5) + {{12,-3},{4,8},{-6,-13},{-12,5}} ); } else @@ -236,7 +232,7 @@ inline void test_with_strategy(std::string label) "LINESTRING(12 -3, 4 8,-6 -13,-9 4,0 -15,-12 5)", 10, strategy, - ba::tuple_list_of(12,-3)(4,8)(-6,-13)(-9,4)(0,-15)(-12,5) + {{12,-3},{4,8},{-6,-13},{-9,4},{0,-15},{-12,5}} ); } } @@ -245,21 +241,21 @@ inline void test_with_strategy(std::string label) "LINESTRING(-6 -13,-9 4,0 -15,-12 5)", 10, strategy, - ba::tuple_list_of(-6,-13)(-12,5) + {{-6,-13},{-12,5}} ); tester::apply("l03" + label, "LINESTRING(12 -3, 4 8,-6 -13,-9 4,0 -14,-12 5)", 10, strategy, - ba::tuple_list_of(12,-3)(4,8)(-6,-13)(-12,5) + {{12,-3},{4,8},{-6,-13},{-12,5}} ); tester::apply("l04" + label, "LINESTRING(12 -3, 4 8,-6 -13,-9 4,0 -14,-12 5)", 14, strategy, - ba::tuple_list_of(12,-3)(-6,-13)(-12,5) + {{12,-3},{-6,-13},{-12,5}} ); { @@ -306,13 +302,13 @@ inline void test_with_strategy(std::string label) wkt, 1, strategy, - ba::tuple_list_of(0,0)(5,0)(0,-1)(5,-1)(0,-2)(5,-2)(0,-3)(5,-4)(0,0) + {{0,0},{5,0},{0,-1},{5,-1},{0,-2},{5,-2},{0,-3},{5,-4},{0,0}} ); tester::apply("l05c1a" + label, wkt, 2, strategy, - ba::tuple_list_of(0,0)(5,0)(0,-1)(5,-1)(0,-2)(5,-4)(0,0) + {{0,0},{5,0},{0,-1},{5,-1},{0,-2},{5,-4},{0,0}} ); } else @@ -321,13 +317,13 @@ inline void test_with_strategy(std::string label) wkt, 1, strategy, - ba::tuple_list_of(0,0)(5,0)(0,-1)(5,-1)(0,-2)(5,-2)(0,-4)(5,-4)(0,0) + {{0,0},{5,0},{0,-1},{5,-1},{0,-2},{5,-2},{0,-4},{5,-4},{0,0}} ); tester::apply("l05c2a" + label, wkt, 2, strategy, - ba::tuple_list_of(0,0)(5,0)(0,-1)(5,-1)(0,-4)(5,-4)(0,0) + {{0,0},{5,0},{0,-1},{5,-1},{0,-4},{5,-4},{0,0}} ); } } diff --git a/test/strategies/pythagoras.cpp b/test/strategies/pythagoras.cpp index 66fd77634..bfa406160 100644 --- a/test/strategies/pythagoras.cpp +++ b/test/strategies/pythagoras.cpp @@ -5,6 +5,10 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021 Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -19,7 +23,8 @@ # pragma warning( disable : 4101 ) #endif -#include +// TODO move this to another non-unit test +//#include #include #include @@ -289,37 +294,38 @@ void test_all_3d() test_all_3d >(); } -template -void time_compare_s(int const n) -{ - boost::timer t; - P p1, p2; - bg::assign_values(p1, 1, 1); - bg::assign_values(p2, 2, 2); - Strategy strategy; - typename bg::strategy::distance::services::return_type::type s = 0; - for (int i = 0; i < n; i++) - { - for (int j = 0; j < n; j++) - { - bg::set<0>(p2, bg::get<0>(p2) + 0.001); - s += strategy.apply(p1, p2); - } - } - std::cout << "s: " << s << " t: " << t.elapsed() << std::endl; -} - -template -void time_compare(int const n) -{ - time_compare_s >(n); - time_compare_s >(n); -} +// TODO move this to another non-unit test +//template +//void time_compare_s(int const n) +//{ +// boost::timer t; +// P p1, p2; +// bg::assign_values(p1, 1, 1); +// bg::assign_values(p2, 2, 2); +// Strategy strategy; +// typename bg::strategy::distance::services::return_type::type s = 0; +// for (int i = 0; i < n; i++) +// { +// for (int j = 0; j < n; j++) +// { +// bg::set<0>(p2, bg::get<0>(p2) + 0.001); +// s += strategy.apply(p1, p2); +// } +// } +// std::cout << "s: " << s << " t: " << t.elapsed() << std::endl; +//} +// +//template +//void time_compare(int const n) +//{ +// time_compare_s >(n); +// time_compare_s >(n); +//} int test_main(int, char* []) { test_integer(true); - test_integer(true); + test_integer(true); test_integer(false); test_all_3d(); diff --git a/test/strategies/pythagoras_point_box.cpp b/test/strategies/pythagoras_point_box.cpp index 1596454d3..cc5a5fe25 100644 --- a/test/strategies/pythagoras_point_box.cpp +++ b/test/strategies/pythagoras_point_box.cpp @@ -5,9 +5,8 @@ // Copyright (c) 2008-2014 Bruno Lalande, Paris, France. // Copyright (c) 2009-2014 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2014-2020. -// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates. - +// This file was modified by Oracle on 2014-2021. +// Modifications copyright (c) 2014-2021, 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 @@ -29,7 +28,9 @@ #endif #include -#include + +// TODO move this to another non-unit test +//#include #include #include @@ -365,8 +366,8 @@ inline void test_integer(bool check_types) if (check_types) { - BOOST_CHECK((boost::is_same::type::value)); - BOOST_CHECK((boost::is_same::type::value)); + BOOST_CHECK((std::is_same::type::value)); + BOOST_CHECK((std::is_same::type::value)); } } @@ -394,41 +395,43 @@ void test_all_3d() test_all_3d >(); } -template -void time_compare_s(int const n) -{ - typedef bg::model::box

box_type; - boost::timer t; - P p; - box_type b; - bg::assign_values(b, 0, 0, 1, 1); - bg::assign_values(p, 2, 2); - Strategy strategy; - typename bg::strategy::distance::services::return_type - < - Strategy, P, box_type - >::type s = 0; - for (int i = 0; i < n; i++) - { - for (int j = 0; j < n; j++) - { - bg::set<0>(p, bg::get<0>(p) + 0.001); - s += strategy.apply(p, b); - } - } - std::cout << "s: " << s << " t: " << t.elapsed() << std::endl; -} - -template -inline void time_compare(int const n) -{ - time_compare_s >(n); - time_compare_s - < - P, bg::strategy::distance::comparable::pythagoras_point_box<> - >(n); -} +// TODO move this to another non-unit test +//template +//void time_compare_s(int const n) +//{ +// typedef bg::model::box

box_type; +// +// boost::timer t; +// P p; +// box_type b; +// bg::assign_values(b, 0, 0, 1, 1); +// bg::assign_values(p, 2, 2); +// Strategy strategy; +// typename bg::strategy::distance::services::return_type +// < +// Strategy, P, box_type +// >::type s = 0; +// for (int i = 0; i < n; i++) +// { +// for (int j = 0; j < n; j++) +// { +// bg::set<0>(p, bg::get<0>(p) + 0.001); +// s += strategy.apply(p, b); +// } +// } +// std::cout << "s: " << s << " t: " << t.elapsed() << std::endl; +//} +// +//template +//inline void time_compare(int const n) +//{ +// time_compare_s >(n); +// time_compare_s +// < +// P, bg::strategy::distance::comparable::pythagoras_point_box<> +// >(n); +//} @@ -436,7 +439,7 @@ inline void time_compare(int const n) BOOST_AUTO_TEST_CASE( test_integer_all ) { test_integer(true); - test_integer(true); + test_integer(true); test_integer(false); } diff --git a/test/strategies/vincenty.cpp b/test/strategies/vincenty.cpp index e0b0e4059..dd4e5f4d8 100644 --- a/test/strategies/vincenty.cpp +++ b/test/strategies/vincenty.cpp @@ -5,9 +5,8 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2014, 2015, 2016, 2017. -// Modifications copyright (c) 2014-2017 Oracle and/or its affiliates. - +// This file was modified by Oracle on 2014-2021. +// Modifications copyright (c) 2014-2021 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library @@ -96,8 +95,8 @@ double azimuth(double deg, double min) template bool non_precise_ct() { - typedef typename bg::coordinate_type

::type ct; - return boost::is_integral::value || boost::is_float::value; + using ct = typename bg::coordinate_type

::type; + return std::is_integral::value || std::is_floating_point::value; } template @@ -248,8 +247,8 @@ void test_all() // Test fractional coordinates only for non-integral types if ( BOOST_GEOMETRY_CONDITION( - ! boost::is_integral::type>::value - && ! boost::is_integral::type>::value ) ) + ! std::is_integral::type>::value + && ! std::is_integral::type>::value ) ) { // Flinders Peak -> Buninyong test_vincenty(azimuth(144,25,29.52440), azimuth(-37,57,3.72030), diff --git a/test/string_from_type.hpp b/test/string_from_type.hpp index 8d2bd6db8..6d02b8b15 100644 --- a/test/string_from_type.hpp +++ b/test/string_from_type.hpp @@ -4,10 +4,10 @@ // Copyright (c) 2008-2015 Bruno Lalande, Paris, France. // Copyright (c) 2009-2015 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2015. -// Modifications copyright (c) 2015, Oracle and/or its affiliates. - +// This file was modified by Oracle on 2015-2021. +// Modifications copyright (c) 2015-2021, 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 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -50,11 +50,9 @@ template <> struct string_from_type template <> struct string_from_type { static std::string name() { return "m"; } }; -#if defined(BOOST_HAS_LONG_LONG) // this is what g++ and clang++ use -template <> struct string_from_type +template <> struct string_from_type { static std::string name() { return "x"; } }; -#endif #if defined(BOOST_HAS_INT128) // this is what g++ and clang++ use diff --git a/test/test_common/test_point.hpp b/test/test_common/test_point.hpp index 31b124867..3f888a2f5 100644 --- a/test/test_common/test_point.hpp +++ b/test/test_common/test_point.hpp @@ -3,6 +3,11 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. + +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021 Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -60,7 +65,7 @@ template<> struct coordinate_system { typedef cs::cartesian type; }; template<> -struct dimension: boost::mpl::int_<3> {}; +struct dimension : std::integral_constant {}; template<> struct access { diff --git a/test/test_common/with_pointer.hpp b/test/test_common/with_pointer.hpp index 9c7b95db7..1e77e0e64 100644 --- a/test/test_common/with_pointer.hpp +++ b/test/test_common/with_pointer.hpp @@ -3,6 +3,11 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. + +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021 Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -48,7 +53,7 @@ template<> struct coordinate_type template<> struct coordinate_system { typedef cs::cartesian type; }; -template<> struct dimension : boost::mpl::int_<2> {}; +template<> struct dimension : std::integral_constant {}; template<> struct access diff --git a/test/test_geometries/custom_lon_lat_point.hpp b/test/test_geometries/custom_lon_lat_point.hpp index 1d49dcc00..5c0dc0d9d 100644 --- a/test/test_geometries/custom_lon_lat_point.hpp +++ b/test/test_geometries/custom_lon_lat_point.hpp @@ -1,9 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2014, Oracle and/or its affiliates. - +// Copyright (c) 2014-2021, 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 @@ -11,8 +11,6 @@ #ifndef BOOST_GEOMETRY_TEST_TEST_GEOMETRIES_CUSTOM_LON_LAT_POINT_HPP #define BOOST_GEOMETRY_TEST_TEST_GEOMETRIES_CUSTOM_LON_LAT_POINT_HPP -#include - #include #include #include @@ -51,7 +49,7 @@ struct coordinate_system > template struct dimension > - : boost::mpl::int_<2> + : std::integral_constant {}; template @@ -109,7 +107,7 @@ struct coordinate_system > template struct dimension > - : boost::mpl::int_<2> + : std::integral_constant {}; template diff --git a/test/to_svg.hpp b/test/to_svg.hpp index 10c13f800..6897fcf96 100644 --- a/test/to_svg.hpp +++ b/test/to_svg.hpp @@ -2,32 +2,31 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014 Oracle and/or its affiliates. +// This file was modified by Oracle on 2014-2021. +// Modifications copyright (c) 2014-2021 Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle - #ifndef BOOST_GEOMETRY_TEST_TO_SVG_HPP #define BOOST_GEOMETRY_TEST_TO_SVG_HPP #include -#include -#include #include #include #include #include #include #include -#include - #include +#include +#include + + template inline void turns_to_svg(Turns const& turns, Mapper & mapper, bool /*enrich*/ = false) { @@ -42,7 +41,7 @@ inline void turns_to_svg(Turns const& turns, Mapper & mapper, bool /*enrich*/ = int index = 0; int const margin = 5; - BOOST_FOREACH(turn_info const& turn, turns) + for (turn_info const& turn : turns) { int lineheight = 10; mapper.map(turn.point, "fill:rgb(255,128,0);" diff --git a/test/util/calculation_type.cpp b/test/util/calculation_type.cpp index 6e026676f..7ddc989fb 100644 --- a/test/util/calculation_type.cpp +++ b/test/util/calculation_type.cpp @@ -5,6 +5,10 @@ // Copyright (c) 2012 Bruno Lalande, Paris, France. // Copyright (c) 2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -58,7 +62,7 @@ void test() std::string const caption = helper(); - BOOST_CHECK_MESSAGE((boost::is_same::type::value), + BOOST_CHECK_MESSAGE((std::is_same::value), "Failure, types do not agree;" << " input: " << caption << " defaults: " << typeid(DefaultFP).name() @@ -88,7 +92,7 @@ void test_with_calculation_type() std::string const caption = helper(); - BOOST_CHECK_MESSAGE((boost::is_same::type::value), + BOOST_CHECK_MESSAGE((std::is_same::value), "Failure, types do not agree;" << " input: " << caption << " calculation type: " << typeid(CalculationType).name() @@ -114,7 +118,7 @@ void test_unary() DefaultInt >::type type; - BOOST_CHECK_MESSAGE((boost::is_same::type::value), + BOOST_CHECK_MESSAGE((std::is_same::value), "Failure, types do not agree;" << " input: " << typeid(typename bg::coordinate_type::type).name() << " defaults: " << typeid(DefaultFP).name() @@ -148,7 +152,7 @@ void test_ternary() std::string const caption = helper3(); - BOOST_CHECK_MESSAGE((boost::is_same::type::value), + BOOST_CHECK_MESSAGE((std::is_same::value), "Failure, types do not agree;" << " input: " << caption << " defaults: " << typeid(DefaultFP).name() @@ -169,7 +173,7 @@ int test_main(int, char* []) typedef model::point i; typedef model::point c; typedef model::point s; - typedef model::point ll; + typedef model::point ll; typedef model::point u; // Calculation type "void" so @@ -187,11 +191,11 @@ int test_main(int, char* []) test(); test(); test(); - test(); + test(); // Even if we specify "int" as default-calculation-type, it should never go downwards. // So it will select "long long" - test(); + test(); // user defined test(); diff --git a/test/util/is_implemented.cpp b/test/util/is_implemented.cpp index 3eed994b4..dd6e09b0f 100644 --- a/test/util/is_implemented.cpp +++ b/test/util/is_implemented.cpp @@ -74,14 +74,14 @@ int test_main(int, char* []) typedef bg::model::d2::point_xy point_type; BOOST_MPL_ASSERT(( - boost::is_same< + std::is_same< bg::util::is_implemented2 < point_type, point_type, bg::algorithm_archetype >::type, boost::mpl::false_ - > + >::value )); return 0; diff --git a/test/util/math_sqrt.cpp b/test/util/math_sqrt.cpp index 0907990ab..e06bc05af 100644 --- a/test/util/math_sqrt.cpp +++ b/test/util/math_sqrt.cpp @@ -1,9 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2014, Oracle and/or its affiliates. - +// Copyright (c) 2014-2021, 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 @@ -14,11 +14,11 @@ #include #include +#include #include #include -#include #include "number_types.hpp" @@ -26,8 +26,8 @@ // otherwise the test will fail for the custom number type: // custom_with_global_sqrt -#include #include +#include namespace bg = boost::geometry; @@ -35,68 +35,44 @@ namespace bg = boost::geometry; // call BOOST_CHECK -template -struct check +template +< + typename Argument, typename Result, + std::enable_if_t::value, int> = 0 +> +inline void check(Argument const& arg, Result const& result) { - template - static inline void apply(Argument const& arg, Result const& result) - { - BOOST_CHECK_CLOSE(static_cast(bg::math::sqrt(arg)), - static_cast(result), - 0.00001); - } -}; + BOOST_CHECK_CLOSE(static_cast(bg::math::sqrt(arg)), + static_cast(result), + 0.00001); +} - -template -struct check +template +< + typename Argument, typename Result, + std::enable_if_t::value, int> = 0 +> +inline void check(Argument const& arg, Result const& result) { - template - static inline void apply(Argument const& arg, Result const& result) - { - Result const tol(0.00001); - BOOST_CHECK( bg::math::abs(bg::math::sqrt(arg) - result) < tol ); - } -}; - - - - + Result const tol(0.00001); + BOOST_CHECK( bg::math::abs(bg::math::sqrt(arg) - result) < tol ); +} // test sqrt return type and value -template -< - typename Argument, - typename ExpectedResult, - typename Result = typename bg::math::detail::square_root - < - Argument - >::return_type, - bool IsFundamental = boost::is_fundamental::value -> -struct check_sqrt - : bg::not_implemented -{}; - - -template -struct check_sqrt +template +inline void check_sqrt(Argument const& arg, Result const& result) { - static inline void apply(Argument const& arg, Result const& result) - { + using return_type = typename bg::math::detail::square_root::return_type; + BOOST_GEOMETRY_STATIC_ASSERT((std::is_same::value), "Wrong return type"); + #ifdef BOOST_GEOMETRY_TEST_DEBUG - std::cout << "testing: " << typeid(Result).name() - << " sqrt(" << typeid(Argument).name() - << ")" << std::endl; + std::cout << "testing: " << typeid(Result).name() + << " sqrt(" << typeid(Argument).name() + << ")" << std::endl; #endif - check::apply(arg, result); - } -}; - - - - + check(arg, result); +} // test cases @@ -106,24 +82,17 @@ BOOST_AUTO_TEST_CASE( test_math_sqrt_fundamental ) static const long double sqrt2L = std::sqrt(2.0L); static const float sqrt2F = std::sqrt(2.0F); - check_sqrt::apply(2.0F, sqrt2F); - check_sqrt::apply(2.0, sqrt2); - check_sqrt::apply(2.0L, sqrt2L); + check_sqrt(2.0F, sqrt2F); + check_sqrt(2.0, sqrt2); + check_sqrt(2.0L, sqrt2L); - check_sqrt::apply(2, sqrt2); - check_sqrt::apply(2, sqrt2); - check_sqrt::apply(2, sqrt2); - check_sqrt::apply(2, sqrt2); - check_sqrt::apply(2L, sqrt2); -#if !defined(BOOST_NO_LONG_LONG) - check_sqrt::apply(2LL, sqrt2); -#endif -#ifdef BOOST_HAS_LONG_LONG - check_sqrt - < - boost::long_long_type, double - >::apply(boost::long_long_type(2), sqrt2); -#endif + check_sqrt(2, sqrt2); + check_sqrt(2, sqrt2); + check_sqrt(2, sqrt2); + check_sqrt(2, sqrt2); + check_sqrt(2L, sqrt2); + + check_sqrt(2LL, sqrt2); } @@ -135,7 +104,7 @@ BOOST_AUTO_TEST_CASE( test_math_sqrt_custom ) static const double sqrt2 = std::sqrt(2.0); - check_sqrt::apply(custom1(2.0), custom1(sqrt2)); - check_sqrt::apply(custom2(2.0), custom2(sqrt2)); - check_sqrt::apply(custom3(2.0), custom3(sqrt2)); + check_sqrt(custom1(2.0), custom1(sqrt2)); + check_sqrt(custom2(2.0), custom2(sqrt2)); + check_sqrt(custom3(2.0), custom3(sqrt2)); } diff --git a/test/util/promote_integral.cpp b/test/util/promote_integral.cpp index 670f78904..babad6491 100644 --- a/test/util/promote_integral.cpp +++ b/test/util/promote_integral.cpp @@ -1,8 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2015-2020, Oracle and/or its affiliates. - +// Copyright (c) 2015-2021, 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 @@ -290,12 +289,10 @@ struct test_promotion { tester::template apply(case_id); } -#if defined(BOOST_HAS_LONG_LONG) - else if (bit_size() >= min_size) + else if (bit_size() >= min_size) { - tester::template apply(case_id); + tester::template apply(case_id); } -#endif #if defined(BOOST_HAS_INT128) && defined(BOOST_GEOMETRY_ENABLE_INT128) else if (bit_size() >= min_size) { @@ -360,12 +357,10 @@ struct test_promotion { tester::apply(case_id); } -#if defined(BOOST_HAS_LONG_LONG) - else if (bit_size() >= min_size) + else if (bit_size() >= min_size) { - tester::template apply(case_id); + tester::template apply(case_id); } -#endif #if defined(BOOST_HAS_INT128) && defined(BOOST_GEOMETRY_ENABLE_INT128) else if (bit_size() >= min_size) { @@ -438,15 +433,13 @@ BOOST_AUTO_TEST_CASE( test_std_size_t ) test_promotion::apply("size_t"); } -#ifdef BOOST_HAS_LONG_LONG BOOST_AUTO_TEST_CASE( test_long_long ) { - test_promotion::apply("long long"); - test_promotion::apply("long long"); - test_promotion::apply("ulong long"); - test_promotion::apply("ulong long"); + test_promotion::apply("long long"); + test_promotion::apply("long long"); + test_promotion::apply("ulong long"); + test_promotion::apply("ulong long"); } -#endif #if defined(BOOST_HAS_INT128) && defined(BOOST_GEOMETRY_ENABLE_INT128) BOOST_AUTO_TEST_CASE( test_int128 ) diff --git a/test/util/select_most_precise.cpp b/test/util/select_most_precise.cpp index 3ec2dec73..c4146089c 100644 --- a/test/util/select_most_precise.cpp +++ b/test/util/select_most_precise.cpp @@ -5,6 +5,10 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2021. +// Modifications copyright (c) 2021, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -23,8 +27,8 @@ struct user_defined {}; template void test() { - typedef typename bg::select_most_precise::type type; - bool is_same = boost::is_same::type::value; + using type = typename bg::select_most_precise::type; + bool is_same = std::is_same::value; BOOST_CHECK_MESSAGE(is_same, "The most precise of types " <<