|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r64516 - in sandbox/SOC/2010/bit_masks: boost/integer/detail/bitfield_vector lib/integer/test/bitfield_vector_testing
From: bbartmanboost_at_[hidden]
Date: 2010-08-01 08:05:02
Author: bbartman
Date: 2010-08-01 08:05:01 EDT (Sun, 01 Aug 2010)
New Revision: 64516
URL: http://svn.boost.org/trac/boost/changeset/64516
Log:
completed get_allocator testing
Text files modified:
sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/bitfield_vector_base.hpp | 3 ++-
sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_base_test.cpp | 15 +++++++++++++++
2 files changed, 17 insertions(+), 1 deletions(-)
Modified: sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/bitfield_vector_base.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/bitfield_vector_base.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/detail/bitfield_vector/bitfield_vector_base.hpp 2010-08-01 08:05:01 EDT (Sun, 01 Aug 2010)
@@ -95,11 +95,12 @@
}
-
+ /** Calles allocate unless n = 0. */
typename rebound_alloc_type::pointer allocate_impl(std::size_t n) {
return n != 0 ? _impl.allocate( n ): 0;
}
+ /** Calles deallocate unless ptr = 0. */
void
deallocate_impl(typename rebound_alloc_type::pointer ptr, std::size_t n) {
if(ptr) {
Modified: sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_base_test.cpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_base_test.cpp (original)
+++ sandbox/SOC/2010/bit_masks/lib/integer/test/bitfield_vector_testing/bitfield_vector_base_test.cpp 2010-08-01 08:05:01 EDT (Sun, 01 Aug 2010)
@@ -245,7 +245,22 @@
BOOST_TEST( allocate_called );
BOOST_TEST( deallocate_called );
reset_allocator_test_variables();
+ // testing for get alloc
{
+ // Allocator Constructor
+ alloc temp_alloc;
+ vector_base_type allocator_constructed(temp_alloc);
+ reset_allocator_test_variables();
+ alloc t = allocator_constructed.get_allocator();
+ BOOST_TEST( allocation_size == 0 );
+ BOOST_TEST( !allocator_copy_called );
+ BOOST_TEST( !default_constructor_called );
+ BOOST_TEST( copy_other_allocator_called );
+ BOOST_TEST( !destructor_called );
+ BOOST_TEST( ptr_deallocation_address == 0 );
+ BOOST_TEST( deallocation_size == 0 );
+ BOOST_TEST( !allocate_called );
+ BOOST_TEST( !deallocate_called );
}
return boost::report_errors();
}
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