Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83157 - sandbox-branches/geometry/index/test/rtree
From: adam.wulkiewicz_at_[hidden]
Date: 2013-02-25 15:47:20


Author: awulkiew
Date: 2013-02-25 15:47:19 EST (Mon, 25 Feb 2013)
New Revision: 83157
URL: http://svn.boost.org/trac/boost/changeset/83157

Log:
rtree: added value predicate test.
Text files modified:
   sandbox-branches/geometry/index/test/rtree/test_rtree.hpp | 27 +++++++++++++++++++++++++++
   1 files changed, 27 insertions(+), 0 deletions(-)

Modified: sandbox-branches/geometry/index/test/rtree/test_rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/test_rtree.hpp (original)
+++ sandbox-branches/geometry/index/test/rtree/test_rtree.hpp 2013-02-25 15:47:19 EST (Mon, 25 Feb 2013)
@@ -837,6 +837,31 @@
     BOOST_CHECK(n_res < 5);
 }
 
+template <typename Value>
+bool test_value_fun(Value const& v) { return true; }
+
+struct test_value_obj
+{
+ template <typename Value>
+ bool operator()(Value const& v) const { return true; }
+};
+
+template <typename Rtree, typename Value>
+void test_value_predicate(Rtree const& rtree, std::vector<Value> const& input)
+{
+ std::vector<Value> result;
+ rtree.query(bgi::value(test_value_obj()), std::back_inserter(result));
+ BOOST_CHECK(result.size() == input.size());
+ result.clear();
+ rtree.query(bgi::value(test_value_fun<Value>), std::back_inserter(result));
+ BOOST_CHECK(result.size() == input.size());
+#ifndef BOOST_NO_CXX11_LAMBDAS
+ result.clear();
+ rtree.query(bgi::value([](Value const& v){ return true; }), std::back_inserter(result));
+ BOOST_CHECK(result.size() == input.size());
+#endif
+}
+
 // rtree copying and moving
 
 template <typename Rtree, typename Box>
@@ -1136,6 +1161,8 @@
     test_nearest_query_k(tree, input, pt, 10);
     test_nearest_query_not_found(tree, generate_outside_point<P>::apply());
 
+ test_value_predicate(tree, input);
+
     test_copy_assignment_swap_move(tree, qbox);
 
     test_create_insert(tree, input, qbox);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk