diff --git a/index/test/rtree/rtree_values.cpp b/index/test/rtree/rtree_values.cpp index 2059a8141..e9eb13810 100644 --- a/index/test/rtree/rtree_values.cpp +++ b/index/test/rtree/rtree_values.cpp @@ -22,6 +22,30 @@ struct point BOOST_GEOMETRY_REGISTER_POINT_2D(point, double, bg::cs::cartesian, x, y) +template +void check_convertible_to_value(Rtree const& rt, Convertible const& conv) +{ + static const bool + is_conv_to_indexable + = boost::is_convertible::value; + static const bool + is_conv_to_value + = boost::is_convertible::value; + static const bool + is_same_as_indexable + = boost::is_same::value; + static const bool + is_same_as_value + = boost::is_same::value; + + BOOST_CHECK_EQUAL(is_same_as_indexable, false); + BOOST_CHECK_EQUAL(is_same_as_value, false); + BOOST_CHECK_EQUAL(is_conv_to_indexable, false); + BOOST_CHECK_EQUAL(is_conv_to_value, true); + + typename Rtree::value_type const& val = conv; + BOOST_CHECK(rt.value_eq()(val, conv)); +} template void test_pair() @@ -45,6 +69,11 @@ void test_pair() rt.insert(std::make_pair(box, (unsigned short)0)); BOOST_CHECK_EQUAL(rt.size(), 3u); + check_convertible_to_value(rt, std::make_pair(box, 0)); + check_convertible_to_value(rt, std::make_pair(box, (unsigned short)0)); + BOOST_CHECK(bg::covered_by(rt.indexable_get()(std::make_pair(box, 0)), rt.bounds())); + BOOST_CHECK(bg::covered_by(rt.indexable_get()(std::make_pair(box, (unsigned short)0)), rt.bounds())); + BOOST_CHECK_EQUAL(rt.count(val), 3u); BOOST_CHECK_EQUAL(rt.count(std::make_pair(box, 0)), 3u); BOOST_CHECK_EQUAL(rt.count(std::make_pair(box, (unsigned short)0)), 3u);