MultiLevelHashSet test, bugfixing
[libcds.git] / tests / test-hdr / set / hdr_multilevel_hashset_rcu_shb.cpp
index 319d923522ee7482855c3b36ea64d1caea5a6fa5..eaf261c22a95ed62e8091ef13d97cab1e1daf434 100644 (file)
@@ -12,6 +12,30 @@ namespace set {
     } // namespace
 #endif
 
+    void MultiLevelHashSetHdrTest::rcu_shb_nohash()
+    {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+        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);
+#endif
+    }
+
     void MultiLevelHashSetHdrTest::rcu_shb_stdhash()
     {
 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
@@ -62,6 +86,32 @@ namespace set {
 #endif
     }
 
+    void MultiLevelHashSetHdrTest::rcu_shb_nohash_stat()
+    {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+        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);
+#endif
+    }
+
     void MultiLevelHashSetHdrTest::rcu_shb_stdhash_stat()
     {
 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
@@ -116,6 +166,30 @@ namespace set {
 #endif
     }
 
+    void MultiLevelHashSetHdrTest::rcu_shb_nohash_5_3()
+    {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+        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);
+#endif
+    }
+
     void MultiLevelHashSetHdrTest::rcu_shb_stdhash_5_3()
     {
 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
@@ -166,6 +240,32 @@ namespace set {
 #endif
     }
 
+    void MultiLevelHashSetHdrTest::rcu_shb_nohash_5_3_stat()
+    {
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+        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);
+#endif
+    }
+
     void MultiLevelHashSetHdrTest::rcu_shb_stdhash_5_3_stat()
     {
 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED