|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53978 - sandbox/monotonic/libs/monotonic/test
From: christian.schladetsch_at_[hidden]
Date: 2009-06-16 04:37:37
Author: cschladetsch
Date: 2009-06-16 04:37:36 EDT (Tue, 16 Jun 2009)
New Revision: 53978
URL: http://svn.boost.org/trac/boost/changeset/53978
Log:
re-introduced test for allocation size of a vector
Text files modified:
sandbox/monotonic/libs/monotonic/test/basic_tests.cpp | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
Modified: sandbox/monotonic/libs/monotonic/test/basic_tests.cpp
==============================================================================
--- sandbox/monotonic/libs/monotonic/test/basic_tests.cpp (original)
+++ sandbox/monotonic/libs/monotonic/test/basic_tests.cpp 2009-06-16 04:37:36 EDT (Tue, 16 Jun 2009)
@@ -106,22 +106,19 @@
BOOST_AUTO_TEST_CASE(test_basic)
{
- monotonic::storage<> storage1;
- vector<int, monotonic::allocator<int> > v1(storage1);
+ monotonic::storage<> storage;
+ vector<int, monotonic::allocator<int> > v1(storage);
for(int i = 0; i < 100; ++i)
v1.push_back(i);
- size_t len = storage1.fixed_remaining();
- vector<int, monotonic::allocator<int> > copy(v1);
- size_t len2 = storage1.fixed_remaining();
+ vector<int, monotonic::allocator<int> > copy(storage);
+ size_t len = storage.fixed_remaining();
+ copy = v1;
+ size_t len2 = storage.fixed_remaining();
BOOST_CHECK(copy == v1);
- //BOOST_CHECK(len - len2 == 12 + 100*sizeof(int)); // 12 has no right being there, it is for the extra gunk in vector and is STL-impl-dependant
-
- // create the storage that will be used for the various monotonic containers.
- // while it is on the stack here, it could be on the heap as well.
- monotonic::storage<> storage;
+ BOOST_CHECK(len - len2 == 100*sizeof(int));
// create a list that uses inline, monotonically-increasing storage
list<int, monotonic::allocator<int> > list(storage);
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