Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85437 - in branches/release: boost/heap boost/heap/detail libs/heap libs/heap/test
From: tim_at_[hidden]
Date: 2013-08-23 14:01:11


Author: timblechmann
Date: 2013-08-23 14:01:11 EDT (Fri, 23 Aug 2013)
New Revision: 85437
URL: http://svn.boost.org/trac/boost/changeset/85437

Log:
heap: merge fixes from trunk

Properties modified:
   branches/release/boost/heap/ (props changed)
   branches/release/libs/heap/ (props changed)
Text files modified:
   branches/release/boost/heap/detail/heap_node.hpp | 1 +
   branches/release/libs/heap/test/binomial_heap_test.cpp | 6 ++++++
   branches/release/libs/heap/test/common_heap_tests.hpp | 9 +++++++++
   branches/release/libs/heap/test/d_ary_heap_test.cpp | 7 +++++++
   branches/release/libs/heap/test/fibonacci_heap_test.cpp | 7 +++++++
   branches/release/libs/heap/test/pairing_heap_tests.cpp | 7 +++++++
   branches/release/libs/heap/test/priority_queue_test.cpp | 6 ++++++
   branches/release/libs/heap/test/skew_heap_test.cpp | 7 +++++++
   8 files changed, 50 insertions(+), 0 deletions(-)

Modified: branches/release/boost/heap/detail/heap_node.hpp
==============================================================================
--- branches/release/boost/heap/detail/heap_node.hpp Fri Aug 23 11:29:00 2013 (r85436)
+++ branches/release/boost/heap/detail/heap_node.hpp 2013-08-23 14:01:11 EDT (Fri, 23 Aug 2013) (r85437)
@@ -142,6 +142,7 @@
     {
         node_pointer n = static_cast<node_pointer>(base);
         n->clear_subtree(alloc_);
+ alloc_.destroy(n);
         alloc_.deallocate(n, 1);
     }
 

Modified: branches/release/libs/heap/test/binomial_heap_test.cpp
==============================================================================
--- branches/release/libs/heap/test/binomial_heap_test.cpp Fri Aug 23 11:29:00 2013 (r85436)
+++ branches/release/libs/heap/test/binomial_heap_test.cpp 2013-08-23 14:01:11 EDT (Fri, 23 Aug 2013) (r85437)
@@ -68,3 +68,9 @@
                                        boost::heap::allocator<std::allocator<int> > > pri_queue;
     run_common_heap_tests<pri_queue>();
 }
+
+BOOST_AUTO_TEST_CASE( binomial_heap_leak_test )
+{
+ typedef boost::heap::binomial_heap<boost::shared_ptr<int> > pri_queue;
+ run_leak_check_test<pri_queue>();
+}

Modified: branches/release/libs/heap/test/common_heap_tests.hpp
==============================================================================
--- branches/release/libs/heap/test/common_heap_tests.hpp Fri Aug 23 11:29:00 2013 (r85436)
+++ branches/release/libs/heap/test/common_heap_tests.hpp 2013-08-23 14:01:11 EDT (Fri, 23 Aug 2013) (r85437)
@@ -14,6 +14,7 @@
 
 #include <boost/concept/assert.hpp>
 #include <boost/concept_archetype.hpp>
+#include <boost/shared_ptr.hpp>
 
 #include <boost/heap/heap_concepts.hpp>
 
@@ -440,6 +441,14 @@
     check_q(q, data);
 }
 
+template <typename pri_queue>
+void run_leak_check_test(void)
+{
+ pri_queue q;
+ q.push(boost::shared_ptr<int>(new int(0)));
+}
+
+
 struct less_with_T
 {
     typedef int T;

Modified: branches/release/libs/heap/test/d_ary_heap_test.cpp
==============================================================================
--- branches/release/libs/heap/test/d_ary_heap_test.cpp Fri Aug 23 11:29:00 2013 (r85436)
+++ branches/release/libs/heap/test/d_ary_heap_test.cpp 2013-08-23 14:01:11 EDT (Fri, 23 Aug 2013) (r85437)
@@ -126,3 +126,10 @@
                                     boost::heap::allocator<std::allocator<int> > > pri_queue;
     run_common_heap_tests<pri_queue>();
 }
+
+
+BOOST_AUTO_TEST_CASE( d_ary_heap_leak_test )
+{
+ typedef boost::heap::d_ary_heap<boost::shared_ptr<int>, boost::heap::arity<2> > pri_queue;
+ run_leak_check_test<pri_queue>();
+}

Modified: branches/release/libs/heap/test/fibonacci_heap_test.cpp
==============================================================================
--- branches/release/libs/heap/test/fibonacci_heap_test.cpp Fri Aug 23 11:29:00 2013 (r85436)
+++ branches/release/libs/heap/test/fibonacci_heap_test.cpp 2013-08-23 14:01:11 EDT (Fri, 23 Aug 2013) (r85437)
@@ -73,3 +73,10 @@
                                        boost::heap::allocator<std::allocator<int> > > pri_queue;
     run_common_heap_tests<pri_queue>();
 }
+
+
+BOOST_AUTO_TEST_CASE( fibonacci_heap_leak_test )
+{
+ typedef boost::heap::fibonacci_heap<boost::shared_ptr<int> > pri_queue;
+ run_leak_check_test<pri_queue>();
+}

Modified: branches/release/libs/heap/test/pairing_heap_tests.cpp
==============================================================================
--- branches/release/libs/heap/test/pairing_heap_tests.cpp Fri Aug 23 11:29:00 2013 (r85436)
+++ branches/release/libs/heap/test/pairing_heap_tests.cpp 2013-08-23 14:01:11 EDT (Fri, 23 Aug 2013) (r85437)
@@ -70,3 +70,10 @@
                                       boost::heap::allocator<std::allocator<int> > > pri_queue;
     run_common_heap_tests<pri_queue>();
 }
+
+
+BOOST_AUTO_TEST_CASE( pairing_heap_leak_test )
+{
+ typedef boost::heap::pairing_heap<boost::shared_ptr<int> > pri_queue;
+ run_leak_check_test<pri_queue>();
+}

Modified: branches/release/libs/heap/test/priority_queue_test.cpp
==============================================================================
--- branches/release/libs/heap/test/priority_queue_test.cpp Fri Aug 23 11:29:00 2013 (r85436)
+++ branches/release/libs/heap/test/priority_queue_test.cpp 2013-08-23 14:01:11 EDT (Fri, 23 Aug 2013) (r85437)
@@ -41,3 +41,9 @@
     run_common_priority_queue_tests<false>();
     run_common_priority_queue_tests<true>();
 }
+
+BOOST_AUTO_TEST_CASE( std_pri_queue_leak_test )
+{
+ typedef boost::heap::priority_queue<boost::shared_ptr<int> > pri_queue;
+ run_leak_check_test<pri_queue>();
+}

Modified: branches/release/libs/heap/test/skew_heap_test.cpp
==============================================================================
--- branches/release/libs/heap/test/skew_heap_test.cpp Fri Aug 23 11:29:00 2013 (r85436)
+++ branches/release/libs/heap/test/skew_heap_test.cpp 2013-08-23 14:01:11 EDT (Fri, 23 Aug 2013) (r85437)
@@ -116,3 +116,10 @@
                                    boost::heap::allocator<std::allocator<int> > > pri_queue;
     run_common_heap_tests<pri_queue>();
 }
+
+
+BOOST_AUTO_TEST_CASE( skew_heap_leak_test )
+{
+ typedef boost::heap::skew_heap<boost::shared_ptr<int> > pri_queue;
+ run_leak_check_test<pri_queue>();
+}


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