3 #include "map/hdr_feldman_hashmap.h"
4 #include <cds/container/feldman_hashmap_hp.h>
5 #include "unit/print_feldman_hashset_stat.h"
9 typedef cds::gc::HP gc_type;
12 void FeldmanHashMapHdrTest::hp_nohash()
14 typedef cc::FeldmanHashMap< gc_type, size_t, Item > map_type;
16 test_hp<map_type>(4, 2);
19 void FeldmanHashMapHdrTest::hp_stdhash()
21 struct traits : public cc::feldman_hashmap::traits {
22 typedef std::hash<size_t> hash;
24 typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
26 test_hp<map_type>(4, 2);
29 void FeldmanHashMapHdrTest::hp_hash128()
31 struct traits : public cc::feldman_hashmap::traits {
32 typedef hash128::make hash;
33 typedef hash128::less less;
35 typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
36 test_hp<map_type>(4, 2);
38 typedef cc::FeldmanHashMap< gc_type, size_t, Item,
39 typename cc::feldman_hashmap::make_traits<
40 co::hash< hash128::make >
41 , co::less< hash128::less >
44 test_hp<map_type2>(4, 2);
47 void FeldmanHashMapHdrTest::hp_nohash_stat()
49 struct traits : public cc::feldman_hashmap::traits {
50 typedef cc::feldman_hashmap::stat<> stat;
52 typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
53 test_hp<map_type>(4, 2);
55 typedef cc::FeldmanHashMap< gc_type, size_t, Item,
56 typename cc::feldman_hashmap::make_traits<
57 co::stat< cc::feldman_hashmap::stat<>>
60 test_hp<map_type2>(4, 2);
63 void FeldmanHashMapHdrTest::hp_stdhash_stat()
65 struct traits : public cc::feldman_hashmap::traits {
66 typedef std::hash<size_t> hash;
67 typedef cc::feldman_hashmap::stat<> stat;
69 typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
70 test_hp<map_type>(4, 2);
72 typedef cc::FeldmanHashMap< gc_type, size_t, Item,
73 typename cc::feldman_hashmap::make_traits<
74 co::stat< cc::feldman_hashmap::stat<>>
75 ,co::hash< std::hash<size_t>>
78 test_hp<map_type2>(4, 2);
81 void FeldmanHashMapHdrTest::hp_hash128_stat()
83 struct traits : public cc::feldman_hashmap::traits {
84 typedef cc::feldman_hashmap::stat<> stat;
85 typedef hash128::make hash;
86 typedef hash128::cmp compare;
88 typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
89 test_hp<map_type>(4, 2);
91 typedef cc::FeldmanHashMap< gc_type, size_t, Item,
92 typename cc::feldman_hashmap::make_traits<
93 co::stat< cc::feldman_hashmap::stat<>>
94 , co::hash< hash128::make >
95 , co::compare< hash128::cmp >
98 test_hp<map_type2>(4, 2);
101 void FeldmanHashMapHdrTest::hp_nohash_5_3()
103 typedef cc::FeldmanHashMap< gc_type, size_t, Item > map_type;
105 test_hp<map_type>(5, 3);
109 void FeldmanHashMapHdrTest::hp_stdhash_5_3()
111 struct traits : public cc::feldman_hashmap::traits {
112 typedef std::hash<size_t> hash;
114 typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
116 test_hp<map_type>(5, 3);
119 void FeldmanHashMapHdrTest::hp_nohash_5_3_stat()
121 struct traits : public cc::feldman_hashmap::traits {
122 typedef cc::feldman_hashmap::stat<> stat;
123 typedef cds::backoff::empty back_off;
125 typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
126 test_hp<map_type>(5, 3);
128 typedef cc::FeldmanHashMap< gc_type, size_t, Item,
129 typename cc::feldman_hashmap::make_traits<
130 co::stat< cc::feldman_hashmap::stat<>>
131 , co::back_off< cds::backoff::empty >
134 test_hp<map_type2>(5, 3);
137 void FeldmanHashMapHdrTest::hp_stdhash_5_3_stat()
139 struct traits : public cc::feldman_hashmap::traits {
140 typedef cc::feldman_hashmap::stat<> stat;
141 typedef cds::backoff::empty back_off;
142 typedef std::hash<size_t> hash;
144 typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
145 test_hp<map_type>(5, 3);
147 typedef cc::FeldmanHashMap< gc_type, size_t, Item,
148 typename cc::feldman_hashmap::make_traits<
149 co::stat< cc::feldman_hashmap::stat<>>
150 ,co::back_off< cds::backoff::empty >
151 ,co::hash< std::hash<size_t>>
154 test_hp<map_type2>(5, 3);
157 void FeldmanHashMapHdrTest::hp_hash128_4_3()
159 struct traits : public cc::feldman_hashmap::traits {
160 typedef hash128::make hash;
161 typedef hash128::less less;
163 typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
164 test_hp<map_type>(4, 3);
166 typedef cc::FeldmanHashMap< gc_type, size_t, Item,
167 typename cc::feldman_hashmap::make_traits<
168 co::hash< hash128::make >
169 , co::less< hash128::less >
172 test_hp<map_type2>(4, 3);
175 void FeldmanHashMapHdrTest::hp_hash128_4_3_stat()
177 struct traits : public cc::feldman_hashmap::traits {
178 typedef hash128::make hash;
179 typedef hash128::less less;
180 typedef cc::feldman_hashmap::stat<> stat;
181 typedef co::v::sequential_consistent memory_model;
183 typedef cc::FeldmanHashMap< gc_type, size_t, Item, traits > map_type;
184 test_hp<map_type>(4, 3);
186 typedef cc::FeldmanHashMap< gc_type, size_t, Item,
187 typename cc::feldman_hashmap::make_traits<
188 co::hash< hash128::make >
189 , co::less< hash128::less >
190 , co::stat< cc::feldman_hashmap::stat<>>
191 , co::memory_model< co::v::sequential_consistent >
194 test_hp<map_type2>(4, 3);
198 CPPUNIT_TEST_SUITE_REGISTRATION(map::FeldmanHashMapHdrTest);