intrusive::SplitListSet refactoring
[libcds.git] / tests / test-hdr / set / hdr_intrusive_splitlist_set_rcu_gpi_lazy.cpp
index d3641a246d157e8c832ae0d9e0d8a51b6b986186..186f4290cdd817eb823f03b854256104afbfef54 100644 (file)
@@ -29,7 +29,7 @@ namespace set {
                 ,co::memory_model<co::v::relaxed_ordering>
             >::type
         > set;
-        static_assert( set::options::dynamic_bucket_table, "Set has static bucket table" );
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
 
         test_rcu_int<set>();
     }
@@ -52,7 +52,7 @@ namespace set {
                 ,co::memory_model<co::v::sequential_consistent>
             >::type
         > set;
-        static_assert( set::options::dynamic_bucket_table, "Set has static bucket table" );
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
 
         test_rcu_int<set>();
     }
@@ -77,7 +77,7 @@ namespace set {
                 ,ci::split_list::dynamic_bucket_table<true>
             >::type
         > set;
-        static_assert( set::options::dynamic_bucket_table, "Set has static bucket table" );
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
 
         test_rcu_int<set>();
     }
@@ -103,7 +103,7 @@ namespace set {
                 ,co::memory_model<co::v::relaxed_ordering>
             >::type
         > set;
-        static_assert( set::options::dynamic_bucket_table, "Set has static bucket table" );
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
 
         test_rcu_int<set>();
     }
@@ -129,7 +129,7 @@ namespace set {
                 ,co::memory_model<co::v::sequential_consistent>
             >::type
         > set;
-        static_assert( set::options::dynamic_bucket_table, "Set has static bucket table" );
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
 
         test_rcu_int<set>();
     }
@@ -156,7 +156,7 @@ namespace set {
                 ,co::item_counter< simple_item_counter >
             >::type
         > set;
-        static_assert( set::options::dynamic_bucket_table, "Set has static bucket table" );
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
 
         test_rcu_int<set>();
     }
@@ -182,7 +182,7 @@ namespace set {
                 ,co::memory_model<co::v::relaxed_ordering>
             >::type
         > set;
-        static_assert( !set::options::dynamic_bucket_table, "Set has dynamic bucket table" );
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
 
         test_rcu_int<set>();
     }
@@ -206,7 +206,7 @@ namespace set {
                 ,co::memory_model<co::v::sequential_consistent>
             >::type
         > set;
-        static_assert( !set::options::dynamic_bucket_table, "Set has dynamic bucket table" );
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
 
         test_rcu_int<set>();
     }
@@ -231,7 +231,7 @@ namespace set {
                 ,ci::split_list::dynamic_bucket_table<false>
             >::type
         > set;
-        static_assert( !set::options::dynamic_bucket_table, "Set has dynamic bucket table" );
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
 
         test_rcu_int<set>();
     }
@@ -258,7 +258,7 @@ namespace set {
                 ,co::memory_model<co::v::relaxed_ordering>
             >::type
         > set;
-        static_assert( !set::options::dynamic_bucket_table, "Set has dynamic bucket table" );
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
 
         test_rcu_int<set>();
     }
@@ -285,7 +285,7 @@ namespace set {
                 ,co::memory_model<co::v::sequential_consistent>
             >::type
         > set;
-        static_assert( !set::options::dynamic_bucket_table, "Set has dynamic bucket table" );
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
 
         test_rcu_int<set>();
     }
@@ -313,10 +313,119 @@ namespace set {
                 ,ci::split_list::dynamic_bucket_table<false>
             >::type
         > set;
-        static_assert( !set::options::dynamic_bucket_table, "Set has dynamic bucket table" );
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
 
         test_rcu_int<set>();
     }
 
