MultiLevelHashSet test, bugfixing
[libcds.git] / tests / test-hdr / set / hdr_intrusive_multilevel_hashset_rcu_gpb.cpp
index ecf1640fccb606cd4a000caa55185ad2e1248447..72f02b8fc6d818f1adf9f77ee305d243734aa469 100644 (file)
@@ -10,6 +10,30 @@ namespace set {
         typedef cds::urcu::gc<cds::urcu::general_buffered<>> rcu_type;
     } // namespace
 
+    void IntrusiveMultiLevelHashSetHdrTest::rcu_gpb_nohash()
+    {
+        typedef size_t key_type;
+
+        struct traits : public ci::multilevel_hashset::traits
+        {
+            typedef get_key<key_type> hash_accessor;
+            typedef item_disposer disposer;
+        };
+        typedef ci::MultiLevelHashSet< rcu_type, Item<key_type>, traits > set_type;
+        static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!");
+        test_rcu<set_type, nohash<key_type>>(4, 2);
+
+        typedef ci::MultiLevelHashSet<
+            rcu_type,
+            Item<key_type>,
+            typename ci::multilevel_hashset::make_traits<
+                ci::multilevel_hashset::hash_accessor< get_key<key_type>>
+                , ci::opt::disposer< item_disposer >
+            >::type
+        > set_type2;
+        test_rcu<set_type2, nohash<key_type>>(4, 2);
+    }
+
     void IntrusiveMultiLevelHashSetHdrTest::rcu_gpb_stdhash()
     {
         typedef size_t hash_type;
@@ -60,6 +84,32 @@ namespace set {
         test_rcu<set_type2, hash128::make>(4, 2);
     }
 
+    void IntrusiveMultiLevelHashSetHdrTest::rcu_gpb_nohash_stat()
+    {
+        typedef size_t key_type;
+
+        struct traits : public ci::multilevel_hashset::traits
+        {
+            typedef get_key<key_type> hash_accessor;
+            typedef item_disposer disposer;
+            typedef ci::multilevel_hashset::stat<> stat;
+        };
+        typedef ci::MultiLevelHashSet< rcu_type, Item<key_type>, traits > set_type;
+        static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!");
+        test_rcu<set_type, nohash<key_type>>(4, 2);
+
+        typedef ci::MultiLevelHashSet<
+            rcu_type,
+            Item<key_type>,
+            typename ci::multilevel_hashset::make_traits<
+            ci::multilevel_hashset::hash_accessor< get_key<key_type>>
+            , ci::opt::disposer< item_disposer >
+            , co::stat< ci::multilevel_hashset::stat<>>
+            >::type
+        > set_type2;
+        test_rcu<set_type2, nohash<key_type>>(4, 2);
+    }
+
     void IntrusiveMultiLevelHashSetHdrTest::rcu_gpb_stdhash_stat()
     {
         typedef size_t hash_type;
@@ -114,6 +164,30 @@ namespace set {
         test_rcu<set_type2, hash_type::make>(4, 2);
     }
 
+    void IntrusiveMultiLevelHashSetHdrTest::rcu_gpb_nohash_5_3()
+    {
+        typedef size_t key_type;
+
+        struct traits : public ci::multilevel_hashset::traits
+        {
+            typedef get_key<key_type> hash_accessor;
+            typedef item_disposer disposer;
+        };
+        typedef ci::MultiLevelHashSet< rcu_type, Item<key_type>, traits > set_type;
+        static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!");
+        test_rcu<set_type, nohash<key_type>>(5, 3);
+
+        typedef ci::MultiLevelHashSet<
+            rcu_type,
+            Item<key_type>,
+            typename ci::multilevel_hashset::make_traits<
+            ci::multilevel_hashset::hash_accessor< get_key<key_type>>
+            , ci::opt::disposer< item_disposer >
+            >::type
+        > set_type2;
+        test_rcu<set_type2, nohash<key_type>>(5, 3);
+    }
+
     void IntrusiveMultiLevelHashSetHdrTest::rcu_gpb_stdhash_5_3()
     {
         typedef size_t hash_type;
@@ -164,6 +238,32 @@ namespace set {
         test_rcu<set_type2, hash128::make >(4, 3);
     }
 
+    void IntrusiveMultiLevelHashSetHdrTest::rcu_gpb_nohash_5_3_stat()
+    {
+        typedef size_t key_type;
+
+        struct traits: public ci::multilevel_hashset::traits
+        {
+            typedef get_key<key_type> hash_accessor;
+            typedef item_disposer disposer;
+            typedef ci::multilevel_hashset::stat<> stat;
+        };
+        typedef ci::MultiLevelHashSet< rcu_type, Item<key_type>, traits > set_type;
+        static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
+        test_rcu<set_type, nohash<key_type>>(5, 3);
+
+        typedef ci::MultiLevelHashSet<
+            rcu_type,
+            Item<key_type>,
+            typename ci::multilevel_hashset::make_traits<
+                ci::multilevel_hashset::hash_accessor< get_key<key_type>>
+                , ci::opt::disposer< item_disposer >
+                ,co::stat< ci::multilevel_hashset::stat<>>
+            >::type
+        > set_type2;
+        test_rcu<set_type2, nohash<key_type>>(5, 3);
+    }
+
     void IntrusiveMultiLevelHashSetHdrTest::rcu_gpb_stdhash_5_3_stat()
     {
         typedef size_t hash_type;