Skip to content

Commit

Permalink
test: add parentheses, change names in rtree strategies test
Browse files Browse the repository at this point in the history
  • Loading branch information
awulkiew committed Jan 17, 2025
1 parent cb59e0e commit 4178bec
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions index/test/rtree/rtree_with_strategies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ BOOST_GEOMETRY_REGISTER_BOX(box, point, mi, ma)
BOOST_GEOMETRY_REGISTER_SEGMENT(segment, point, first, second)

template <typename QueryValue, typename Rtree>
constexpr bool is_bp_or_bb_v = bg::util::is_box<QueryValue>::value
&& bg::util::is_box<typename Rtree::value_type>::value
|| bg::util::is_box<QueryValue>::value
&& bg::util::is_point<typename Rtree::value_type>::value;
constexpr bool is_bp_or_bb_v = (bg::util::is_box<QueryValue>::value
&& bg::util::is_point<typename Rtree::value_type>::value)
|| (bg::util::is_box<QueryValue>::value
&& bg::util::is_box<typename Rtree::value_type>::value);

template <typename QueryValue, typename Rtree>
constexpr bool is_pb_or_bb_v = bg::util::is_box<QueryValue>::value
&& bg::util::is_box<typename Rtree::value_type>::value
|| bg::util::is_point<QueryValue>::value
&& bg::util::is_box<typename Rtree::value_type>::value;
constexpr bool is_pb_or_bb_v = (bg::util::is_point<QueryValue>::value
&& bg::util::is_box<typename Rtree::value_type>::value)
|| (bg::util::is_box<QueryValue>::value
&& bg::util::is_box<typename Rtree::value_type>::value);

template <typename QueryValue, typename Rtree>
constexpr bool is_pp_or_bb_v = bg::util::is_box<QueryValue>::value
&& bg::util::is_box<typename Rtree::value_type>::value
|| bg::util::is_point<QueryValue>::value
&& bg::util::is_point<typename Rtree::value_type>::value;
constexpr bool is_pp_or_bb_v = (bg::util::is_point<QueryValue>::value
&& bg::util::is_point<typename Rtree::value_type>::value)
|| (bg::util::is_box<QueryValue>::value
&& bg::util::is_box<typename Rtree::value_type>::value);

template
<
Expand All @@ -50,6 +50,8 @@ template
>
void test_queries_bp_bb(Rtree const& rtree)
{
// These predicates use algorithms that are not implemented for
// some geometry combinations
std::vector<typename Rtree::value_type> values;
rtree.query(bgi::covered_by(QueryValue{}), std::back_inserter(values));
rtree.query(bgi::disjoint(QueryValue{}), std::back_inserter(values));
Expand Down Expand Up @@ -89,8 +91,10 @@ template
typename QueryValue, typename Rtree,
std::enable_if_t<is_pp_or_bb_v<QueryValue, Rtree>, int> = 0
>
void test_overlaps_pp_bb(Rtree const& rtree)
void test_queries_pp_bb(Rtree const& rtree)
{
// These predicates use algorithms that are not implemented for
// some geometry combinations
std::vector<typename Rtree::value_type> values;
rtree.query(bgi::overlaps(QueryValue{}), std::back_inserter(values));
rtree.query(bgi::touches(QueryValue{}), std::back_inserter(values));
Expand All @@ -101,7 +105,7 @@ template
typename QueryValue, typename Rtree,
std::enable_if_t<(!is_pp_or_bb_v<QueryValue, Rtree>), int> = 0
>
void test_overlaps_pp_bb(Rtree const& ) {}
void test_queries_pp_bb(Rtree const& ) {}

template <typename QueryValue, typename Rtree>
void test_queries(Rtree const& rtree)
Expand All @@ -111,7 +115,7 @@ void test_queries(Rtree const& rtree)
rtree.query(bgi::nearest(QueryValue{}, 1), std::back_inserter(values));
test_queries_bp_bb<QueryValue>(rtree);
test_queries_pb_bb<QueryValue>(rtree);
test_overlaps_pp_bb<QueryValue>(rtree);
test_queries_pp_bb<QueryValue>(rtree);
}

template <typename Value, typename Params, typename Strategies>
Expand Down

0 comments on commit 4178bec

Please sign in to comment.