From: khizmax Date: Mon, 14 Nov 2016 09:31:32 +0000 (+0300) Subject: Fixed: set_DelOdd and map_DelOdd tests for FeldmanHashSet/Map now use correct compare... X-Git-Tag: v2.2.0~64 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=commitdiff_plain;h=1011e89e24d83d53642754691fade33ce8ca5c29;hp=41ae43a6d3ed45b790aa28a5e87037d0b728af52 Fixed: set_DelOdd and map_DelOdd tests for FeldmanHashSet/Map now use correct compare functor --- diff --git a/test/stress/map/map_type_feldman_hashmap.h b/test/stress/map/map_type_feldman_hashmap.h index 674b9ac8..fabf3769 100644 --- a/test/stress/map/map_type_feldman_hashmap.h +++ b/test/stress/map/map_type_feldman_hashmap.h @@ -76,6 +76,7 @@ namespace map { struct traits_FeldmanHashMap_stdhash : public cc::feldman_hashmap::traits { typedef std::hash< Key > hash; + typedef map::cmp compare; }; typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_stdhash > FeldmanHashMap_hp_stdhash; @@ -91,6 +92,7 @@ namespace map { struct traits_FeldmanHashMap_stdhash_stat: traits_FeldmanHashMap_stdhash { typedef cc::feldman_hashmap::stat<> stat; + typedef map::less less; }; typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_stdhash_stat > FeldmanHashMap_hp_stdhash_stat; @@ -166,28 +168,33 @@ namespace map { // for fixed-sized keys - no hash functor required - typedef FeldmanHashMap< cds::gc::HP, Key, Value > FeldmanHashMap_hp_fixed; - typedef FeldmanHashMap< cds::gc::DHP, Key, Value > FeldmanHashMap_dhp_fixed; - typedef FeldmanHashMap< rcu_gpi, Key, Value > FeldmanHashMap_rcu_gpi_fixed; - typedef FeldmanHashMap< rcu_gpb, Key, Value > FeldmanHashMap_rcu_gpb_fixed; - typedef FeldmanHashMap< rcu_gpt, Key, Value > FeldmanHashMap_rcu_gpt_fixed; + struct traits_FeldmanHashMap_fixed: public cc::feldman_hashmap::traits + { + typedef map::cmp compare; + }; + + typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_fixed > FeldmanHashMap_hp_fixed; + typedef FeldmanHashMap< cds::gc::DHP, Key, Value, traits_FeldmanHashMap_fixed > FeldmanHashMap_dhp_fixed; + typedef FeldmanHashMap< rcu_gpi, Key, Value, traits_FeldmanHashMap_fixed > FeldmanHashMap_rcu_gpi_fixed; + typedef FeldmanHashMap< rcu_gpb, Key, Value, traits_FeldmanHashMap_fixed > FeldmanHashMap_rcu_gpb_fixed; + typedef FeldmanHashMap< rcu_gpt, Key, Value, traits_FeldmanHashMap_fixed > FeldmanHashMap_rcu_gpt_fixed; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashMap< rcu_shb, Key, Value > FeldmanHashMap_rcu_shb_fixed; - typedef FeldmanHashMap< rcu_sht, Key, Value > FeldmanHashMap_rcu_sht_fixed; + typedef FeldmanHashMap< rcu_shb, Key, Value, traits_FeldmanHashMap_fixed > FeldmanHashMap_rcu_shb_fixed; + typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_fixed > FeldmanHashMap_rcu_sht_fixed; #endif - struct traits_FeldmanHashMap_stat : public cc::feldman_hashmap::traits + struct traits_FeldmanHashMap_fixed_stat : public traits_FeldmanHashMap_fixed { typedef cc::feldman_hashmap::stat<> stat; }; - typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_hp_fixed_stat; - typedef FeldmanHashMap< cds::gc::DHP, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_dhp_fixed_stat; - typedef FeldmanHashMap< rcu_gpi, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_rcu_gpi_fixed_stat; - typedef FeldmanHashMap< rcu_gpb, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_rcu_gpb_fixed_stat; - typedef FeldmanHashMap< rcu_gpt, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_rcu_gpt_fixed_stat; + typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_fixed_stat > FeldmanHashMap_hp_fixed_stat; + typedef FeldmanHashMap< cds::gc::DHP, Key, Value, traits_FeldmanHashMap_fixed_stat > FeldmanHashMap_dhp_fixed_stat; + typedef FeldmanHashMap< rcu_gpi, Key, Value, traits_FeldmanHashMap_fixed_stat > FeldmanHashMap_rcu_gpi_fixed_stat; + typedef FeldmanHashMap< rcu_gpb, Key, Value, traits_FeldmanHashMap_fixed_stat > FeldmanHashMap_rcu_gpb_fixed_stat; + typedef FeldmanHashMap< rcu_gpt, Key, Value, traits_FeldmanHashMap_fixed_stat > FeldmanHashMap_rcu_gpt_fixed_stat; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashMap< rcu_shb, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_rcu_shb_fixed_stat; - typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_rcu_sht_fixed_stat; + typedef FeldmanHashMap< rcu_shb, Key, Value, traits_FeldmanHashMap_fixed_stat > FeldmanHashMap_rcu_shb_fixed_stat; + typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_fixed_stat > FeldmanHashMap_rcu_sht_fixed_stat; #endif }; diff --git a/test/stress/set/set_type.h b/test/stress/set/set_type.h index 0fa5182b..3d0edd7c 100644 --- a/test/stress/set/set_type.h +++ b/test/stress/set/set_type.h @@ -183,7 +183,7 @@ namespace set { key_type key; value_type val; - /*explicit*/ key_val( key_type const& k ): key(k), val() {} + explicit key_val( key_type const& k ): key(k), val() {} key_val( key_type const& k, value_type const& v ): key(k), val(v) {} template diff --git a/test/stress/set/set_type_feldman_hashset.h b/test/stress/set/set_type_feldman_hashset.h index ab20e1f6..a0e3527c 100644 --- a/test/stress/set/set_type_feldman_hashset.h +++ b/test/stress/set/set_type_feldman_hashset.h @@ -256,11 +256,11 @@ namespace set { { typedef typename set_type_base< Key, Val >::key_val base_class; - /*explicit*/ key_val(key_type const& k) : base_class(k) {} + explicit key_val(key_type const& k) : base_class(k) {} key_val(key_type const& k, value_type const& v) : base_class(k, v) {} template - /*explicit*/ key_val(K const& k) : base_class(k) {} + explicit key_val(K const& k) : base_class(k) {} template key_val(K const& k, T const& v) : base_class(k, v) {} @@ -272,17 +272,34 @@ namespace set { { return key_type( k ); } + + key_type const& operator()( key_val const& kv ) const + { + return kv.key; + } + + key_type const& operator()( key_type const& k ) const + { + return k; + } }; }; struct traits : public cc::feldman_hashset::traits { struct hash_accessor { - key_type operator()(key_val const& kv) + key_type const& operator()( key_val const& kv ) const { return kv.key; } + + key_type const& operator()( key_type const& k ) const + { + return k; + } }; + + typedef set::cmp compare; }; struct traits_stat : public traits