Updated copyright
[libcds.git] / test / unit / striped-set / intrusive_cuckoo_set.cpp
index 8109719469d2b80015222a222a3ed4603edb04c5..7bed730b22d19e67ede13b882198af9ee5f9488d 100644 (file)
@@ -1,11 +1,11 @@
 /*
     This file is a part of libcds - Concurrent Data Structures library
 
-    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
 
     Source code repo: http://github.com/khizmax/libcds/
     Download: http://sourceforge.net/projects/libcds/files/
-    
+
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions are met:
 
@@ -25,7 +25,7 @@
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
     CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
 #include "test_intrusive_set.h"
@@ -42,71 +42,31 @@ namespace {
 
         typedef base_class::hash_int hash1;
 
-        struct hash2: private hash1
-        {
-            typedef hash1 base_class;
-
-            size_t operator()( int i ) const
-            {
-                size_t h = ~(base_class::operator()( i ));
-                return ~h + 0x9e3779b9 + (h << 6) + (h >> 2);
-            }
-            template <typename Item>
-            size_t operator()( const Item& i ) const
-            {
-                size_t h = ~(base_class::operator()( i ));
-                return ~h + 0x9e3779b9 + (h << 6) + (h >> 2);
-            }
-        };
-
-        struct disposer2
-        {
-            template <typename T>
-            void operator ()( T * p )
-            {
-                ++p->nEraseCount;
-            }
-        };
 
         template <typename Set>
-        void test( Set& s )
+        void test( Set& s, std::vector< typename Set::value_type >& data )
         {
             // Precondition: set is empty
             // Postcondition: set is empty
 
-            base_class::test_< Set::c_isSorted>( s );
-
-            ASSERT_TRUE( s.empty() );
-            ASSERT_CONTAINER_SIZE( s, 0 );
-
-            typedef typename Set::value_type value_type;
+            base_class::test_< Set::c_isSorted>( s, data );
 
-            std::vector< value_type > data;
-            std::vector< size_t> indices;
-            data.reserve( kSize );
-            indices.reserve( kSize );
-            size_t const nSetSize = kSize;
-            for ( size_t key = 0; key < kSize; ++key ) {
-                data.push_back( value_type( static_cast<int>(key) ) );
-                indices.push_back( key );
-            }
-            shuffle( indices.begin(), indices.end() );
+            size_t const nSetSize = base_class::kSize;
 
-            // clear_and_dispose
+            // clear
             for ( auto& i : data ) {
                 i.clear_stat();
-                ASSERT_TRUE( s.insert( i ) );
+                ASSERT_TRUE( s.insert( i ));
             }
-            ASSERT_FALSE( s.empty() );
+            ASSERT_FALSE( s.empty());
             ASSERT_CONTAINER_SIZE( s, nSetSize );
 
-            s.clear_and_dispose( disposer2());
+            s.clear();
 
-            ASSERT_TRUE( s.empty() );
+            ASSERT_TRUE( s.empty());
             ASSERT_CONTAINER_SIZE( s, 0 );
             for ( auto& i : data ) {
-                EXPECT_EQ( i.nDisposeCount, 0 );
-                EXPECT_EQ( i.nEraseCount, 1 );
+                EXPECT_EQ( i.nDisposeCount, 1u );
             }
 
         }
@@ -133,8 +93,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_vector_basehook_unordered )
@@ -149,8 +112,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s( 32, 4 );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s( 32, 4 );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_list_basehook_ordered_cmp )
@@ -166,10 +132,13 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        set_type s( 32, 6, 4 );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s( 32, 6, 4 );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_vector_basehook_ordered_cmp )
@@ -185,11 +154,14 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 , ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( ht );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( ht );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_list_basehook_ordered_less )
@@ -205,11 +177,14 @@ namespace {
                 ,ci::opt::less< less<item_type> >
                 , ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( 32, 6, 4, ht );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( 32, 6, 4, ht );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_vector_basehook_ordered_less )
@@ -225,11 +200,14 @@ namespace {
                 ,ci::opt::less< less<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_list_basehook_ordered_cmpmix )
@@ -246,11 +224,14 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( 32, 6, 0, std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( 32, 6, 0, std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_vector_basehook_ordered_cmpmix )
@@ -267,11 +248,14 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_list_basehook_ordered_stat )
@@ -289,10 +273,13 @@ namespace {
                 ,ci::opt::stat< ci::cuckoo::stat >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_vector_basehook_ordered_stat )
@@ -310,10 +297,13 @@ namespace {
                 ,ci::opt::stat< ci::cuckoo::stat >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_list_basehook_unordered_storehash )
@@ -321,7 +311,7 @@ namespace {
         typedef base_class::base_int_item< ci::cuckoo::node< ci::cuckoo::list, 2 >> item_type;
         struct set_traits: public ci::cuckoo::traits
         {
-            typedef ci::cuckoo::base_hook< 
+            typedef ci::cuckoo::base_hook<
                 ci::cuckoo::probeset_type< item_type::probeset_type >
                 ,ci::cuckoo::store_hash< item_type::hash_array_size >
             > hook;
@@ -332,8 +322,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_vector_basehook_unordered_storehash )
@@ -341,7 +334,7 @@ namespace {
         typedef base_class::base_int_item< ci::cuckoo::node< ci::cuckoo::vector<4>, 2 >> item_type;
         struct set_traits: public ci::cuckoo::traits
         {
-            typedef ci::cuckoo::base_hook< 
+            typedef ci::cuckoo::base_hook<
                 ci::cuckoo::probeset_type< item_type::probeset_type >
                 ,ci::cuckoo::store_hash< item_type::hash_array_size >
             > hook;
@@ -352,8 +345,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s( 32, 4 );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s( 32, 4 );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_list_basehook_ordered_storehash )
@@ -371,11 +367,14 @@ namespace {
                 ,cds::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( 32, 6, 0, std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( 32, 6, 0, std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_vector_basehook_ordered_storehash )
@@ -393,11 +392,14 @@ namespace {
                 ,cds::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( std::move( ht ));
+            test( s, data );
+        }
     }
 
 //************************************************************
@@ -415,8 +417,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_vector_memberhook_unordered )
@@ -424,7 +429,7 @@ namespace {
         typedef base_class::member_int_item< ci::cuckoo::node< ci::cuckoo::vector<4>, 0 >> item_type;
         struct set_traits: public ci::cuckoo::traits
         {
-            
+
             typedef ci::cuckoo::member_hook< offsetof( item_type, hMember ), ci::cuckoo::probeset_type< item_type::member_type::probeset_type >> hook;
             typedef cds::opt::hash_tuple< hash1, hash2 > hash;
             typedef base_class::equal_to<item_type> equal_to;
@@ -432,8 +437,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s( 32, 4 );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s( 32, 4 );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_list_memberhook_ordered_cmp )
@@ -449,10 +457,13 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        set_type s( 32, 6, 4 );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s( 32, 6, 4 );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_vector_memberhook_ordered_cmp )
@@ -468,11 +479,14 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 , ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( ht );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( ht );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_list_memberhook_ordered_less )
@@ -488,11 +502,14 @@ namespace {
                 ,ci::opt::less< less<item_type> >
                 , ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( 32, 6, 4, ht );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( 32, 6, 4, ht );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_vector_memberhook_ordered_less )
@@ -508,11 +525,14 @@ namespace {
                 ,ci::opt::less< less<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_list_memberhook_ordered_cmpmix )
@@ -529,11 +549,14 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( 32, 6, 0, std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( 32, 6, 0, std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_vector_memberhook_ordered_cmpmix )
@@ -550,11 +573,14 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_list_memberhook_ordered_stat )
@@ -572,10 +598,13 @@ namespace {
                 ,ci::opt::stat< ci::cuckoo::stat >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_vector_memberhook_ordered_stat )
@@ -593,10 +622,13 @@ namespace {
                 ,ci::opt::stat< ci::cuckoo::stat >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_list_memberhook_unordered_storehash )
@@ -615,8 +647,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_vector_memberhook_unordered_storehash )
@@ -635,8 +670,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s( 32, 4 );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s( 32, 4 );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_list_memberhook_ordered_storehash )
@@ -654,11 +692,14 @@ namespace {
                 ,cds::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( 32, 6, 0, std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( 32, 6, 0, std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, striped_vector_memberhook_ordered_storehash )
@@ -676,11 +717,14 @@ namespace {
                 ,cds::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( std::move( ht ));
+            test( s, data );
+        }
     }
 
 //************************************************************
@@ -698,8 +742,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_vector_basehook_unordered )
@@ -715,8 +762,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s( 32, 4 );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s( 32, 4 );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_list_basehook_ordered_cmp )
@@ -733,10 +783,13 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        set_type s( 32, 6, 4 );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s( 32, 6, 4 );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_vector_basehook_ordered_cmp )
@@ -753,11 +806,14 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 , ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( ht );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( ht );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_list_basehook_ordered_less )
@@ -774,11 +830,14 @@ namespace {
                 ,ci::opt::less< less<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( 32, 6, 4, ht );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( 32, 6, 4, ht );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_vector_basehook_ordered_less )
@@ -795,11 +854,14 @@ namespace {
                 ,ci::opt::less< less<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_list_basehook_ordered_cmpmix )
@@ -817,11 +879,14 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( 32, 6, 0, std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( 32, 6, 0, std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_vector_basehook_ordered_cmpmix )
@@ -839,11 +904,14 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_list_basehook_ordered_stat )
@@ -862,10 +930,13 @@ namespace {
                 ,ci::opt::stat< ci::cuckoo::stat >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_vector_basehook_ordered_stat )
@@ -884,10 +955,13 @@ namespace {
                 ,ci::opt::stat< ci::cuckoo::stat >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_list_basehook_unordered_storehash )
@@ -895,7 +969,7 @@ namespace {
         typedef base_class::base_int_item< ci::cuckoo::node< ci::cuckoo::list, 2 >> item_type;
         struct set_traits: public ci::cuckoo::traits
         {
-            typedef ci::cuckoo::base_hook< 
+            typedef ci::cuckoo::base_hook<
                 ci::cuckoo::probeset_type< item_type::probeset_type >
                 ,ci::cuckoo::store_hash< item_type::hash_array_size >
             > hook;
@@ -907,8 +981,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_vector_basehook_unordered_storehash )
@@ -916,7 +993,7 @@ namespace {
         typedef base_class::base_int_item< ci::cuckoo::node< ci::cuckoo::vector<4>, 2 >> item_type;
         struct set_traits: public ci::cuckoo::traits
         {
-            typedef ci::cuckoo::base_hook< 
+            typedef ci::cuckoo::base_hook<
                 ci::cuckoo::probeset_type< item_type::probeset_type >
                 ,ci::cuckoo::store_hash< item_type::hash_array_size >
             > hook;
@@ -928,8 +1005,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s( 32, 4 );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s( 32, 4 );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_list_basehook_ordered_storehash )
@@ -948,11 +1028,14 @@ namespace {
                 ,cds::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( 32, 6, 0, std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( 32, 6, 0, std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_vector_basehook_ordered_storehash )
@@ -971,11 +1054,14 @@ namespace {
                 ,cds::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( std::move( ht ));
+            test( s, data );
+        }
     }
 
 //************************************************************
@@ -994,8 +1080,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_vector_memberhook_unordered )
@@ -1003,7 +1092,7 @@ namespace {
         typedef base_class::member_int_item< ci::cuckoo::node< ci::cuckoo::vector<4>, 0 >> item_type;
         struct set_traits: public ci::cuckoo::traits
         {
-            
+
             typedef ci::cuckoo::member_hook< offsetof( item_type, hMember ), ci::cuckoo::probeset_type< item_type::member_type::probeset_type >> hook;
             typedef ci::cuckoo::refinable<> mutex_policy;
             typedef cds::opt::hash_tuple< hash1, hash2 > hash;
@@ -1012,8 +1101,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s( 32, 4 );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s( 32, 4 );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_list_memberhook_ordered_cmp )
@@ -1030,10 +1122,13 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        set_type s( 32, 6, 4 );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s( 32, 6, 4 );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_vector_memberhook_ordered_cmp )
@@ -1050,11 +1145,14 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( ht );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( ht );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_list_memberhook_ordered_less )
@@ -1071,11 +1169,14 @@ namespace {
                 ,ci::opt::less< less<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( 32, 6, 4, ht );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( 32, 6, 4, ht );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_vector_memberhook_ordered_less )
@@ -1092,11 +1193,14 @@ namespace {
                 ,ci::opt::less< less<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_list_memberhook_ordered_cmpmix )
@@ -1114,11 +1218,14 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( 32, 6, 0, std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( 32, 6, 0, std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_vector_memberhook_ordered_cmpmix )
@@ -1136,11 +1243,14 @@ namespace {
                 ,ci::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_list_memberhook_ordered_stat )
@@ -1159,10 +1269,13 @@ namespace {
                 ,ci::opt::stat< ci::cuckoo::stat >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_vector_memberhook_ordered_stat )
@@ -1181,10 +1294,13 @@ namespace {
                 ,ci::opt::stat< ci::cuckoo::stat >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_list_memberhook_unordered_storehash )
@@ -1204,8 +1320,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s;
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s;
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_vector_memberhook_unordered_storehash )
@@ -1225,8 +1344,11 @@ namespace {
         };
         typedef ci::CuckooSet< item_type, set_traits > set_type;
 
-        set_type s( 32, 4 );
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            set_type s( 32, 4 );
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_list_memberhook_ordered_storehash )
@@ -1245,11 +1367,14 @@ namespace {
                 ,cds::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( 32, 6, 0, std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( 32, 6, 0, std::move( ht ));
+            test( s, data );
+        }
     }
 
     TEST_F( IntrusiveCuckooSet, refinable_vector_memberhook_ordered_storehash )
@@ -1268,11 +1393,14 @@ namespace {
                 ,cds::opt::compare< cmp<item_type> >
                 ,ci::opt::disposer< mock_disposer >
             >::type
-        > set_type; 
+        > set_type;
 
-        typename set_type::hash_tuple_type ht;
-        set_type s( std::move( ht ));
-        test( s );
+        std::vector< typename set_type::value_type > data;
+        {
+            typename set_type::hash_tuple_type ht;
+            set_type s( std::move( ht ));
+            test( s, data );
+        }
     }
 
 } // namespace