2 This file is a part of libcds - Concurrent Data Structures library
4 (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
6 Source code repo: http://github.com/khizmax/libcds/
7 Download: http://sourceforge.net/projects/libcds/files/
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions are met:
12 * Redistributions of source code must retain the above copyright notice, this
13 list of conditions and the following disclaimer.
15 * Redistributions in binary form must reproduce the above copyright notice,
16 this list of conditions and the following disclaimer in the documentation
17 and/or other materials provided with the distribution.
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #include "map/hdr_skiplist_map.h"
32 #include <cds/container/skip_list_map_hp.h>
33 #include "unit/michael_alloc.h"
34 #include "map/print_skiplist_stat.h"
38 void SkipListMapHdrTest::SkipList_HP_less()
40 struct map_traits : public cc::skip_list::traits
42 typedef SkipListMapHdrTest::less less;
43 typedef simple_item_counter item_counter;
45 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type, map_traits > set;
46 test< set, misc::print_skiplist_stat<set::stat > >();
49 void SkipListMapHdrTest::SkipList_HP_cmp()
51 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
52 cc::skip_list::make_traits<
54 ,co::item_counter< simple_item_counter >
57 test< set, misc::print_skiplist_stat<set::stat> >();
60 void SkipListMapHdrTest::SkipList_HP_cmpless()
62 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
63 cc::skip_list::make_traits<
66 ,co::item_counter< simple_item_counter >
69 test< set, misc::print_skiplist_stat<set::stat> >();
72 void SkipListMapHdrTest::SkipList_HP_less_stat()
74 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
75 cc::skip_list::make_traits<
77 ,co::item_counter< simple_item_counter >
78 ,co::stat< cc::skip_list::stat<> >
81 test< set, misc::print_skiplist_stat<set::stat> >();
84 void SkipListMapHdrTest::SkipList_HP_cmp_stat()
86 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
87 cc::skip_list::make_traits<
89 ,co::item_counter< simple_item_counter >
90 ,co::stat< cc::skip_list::stat<> >
93 test< set, misc::print_skiplist_stat<set::stat> >();
96 void SkipListMapHdrTest::SkipList_HP_cmpless_stat()
98 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
99 cc::skip_list::make_traits<
102 ,co::item_counter< simple_item_counter >
103 ,co::stat< cc::skip_list::stat<> >
106 test< set, misc::print_skiplist_stat<set::stat> >();
109 void SkipListMapHdrTest::SkipList_HP_xorshift_less()
111 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
112 cc::skip_list::make_traits<
114 ,co::item_counter< simple_item_counter >
115 ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
118 test< set, misc::print_skiplist_stat<set::stat> >();
121 void SkipListMapHdrTest::SkipList_HP_xorshift_cmp()
123 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
124 cc::skip_list::make_traits<
126 ,co::item_counter< simple_item_counter >
127 ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
130 test< set, misc::print_skiplist_stat<set::stat> >();
133 void SkipListMapHdrTest::SkipList_HP_xorshift_cmpless()
135 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
136 cc::skip_list::make_traits<
139 ,co::item_counter< simple_item_counter >
140 ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
143 test< set, misc::print_skiplist_stat<set::stat> >();
146 void SkipListMapHdrTest::SkipList_HP_xorshift_less_stat()
148 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
149 cc::skip_list::make_traits<
151 ,co::item_counter< simple_item_counter >
152 ,co::stat< cc::skip_list::stat<> >
153 ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
156 test< set, misc::print_skiplist_stat<set::stat> >();
159 void SkipListMapHdrTest::SkipList_HP_xorshift_cmp_stat()
161 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
162 cc::skip_list::make_traits<
164 ,co::item_counter< simple_item_counter >
165 ,co::stat< cc::skip_list::stat<> >
166 ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
169 test< set, misc::print_skiplist_stat<set::stat> >();
172 void SkipListMapHdrTest::SkipList_HP_xorshift_cmpless_stat()
174 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
175 cc::skip_list::make_traits<
178 ,co::item_counter< simple_item_counter >
179 ,co::stat< cc::skip_list::stat<> >
180 ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
183 test< set, misc::print_skiplist_stat<set::stat> >();
186 void SkipListMapHdrTest::SkipList_HP_turbopas_less()
188 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
189 cc::skip_list::make_traits<
191 ,co::item_counter< simple_item_counter >
192 ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
195 test< set, misc::print_skiplist_stat<set::stat> >();
198 void SkipListMapHdrTest::SkipList_HP_turbopas_cmp()
200 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
201 cc::skip_list::make_traits<
203 ,co::item_counter< simple_item_counter >
204 ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
207 test< set, misc::print_skiplist_stat<set::stat> >();
210 void SkipListMapHdrTest::SkipList_HP_turbopas_cmpless()
212 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
213 cc::skip_list::make_traits<
216 ,co::item_counter< simple_item_counter >
217 ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
220 test< set, misc::print_skiplist_stat<set::stat> >();
223 void SkipListMapHdrTest::SkipList_HP_turbopas_less_stat()
225 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
226 cc::skip_list::make_traits<
228 ,co::item_counter< simple_item_counter >
229 ,co::stat< cc::skip_list::stat<> >
230 ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
233 test< set, misc::print_skiplist_stat<set::stat> >();
236 void SkipListMapHdrTest::SkipList_HP_turbopas_cmp_stat()
238 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
239 cc::skip_list::make_traits<
241 ,co::item_counter< simple_item_counter >
242 ,co::stat< cc::skip_list::stat<> >
243 ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
246 test< set, misc::print_skiplist_stat<set::stat> >();
249 void SkipListMapHdrTest::SkipList_HP_turbopas_cmpless_stat()
251 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
252 cc::skip_list::make_traits<
255 ,co::item_counter< simple_item_counter >
256 ,co::stat< cc::skip_list::stat<> >
257 ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
260 test< set, misc::print_skiplist_stat<set::stat> >();
263 void SkipListMapHdrTest::SkipList_HP_michaelalloc_less()
265 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
266 cc::skip_list::make_traits<
268 ,co::item_counter< simple_item_counter >
269 ,co::allocator< memory::MichaelAllocator<int> >
272 test< set, misc::print_skiplist_stat<set::stat> >();
275 void SkipListMapHdrTest::SkipList_HP_michaelalloc_cmp()
277 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
278 cc::skip_list::make_traits<
280 ,co::item_counter< simple_item_counter >
281 ,co::allocator< memory::MichaelAllocator<int> >
284 test< set, misc::print_skiplist_stat<set::stat> >();
287 void SkipListMapHdrTest::SkipList_HP_michaelalloc_cmpless()
289 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
290 cc::skip_list::make_traits<
293 ,co::item_counter< simple_item_counter >
294 ,co::allocator< memory::MichaelAllocator<int> >
297 test< set, misc::print_skiplist_stat<set::stat> >();
300 void SkipListMapHdrTest::SkipList_HP_michaelalloc_less_stat()
302 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
303 cc::skip_list::make_traits<
305 ,co::item_counter< simple_item_counter >
306 ,co::stat< cc::skip_list::stat<> >
307 ,co::allocator< memory::MichaelAllocator<int> >
310 test< set, misc::print_skiplist_stat<set::stat> >();
313 void SkipListMapHdrTest::SkipList_HP_michaelalloc_cmp_stat()
315 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
316 cc::skip_list::make_traits<
318 ,co::item_counter< simple_item_counter >
319 ,co::stat< cc::skip_list::stat<> >
320 ,co::allocator< memory::MichaelAllocator<int> >
323 test< set, misc::print_skiplist_stat<set::stat> >();
326 void SkipListMapHdrTest::SkipList_HP_michaelalloc_cmpless_stat()
328 typedef cc::SkipListMap< cds::gc::HP, key_type, value_type,
329 cc::skip_list::make_traits<
332 ,co::item_counter< simple_item_counter >
333 ,co::stat< cc::skip_list::stat<> >
334 ,co::allocator< memory::MichaelAllocator<int> >
337 test< set, misc::print_skiplist_stat<set::stat> >();
341 CPPUNIT_TEST_SUITE_REGISTRATION(map::SkipListMapHdrTest);