MultiLevelHashSet test, bugfixing
[libcds.git] / tests / test-hdr / set / hdr_multilevel_hashset_rcu_gpt.cpp
index 400ff185bcfe92e8954460c64520fa15dc3dfaf2..a209533baee6b813b26a8e0fae9abd12156e5b75 100644 (file)
@@ -10,6 +10,28 @@ namespace set {
         typedef cds::urcu::gc<cds::urcu::general_threaded<>> rcu_type;
     } // namespace
 
+    void MultiLevelHashSetHdrTest::rcu_gpt_nohash()
+    {
+        typedef size_t key_type;
+
+        struct traits : public cc::multilevel_hashset::traits
+        {
+            typedef get_key<key_type> hash_accessor;
+        };
+        typedef cc::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 cc::MultiLevelHashSet<
+            rcu_type,
+            Item<key_type>,
+            typename cc::multilevel_hashset::make_traits<
+            cc::multilevel_hashset::hash_accessor< get_key<key_type>>
+            >::type
+        > set_type2;
+        test_rcu<set_type2, nohash<key_type>>(4, 2);
+    }
+
     void MultiLevelHashSetHdrTest::rcu_gpt_stdhash()
     {
         typedef size_t hash_type;
@@ -56,6 +78,30 @@ namespace set {
         test_rcu<set_type2, hash128::make>(4, 2);
     }
 
+    void MultiLevelHashSetHdrTest::rcu_gpt_nohash_stat()
+    {
+        typedef size_t key_type;
+
+        struct traits : public cc::multilevel_hashset::traits
+        {
+            typedef get_key<key_type> hash_accessor;
+            typedef cc::multilevel_hashset::stat<> stat;
+        };
+        typedef cc::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 cc::MultiLevelHashSet<
+            rcu_type,
+            Item<key_type>,
+            typename cc::multilevel_hashset::make_traits<
+            cc::multilevel_hashset::hash_accessor< get_key<key_type>>
+            , co::stat< cc::multilevel_hashset::stat<>>
+            >::type
+        > set_type2;
+        test_rcu<set_type2, nohash<key_type>>(4, 2);
+    }
+
     void MultiLevelHashSetHdrTest::rcu_gpt_stdhash_stat()
     {
         typedef size_t hash_type;
@@ -106,6 +152,28 @@ namespace set {
         test_rcu<set_type2, hash_type::make>(4, 2);
     }
 
+    void MultiLevelHashSetHdrTest::rcu_gpt_nohash_5_3()
+    {
+        typedef size_t key_type;
+
+        struct traits: public cc::multilevel_hashset::traits
+        {
+            typedef get_key<key_type> hash_accessor;
+        };
+        typedef cc::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 cc::MultiLevelHashSet<
+            rcu_type,
+            Item<key_type>,
+            typename cc::multilevel_hashset::make_traits<
+                cc::multilevel_hashset::hash_accessor< get_key<key_type>>
+            >::type
+        > set_type2;
+        test_rcu<set_type2, nohash<key_type>>(5, 3);
+    }
+
     void MultiLevelHashSetHdrTest::rcu_gpt_stdhash_5_3()
     {
         typedef size_t hash_type;
@@ -152,6 +220,30 @@ namespace set {
         test_rcu<set_type2, hash128::make >(4, 3);
     }
 
+    void MultiLevelHashSetHdrTest::rcu_gpt_nohash_5_3_stat()
+    {
+        typedef size_t key_type;
+
+        struct traits: public cc::multilevel_hashset::traits
+        {
+            typedef get_key<key_type> hash_accessor;
+            typedef cc::multilevel_hashset::stat<> stat;
+        };
+        typedef cc::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 cc::MultiLevelHashSet<
+            rcu_type,
+            Item<key_type>,
+            typename cc::multilevel_hashset::make_traits<
+                cc::multilevel_hashset::hash_accessor< get_key<key_type>>
+                ,co::stat< cc::multilevel_hashset::stat<>>
+            >::type
+        > set_type2;
+        test_rcu<set_type2, nohash<key_type>>(5, 3);
+    }
+
     void MultiLevelHashSetHdrTest::rcu_gpt_stdhash_5_3_stat()
     {
         typedef size_t hash_type;
@@ -203,4 +295,6 @@ namespace set {
         > set_type2;
         test_rcu<set_type2, hash_type::make>(4, 3);
     }
+
+
 } // namespace set