Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81302 - in sandbox-branches/geometry/index_dev: boost/geometry/extensions/index/rtree test/rtree
From: adam.wulkiewicz_at_[hidden]
Date: 2012-11-11 20:07:59


Author: awulkiew
Date: 2012-11-11 20:07:59 EST (Sun, 11 Nov 2012)
New Revision: 81302
URL: http://svn.boost.org/trac/boost/changeset/81302

Log:
exceptions test improved.
Text files modified:
   sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/rtree.hpp | 2 +-
   sandbox-branches/geometry/index_dev/test/rtree/rtree_exceptions.cpp | 26 +++++++++++++++++---------
   2 files changed, 18 insertions(+), 10 deletions(-)

Modified: sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/rtree.hpp (original)
+++ sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/rtree/rtree.hpp 2012-11-11 20:07:59 EST (Sun, 11 Nov 2012)
@@ -138,7 +138,7 @@
     */
     inline ~rtree()
     {
- if ( !this->empty() )
+ if ( m_root )
             this->destroy(*this);
     }
 

Modified: sandbox-branches/geometry/index_dev/test/rtree/rtree_exceptions.cpp
==============================================================================
--- sandbox-branches/geometry/index_dev/test/rtree/rtree_exceptions.cpp (original)
+++ sandbox-branches/geometry/index_dev/test/rtree/rtree_exceptions.cpp 2012-11-11 20:07:59 EST (Sun, 11 Nov 2012)
@@ -21,23 +21,27 @@
     typedef bgi::rtree<Value, Parameters> Tree;
     typedef typename Tree::box_type B;
 
- for ( size_t i = 10 ; i < 100 ; i += 10 )
+ throwing_value::reset_calls_counter();
+ throwing_value::set_max_calls((std::numeric_limits<size_t>::max)());
+ std::vector<Value> input;
+ B qbox;
+ generate_input<2>::apply(input, qbox);
+
+ for ( size_t i = 10 ; i < 100 ; i += 5 )
     {
         throwing_value::reset_calls_counter();
- throwing_value::set_max_calls((std::numeric_limits<size_t>::max)());
+ throwing_value::set_max_calls(i);
 
         Tree tree(parameters);
- std::vector<Value> input;
- B qbox;
- generate_input<2>::apply(input, qbox);
-
- throwing_value::reset_calls_counter();
- throwing_value::set_max_calls(0);
-
+
         BOOST_CHECK_THROW( tree.insert(input.begin(), input.end()), throwing_value_copy_exception );
     }
 }
 
+//#define _CRTDBG_MAP_ALLOC
+//#include <stdlib.h>
+//#include <crtdbg.h>
+
 int test_main(int, char* [])
 {
     test_rtree_value_exceptions< bgi::linear<4, 2> >();
@@ -47,5 +51,9 @@
     test_rtree_value_exceptions< bgi::rstar<4, 2> >();
     test_rtree_value_exceptions(bgi::runtime::rstar(4, 2));
 
+ //std::cout << "----------------------------------------\n";
+ //_CrtDumpMemoryLeaks();
+ //std::cin.get();
+
     return 0;
 }


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