From 970bce222f5f724e353c4209f9bf9e03e92ea9e2 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Mon, 24 Jun 2019 12:21:19 +0200 Subject: [PATCH] [test] Update tests WRT recent changes related to CS-specific strategies propagation. --- index/test/rtree/test_rtree.hpp | 18 ++++++++++++------ .../set_operations/check_turn_less.hpp | 15 +++++++++------ .../test_get_turns_ll_invariance.hpp | 14 ++++++++++---- test/strategies/test_within.hpp | 6 +++--- 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/index/test/rtree/test_rtree.hpp b/index/test/rtree/test_rtree.hpp index 3433beefe..f937e768a 100644 --- a/index/test/rtree/test_rtree.hpp +++ b/index/test/rtree/test_rtree.hpp @@ -3,6 +3,10 @@ // Copyright (c) 2011-2015 Adam Wulkiewicz, Lodz, Poland. +// This file was modified by Oracle on 2019. +// Modifications copyright (c) 2019, 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) @@ -922,10 +926,10 @@ struct covered_by_impl BOOST_FOREACH(Value const& v, input) { - if ( bg::covered_by( - bgi::detail::return_ref_or_bounds( - tree.indexable_get()(v)), - qbox) ) + if ( bgi::detail::covered_by_bounds( + tree.indexable_get()(v), + qbox, + bgi::detail::get_strategy(tree.parameters())) ) { expected_output.push_back(v); } @@ -1839,7 +1843,8 @@ void test_rtree_bounds(Parameters const& parameters, Allocator const& allocator) generate::rtree(t, input, qbox); - b = bgi::detail::rtree::values_box(input.begin(), input.end(), t.indexable_get()); + b = bgi::detail::rtree::values_box(input.begin(), input.end(), t.indexable_get(), + bgi::detail::get_strategy(parameters)); BOOST_CHECK(bg::equals(t.bounds(), b)); BOOST_CHECK(bg::equals(t.bounds(), bgi::bounds(t))); @@ -1851,7 +1856,8 @@ void test_rtree_bounds(Parameters const& parameters, Allocator const& allocator) input.pop_back(); } - b = bgi::detail::rtree::values_box(input.begin(), input.end(), t.indexable_get()); + b = bgi::detail::rtree::values_box(input.begin(), input.end(), t.indexable_get(), + bgi::detail::get_strategy(parameters)); BOOST_CHECK(bg::equals(t.bounds(), b)); diff --git a/test/algorithms/set_operations/check_turn_less.hpp b/test/algorithms/set_operations/check_turn_less.hpp index 980862810..0e9984d4a 100644 --- a/test/algorithms/set_operations/check_turn_less.hpp +++ b/test/algorithms/set_operations/check_turn_less.hpp @@ -1,12 +1,13 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2015, Oracle and/or its affiliates. +// Copyright (c) 2015, 2019, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html -// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle - #ifndef BOOST_GEOMETRY_TEST_CHECK_TURN_LESS_HPP #define BOOST_GEOMETRY_TEST_CHECK_TURN_LESS_HPP @@ -86,11 +87,13 @@ struct check_turn_less bg::detail::get_turns::get_turn_info_type < Geometry1, Geometry2, assign_policy<> - >, - robust_policy_type + > > get_turns_type; - typedef typename get_turns_type::turn_info turn_info; + typedef typename get_turns_type::template turn_info_type + < + strategy_type, robust_policy_type + >::type turn_info; typedef std::vector turns_container; diff --git a/test/algorithms/set_operations/test_get_turns_ll_invariance.hpp b/test/algorithms/set_operations/test_get_turns_ll_invariance.hpp index 42a3a729d..22b01cab2 100644 --- a/test/algorithms/set_operations/test_get_turns_ll_invariance.hpp +++ b/test/algorithms/set_operations/test_get_turns_ll_invariance.hpp @@ -1,12 +1,13 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// Copyright (c) 2014, 2019, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html -// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle - #ifndef BOOST_GEOMETRY_TEST_GET_TURNS_LL_INVARIANCE_HPP #define BOOST_GEOMETRY_TEST_GET_TURNS_LL_INVARIANCE_HPP @@ -91,10 +92,15 @@ public: static inline void apply(Linear1 const& lineargeometry1, Linear2 const& lineargeometry2) { + typedef typename bg::strategy::relate::services::default_strategy + < + Linear1, Linear2 + >::type strategy_type; + typedef typename bg_detail::relate::turns::get_turns < Linear1, Linear2 - >::turn_info turn_info; + >::template turn_info_type::type turn_info; typedef std::vector turns_container; diff --git a/test/strategies/test_within.hpp b/test/strategies/test_within.hpp index d47080ccf..ae9b06dde 100644 --- a/test/strategies/test_within.hpp +++ b/test/strategies/test_within.hpp @@ -3,8 +3,8 @@ // Copyright (c) 2010-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, 2019. +// Modifications copyright (c) 2014, 2019 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -72,7 +72,7 @@ void test_point_in_polygon(std::string const& case_id, bool expected, bool use_within = true) { - BOOST_CONCEPT_ASSERT( (bg::concepts::WithinStrategyPolygonal) ); + BOOST_CONCEPT_ASSERT( (bg::concepts::WithinStrategyPolygonal) ); bool detected = use_within ? bg::within(point, polygon, strategy) : bg::covered_by(point, polygon, strategy);