|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r81517 - in trunk/libs/intrusive: doc test
From: igaztanaga_at_[hidden]
Date: 2012-11-24 16:06:49
Author: igaztanaga
Date: 2012-11-24 16:06:48 EST (Sat, 24 Nov 2012)
New Revision: 81517
URL: http://svn.boost.org/trac/boost/changeset/81517
Log:
* Fixed GCC -Wshadow warnings.
* Added missing `explicit` keyword in several intrusive container constructors.
* Replaced deprecated BOOST_NO_XXXX with newer BOOST_NO_CXX11_XXX macros.
Text files modified:
trunk/libs/intrusive/doc/intrusive.qbk | 10 +
trunk/libs/intrusive/test/generic_assoc_test.hpp | 10 +
trunk/libs/intrusive/test/generic_multiset_test.hpp | 2
trunk/libs/intrusive/test/generic_set_test.hpp | 2
trunk/libs/intrusive/test/pointer_traits_test.cpp | 2
trunk/libs/intrusive/test/stateful_value_traits_test.cpp | 4
trunk/libs/intrusive/test/test_container.hpp | 18 ++-
trunk/libs/intrusive/test/unordered_multiset_test.cpp | 214 ++++++++++++++++++++-------------------
8 files changed, 139 insertions(+), 123 deletions(-)
Modified: trunk/libs/intrusive/doc/intrusive.qbk
==============================================================================
--- trunk/libs/intrusive/doc/intrusive.qbk (original)
+++ trunk/libs/intrusive/doc/intrusive.qbk 2012-11-24 16:06:48 EST (Sat, 24 Nov 2012)
@@ -6,7 +6,7 @@
/]
[library Boost.Intrusive
- [quickbook 1.4]
+ [quickbook 1.5]
[authors [Krzikalla, Olaf], [Gaztanaga, Ion]]
[copyright 2005 Olaf Krzikalla, 2006-2012 Ion Gaztanaga]
[id intrusive]
@@ -3829,6 +3829,14 @@
[section:release_notes Release Notes]
+[section:release_notes_boost_1_53_00 Boost 1.53 Release]
+
+* Fixed GCC -Wshadow warnings.
+* Added missing `explicit` keyword in several intrusive container constructors.
+* Replaced deprecated BOOST_NO_XXXX with newer BOOST_NO_CXX11_XXX macros.
+
+[endsect]
+
[section:release_notes_boost_1_51_00 Boost 1.51 Release]
* Fixed bugs
Modified: trunk/libs/intrusive/test/generic_assoc_test.hpp
==============================================================================
--- trunk/libs/intrusive/test/generic_assoc_test.hpp (original)
+++ trunk/libs/intrusive/test/generic_assoc_test.hpp 2012-11-24 16:06:48 EST (Sat, 24 Nov 2012)
@@ -145,10 +145,12 @@
TEST_INTRUSIVE_SEQUENCE_EXPECTED(testset, testset.begin());
//Ordered erasure
- iterator it(testset.begin()), itend(testset.end());
- for(int i = 0; it != itend; ++i){
- BOOST_TEST(&*it == &values[i]);
- it = testset.erase(it);
+ {
+ iterator it(testset.begin()), itend(testset.end());
+ for(int i = 0; it != itend; ++i){
+ BOOST_TEST(&*it == &values[i]);
+ it = testset.erase(it);
+ }
}
BOOST_TEST(testset.empty());
Modified: trunk/libs/intrusive/test/generic_multiset_test.hpp
==============================================================================
--- trunk/libs/intrusive/test/generic_multiset_test.hpp (original)
+++ trunk/libs/intrusive/test/generic_multiset_test.hpp 2012-11-24 16:06:48 EST (Sat, 24 Nov 2012)
@@ -233,7 +233,7 @@
cmp_val_lower.value_ = 1;
cmp_val_upper.value_ = 2;
//left-closed, right-closed
- std::pair<iterator,iterator> range = testset.bounded_range (cmp_val_lower, cmp_val_upper, true, true);
+ range = testset.bounded_range (cmp_val_lower, cmp_val_upper, true, true);
BOOST_TEST (range.first->value_ == 1);
BOOST_TEST (range.second->value_ == 3);
BOOST_TEST (std::distance (range.first, range.second) == 3);
Modified: trunk/libs/intrusive/test/generic_set_test.hpp
==============================================================================
--- trunk/libs/intrusive/test/generic_set_test.hpp (original)
+++ trunk/libs/intrusive/test/generic_set_test.hpp 2012-11-24 16:06:48 EST (Sat, 24 Nov 2012)
@@ -305,7 +305,7 @@
cmp_val_lower.value_ = 1;
cmp_val_upper.value_ = 2;
//left-closed, right-closed
- std::pair<iterator,iterator> range = testset.bounded_range (cmp_val_lower, cmp_val_upper, true, true);
+ range = testset.bounded_range (cmp_val_lower, cmp_val_upper, true, true);
BOOST_TEST (range.first->value_ == 1);
BOOST_TEST (range.second->value_ == 3);
BOOST_TEST (std::distance (range.first, range.second) == 2);
Modified: trunk/libs/intrusive/test/pointer_traits_test.cpp
==============================================================================
--- trunk/libs/intrusive/test/pointer_traits_test.cpp (original)
+++ trunk/libs/intrusive/test/pointer_traits_test.cpp 2012-11-24 16:06:48 EST (Sat, 24 Nov 2012)
@@ -20,7 +20,7 @@
public:
- #if !defined(BOOST_NO_TEMPLATE_ALIASES)
+ #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
template <class U> using rebind = CompleteSmartPtr<U>;
#else
template <class U> struct rebind
Modified: trunk/libs/intrusive/test/stateful_value_traits_test.cpp
==============================================================================
--- trunk/libs/intrusive/test/stateful_value_traits_test.cpp (original)
+++ trunk/libs/intrusive/test/stateful_value_traits_test.cpp 2012-11-24 16:06:48 EST (Sat, 24 Nov 2012)
@@ -53,8 +53,8 @@
static const link_mode_type link_mode = normal_link;
- stateful_value_traits(pointer values, node_ptr node_array)
- : values_(values), node_array_(node_array)
+ stateful_value_traits(pointer vals, node_ptr node_array)
+ : values_(vals), node_array_(node_array)
{}
node_ptr to_node_ptr (value_type &value)
Modified: trunk/libs/intrusive/test/test_container.hpp
==============================================================================
--- trunk/libs/intrusive/test/test_container.hpp (original)
+++ trunk/libs/intrusive/test/test_container.hpp 2012-11-24 16:06:48 EST (Sat, 24 Nov 2012)
@@ -111,9 +111,9 @@
BOOST_TEST( !c.empty() );
{
- typename Data::iterator i = d.begin();
- ++++i;
- c.insert( c.begin(), *(i) );
+ typename Data::iterator di = d.begin();
+ ++++di;
+ c.insert( c.begin(), *(di) );
}
i = c.erase( c.begin(), c.end() );
@@ -361,10 +361,14 @@
std::pair<const_iterator, const_iterator> er = c.equal_range(*di);
size_type cnt = std::distance(er.first, er.second);
BOOST_TEST( cnt == c.count(*di));
- if(cnt > 1)
- for(const_iterator n = er.first, i = n++, e = er.second; n != e; ++i, ++n){
- BOOST_TEST( c.key_eq()(*i, *n) );
- BOOST_TEST( c.hash_function()(*i) == c.hash_function()(*n) );
+ if(cnt > 1){
+ const_iterator n = er.first;
+ i = n++;
+ const_iterator e = er.second;
+ for(; n != e; ++i, ++n){
+ BOOST_TEST( c.key_eq()(*i, *n) );
+ BOOST_TEST( c.hash_function()(*i) == c.hash_function()(*n) );
+ }
}
}
Modified: trunk/libs/intrusive/test/unordered_multiset_test.cpp
==============================================================================
--- trunk/libs/intrusive/test/unordered_multiset_test.cpp (original)
+++ trunk/libs/intrusive/test/unordered_multiset_test.cpp 2012-11-24 16:06:48 EST (Sat, 24 Nov 2012)
@@ -212,118 +212,120 @@
> unordered_multiset_type;
typedef typename unordered_multiset_type::bucket_traits bucket_traits;
typedef typename unordered_multiset_type::iterator iterator;
- typename unordered_multiset_type::bucket_type buckets [BucketSize];
- unordered_multiset_type testset(bucket_traits(
- pointer_traits<typename unordered_multiset_type::bucket_ptr>::
- pointer_to(buckets[0]), BucketSize));
-
- testset.insert(&values[0] + 2, &values[0] + 5);
-
- const unordered_multiset_type& const_testset = testset;
-
- if(Incremental){
- {
- { int init_values [] = { 4, 5, 1 };
- TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
-
- typename unordered_multiset_type::iterator i = testset.begin();
- BOOST_TEST (i->value_ == 4);
+ {
+ typename unordered_multiset_type::bucket_type buckets [BucketSize];
+ unordered_multiset_type testset(bucket_traits(
+ pointer_traits<typename unordered_multiset_type::bucket_ptr>::
+ pointer_to(buckets[0]), BucketSize));
- i = testset.insert (values[0]);
- BOOST_TEST (&*i == &values[0]);
+ testset.insert(&values[0] + 2, &values[0] + 5);
- i = testset.iterator_to (values[2]);
- BOOST_TEST (&*i == &values[2]);
- testset.erase(i);
-
- { int init_values [] = { 5, 1, 3 };
- TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
- testset.clear();
- testset.insert(&values[0], &values[0] + values.size());
-
- { int init_values [] = { 4, 5, 1, 2, 2, 3 };
- TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
-
- BOOST_TEST (testset.erase(1) == 1);
- BOOST_TEST (testset.erase(2) == 2);
- BOOST_TEST (testset.erase(3) == 1);
- BOOST_TEST (testset.erase(4) == 1);
- BOOST_TEST (testset.erase(5) == 1);
- BOOST_TEST (testset.empty() == true);
+ const unordered_multiset_type& const_testset = testset;
- //Now with a single bucket
- typename unordered_multiset_type::bucket_type single_bucket[1];
- unordered_multiset_type testset2(bucket_traits(
- pointer_traits<typename unordered_multiset_type::bucket_ptr>::
- pointer_to(single_bucket[0]), 1));
- testset2.insert(&values[0], &values[0] + values.size());
- BOOST_TEST (testset2.erase(5) == 1);
- BOOST_TEST (testset2.erase(2) == 2);
- BOOST_TEST (testset2.erase(1) == 1);
- BOOST_TEST (testset2.erase(4) == 1);
- BOOST_TEST (testset2.erase(3) == 1);
- BOOST_TEST (testset2.empty() == true);
+ if(Incremental){
+ {
+ { int init_values [] = { 4, 5, 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+
+ typename unordered_multiset_type::iterator i = testset.begin();
+ BOOST_TEST (i->value_ == 4);
+
+ i = testset.insert (values[0]);
+ BOOST_TEST (&*i == &values[0]);
+
+ i = testset.iterator_to (values[2]);
+ BOOST_TEST (&*i == &values[2]);
+ testset.erase(i);
+
+ { int init_values [] = { 5, 1, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+ testset.clear();
+ testset.insert(&values[0], &values[0] + values.size());
+
+ { int init_values [] = { 4, 5, 1, 2, 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+
+ BOOST_TEST (testset.erase(1) == 1);
+ BOOST_TEST (testset.erase(2) == 2);
+ BOOST_TEST (testset.erase(3) == 1);
+ BOOST_TEST (testset.erase(4) == 1);
+ BOOST_TEST (testset.erase(5) == 1);
+ BOOST_TEST (testset.empty() == true);
+
+ //Now with a single bucket
+ typename unordered_multiset_type::bucket_type single_bucket[1];
+ unordered_multiset_type testset2(bucket_traits(
+ pointer_traits<typename unordered_multiset_type::bucket_ptr>::
+ pointer_to(single_bucket[0]), 1));
+ testset2.insert(&values[0], &values[0] + values.size());
+ BOOST_TEST (testset2.erase(5) == 1);
+ BOOST_TEST (testset2.erase(2) == 2);
+ BOOST_TEST (testset2.erase(1) == 1);
+ BOOST_TEST (testset2.erase(4) == 1);
+ BOOST_TEST (testset2.erase(3) == 1);
+ BOOST_TEST (testset2.empty() == true);
+ }
+ }
+ else{
+ {
+ { int init_values [] = { 1, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+
+ typename unordered_multiset_type::iterator i = testset.begin();
+ BOOST_TEST (i->value_ == 1);
+
+ i = testset.insert (values[0]);
+ BOOST_TEST (&*i == &values[0]);
+
+ i = testset.iterator_to (values[2]);
+ BOOST_TEST (&*i == &values[2]);
+ testset.erase(i);
+
+ { int init_values [] = { 1, 3, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+ testset.clear();
+ testset.insert(&values[0], &values[0] + values.size());
+
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+
+ BOOST_TEST (testset.erase(1) == 1);
+ BOOST_TEST (testset.erase(2) == 2);
+ BOOST_TEST (testset.erase(3) == 1);
+ BOOST_TEST (testset.erase(4) == 1);
+ BOOST_TEST (testset.erase(5) == 1);
+ BOOST_TEST (testset.empty() == true);
+
+ //Now with a single bucket
+ typename unordered_multiset_type::bucket_type single_bucket[1];
+ unordered_multiset_type testset2(bucket_traits(
+ pointer_traits<typename unordered_multiset_type::bucket_ptr>::
+ pointer_to(single_bucket[0]), 1));
+ testset2.insert(&values[0], &values[0] + values.size());
+ BOOST_TEST (testset2.erase(5) == 1);
+ BOOST_TEST (testset2.erase(2) == 2);
+ BOOST_TEST (testset2.erase(1) == 1);
+ BOOST_TEST (testset2.erase(4) == 1);
+ BOOST_TEST (testset2.erase(3) == 1);
+ BOOST_TEST (testset2.empty() == true);
+ }
}
- }
- else{
{
- { int init_values [] = { 1, 4, 5 };
- TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
-
- typename unordered_multiset_type::iterator i = testset.begin();
- BOOST_TEST (i->value_ == 1);
-
- i = testset.insert (values[0]);
- BOOST_TEST (&*i == &values[0]);
-
- i = testset.iterator_to (values[2]);
- BOOST_TEST (&*i == &values[2]);
- testset.erase(i);
-
- { int init_values [] = { 1, 3, 5 };
- TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
- testset.clear();
- testset.insert(&values[0], &values[0] + values.size());
-
- { int init_values [] = { 1, 2, 2, 3, 4, 5 };
- TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
-
- BOOST_TEST (testset.erase(1) == 1);
- BOOST_TEST (testset.erase(2) == 2);
- BOOST_TEST (testset.erase(3) == 1);
- BOOST_TEST (testset.erase(4) == 1);
- BOOST_TEST (testset.erase(5) == 1);
- BOOST_TEST (testset.empty() == true);
-
- //Now with a single bucket
+ //Now erase just one per loop
+ const int random_init[] = { 3, 2, 4, 1, 5, 2, 2 };
+ const unsigned int random_size = sizeof(random_init)/sizeof(random_init[0]);
typename unordered_multiset_type::bucket_type single_bucket[1];
- unordered_multiset_type testset2(bucket_traits(
- pointer_traits<typename unordered_multiset_type::bucket_ptr>::
- pointer_to(single_bucket[0]), 1));
- testset2.insert(&values[0], &values[0] + values.size());
- BOOST_TEST (testset2.erase(5) == 1);
- BOOST_TEST (testset2.erase(2) == 2);
- BOOST_TEST (testset2.erase(1) == 1);
- BOOST_TEST (testset2.erase(4) == 1);
- BOOST_TEST (testset2.erase(3) == 1);
- BOOST_TEST (testset2.empty() == true);
- }
- }
- {
- //Now erase just one per loop
- const int random_init[] = { 3, 2, 4, 1, 5, 2, 2 };
- const unsigned int random_size = sizeof(random_init)/sizeof(random_init[0]);
- typename unordered_multiset_type::bucket_type single_bucket[1];
- for(unsigned int i = 0, max = random_size; i != max; ++i){
- std::vector<typename ValueTraits::value_type> data (random_size);
- for (unsigned int j = 0; j < random_size; ++j)
- data[j].value_ = random_init[j];
- unordered_multiset_type testset_new(bucket_traits(
- pointer_traits<typename unordered_multiset_type::bucket_ptr>::
- pointer_to(single_bucket[0]), 1));
- testset_new.insert(&data[0], &data[0]+max);
- testset_new.erase(testset_new.iterator_to(data[i]));
- BOOST_TEST (testset_new.size() == (max -1));
+ for(unsigned int i = 0, max = random_size; i != max; ++i){
+ std::vector<typename ValueTraits::value_type> data (random_size);
+ for (unsigned int j = 0; j < random_size; ++j)
+ data[j].value_ = random_init[j];
+ unordered_multiset_type testset_new(bucket_traits(
+ pointer_traits<typename unordered_multiset_type::bucket_ptr>::
+ pointer_to(single_bucket[0]), 1));
+ testset_new.insert(&data[0], &data[0]+max);
+ testset_new.erase(testset_new.iterator_to(data[i]));
+ BOOST_TEST (testset_new.size() == (max -1));
+ }
}
}
{
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