+    void IntrusiveHashSetHdrTest::split_dyn_RCU_GPI_base_cmpmix_stat_lazy()
+    {
+        typedef base_int_item< ci::split_list::node<ci::lazy_list::node<rcu_type> > > item;
+        struct list_traits : public ci::lazy_list::traits
+        {
+            typedef ci::lazy_list::base_hook< co::gc<rcu_type> > hook;
+            typedef IntrusiveHashSetHdrTest::less< item > less;
+            typedef cmp<item> compare;
+            typedef faked_disposer disposer;
+        };
+        typedef ci::LazyList< rcu_type, item, list_traits > ord_list;
+
+        struct set_traits : public ci::split_list::make_traits<ci::split_list::dynamic_bucket_table<true>>::type
+        {
+            typedef hash_int hash;
+            typedef simple_item_counter item_counter;
+            typedef ci::split_list::stat<> stat;
+        };
+        typedef ci::SplitListSet< rcu_type, ord_list, set_traits > set;
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
+
+        test_rcu_int<set>();
+    }
+
+    void IntrusiveHashSetHdrTest::split_dyn_RCU_GPI_member_cmpmix_stat_lazy()
+    {
+        typedef member_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
+        struct list_traits :
+            public ci::lazy_list::make_traits<
+                ci::opt::hook< ci::lazy_list::member_hook<
+                    offsetof( item, hMember ),
+                    co::gc<rcu_type>
+                > >
+                ,co::compare< cmp<item> >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+            >::type
+        {};
+        typedef ci::LazyList< rcu_type, item, list_traits > ord_list;
+
+        struct set_traits :
+            public ci::split_list::make_traits<
+                co::hash< hash_int >
+                ,co::item_counter< simple_item_counter >
+                ,co::stat< ci::split_list::stat<> >
+            >::type
+        {};
+        typedef ci::SplitListSet< rcu_type, ord_list, set_traits > set;
+        static_assert( set::traits::dynamic_bucket_table, "Set has static bucket table" );
+
+        test_rcu_int<set>();
+    }
+
+    void IntrusiveHashSetHdrTest::split_st_RCU_GPI_base_cmpmix_stat_lazy()
+    {
+        typedef base_int_item< ci::split_list::node<ci::lazy_list::node<rcu_type> > > item;
+        typedef ci::LazyList< rcu_type
+            ,item
+            ,ci::lazy_list::make_traits<
+                ci::opt::hook< ci::lazy_list::base_hook< co::gc<rcu_type> > >
+                ,co::less< less<item> >
+                ,co::compare< cmp<item> >
+                ,ci::opt::disposer< faked_disposer >
+            >::type
+        >    ord_list;
+
+        typedef ci::SplitListSet< rcu_type, ord_list,
+            ci::split_list::make_traits<
+                co::hash< hash_int >
+                ,co::item_counter< simple_item_counter >
+                ,ci::split_list::dynamic_bucket_table<false>
+                ,co::stat< ci::split_list::stat<>>
+            >::type
+        > set;
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
+
+        test_rcu_int<set>();
+    }
+
+    void IntrusiveHashSetHdrTest::split_st_RCU_GPI_member_cmpmix_stat_lazy()
+    {
+        typedef member_int_item< ci::split_list::node< ci::lazy_list::node<rcu_type> > > item;
+        typedef ci::LazyList< rcu_type
+            ,item
+            ,ci::lazy_list::make_traits<
+                ci::opt::hook< ci::lazy_list::member_hook<
+                    offsetof( item, hMember ),
+                    co::gc<rcu_type>
+                > >
+                ,co::compare< cmp<item> >
+                ,co::less< less<item> >
+                ,ci::opt::disposer< faked_disposer >
+            >::type
+        >    ord_list;
+
+        typedef ci::SplitListSet< rcu_type, ord_list,
+            ci::split_list::make_traits<
+                co::hash< hash_int >
+                ,co::item_counter< simple_item_counter >
+                ,ci::split_list::dynamic_bucket_table<false>
+                ,co::stat< ci::split_list::stat<>>
+            >::type
+        > set;
+        static_assert( !set::traits::dynamic_bucket_table, "Set has dynamic bucket table" );
+
+        test_rcu_int<set>();
+    }
+
+
 
 } // namespace set