Added copyright and license
[libcds.git] / tests / test-hdr / map / hdr_skiplist_map_nogc.cpp
1 /*
2     This file is a part of libcds - Concurrent Data Structures library
3
4     (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
5
6     Source code repo: http://github.com/khizmax/libcds/
7     Download: http://sourceforge.net/projects/libcds/files/
8     
9     Redistribution and use in source and binary forms, with or without
10     modification, are permitted provided that the following conditions are met:
11
12     * Redistributions of source code must retain the above copyright notice, this
13       list of conditions and the following disclaimer.
14
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.
18
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.     
29 */
30
31 #include "map/hdr_skiplist_map.h"
32 #include <cds/container/skip_list_map_nogc.h>
33 #include "unit/michael_alloc.h"
34 #include "map/print_skiplist_stat.h"
35
36 namespace map {
37
38     void SkipListMapHdrTest::SkipList_NOGC_less()
39     {
40         struct map_traits : public cc::skip_list::traits
41         {
42             typedef SkipListMapHdrTest::less less;
43             typedef simple_item_counter item_counter;
44         };
45         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type, map_traits > set;
46         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
47     }
48
49     void SkipListMapHdrTest::SkipList_NOGC_cmp()
50     {
51         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
52             cc::skip_list::make_traits<
53                 co::compare< cmp >
54                 ,co::item_counter< simple_item_counter >
55             >::type
56         > set;
57         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
58     }
59
60     void SkipListMapHdrTest::SkipList_NOGC_cmpless()
61     {
62         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
63             cc::skip_list::make_traits<
64                 co::less< less >
65                 ,co::compare< cmp >
66                 ,co::item_counter< simple_item_counter >
67             >::type
68         > set;
69         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
70     }
71
72     void SkipListMapHdrTest::SkipList_NOGC_less_stat()
73     {
74         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
75             cc::skip_list::make_traits<
76                 co::less< less >
77                 ,co::item_counter< simple_item_counter >
78                 ,co::stat< cc::skip_list::stat<> >
79             >::type
80         > set;
81         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
82     }
83
84     void SkipListMapHdrTest::SkipList_NOGC_cmp_stat()
85     {
86         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
87             cc::skip_list::make_traits<
88                 co::compare< cmp >
89                 ,co::item_counter< simple_item_counter >
90                 ,co::stat< cc::skip_list::stat<> >
91             >::type
92         > set;
93         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
94     }
95
96     void SkipListMapHdrTest::SkipList_NOGC_cmpless_stat()
97     {
98         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
99             cc::skip_list::make_traits<
100                 co::less< less >
101                 ,co::compare< cmp >
102                 ,co::item_counter< simple_item_counter >
103                 ,co::stat< cc::skip_list::stat<> >
104             >::type
105         > set;
106         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
107     }
108
109     void SkipListMapHdrTest::SkipList_NOGC_xorshift_less()
110     {
111         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
112             cc::skip_list::make_traits<
113                 co::less< less >
114                 ,co::item_counter< simple_item_counter >
115                 ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
116             >::type
117         > set;
118         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
119     }
120
121     void SkipListMapHdrTest::SkipList_NOGC_xorshift_cmp()
122     {
123         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
124             cc::skip_list::make_traits<
125                 co::compare< cmp >
126                 ,co::item_counter< simple_item_counter >
127                 ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
128             >::type
129         > set;
130         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
131     }
132
133     void SkipListMapHdrTest::SkipList_NOGC_xorshift_cmpless()
134     {
135         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
136             cc::skip_list::make_traits<
137                 co::less< less >
138                 ,co::compare< cmp >
139                 ,co::item_counter< simple_item_counter >
140                 ,cc::skip_list::random_level_generator< cc::skip_list::xorshift >
141             >::type
142         > set;
143         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
144     }
145
146     void SkipListMapHdrTest::SkipList_NOGC_xorshift_less_stat()
147     {
148         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
149             cc::skip_list::make_traits<
150                 co::less< less >
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 >
154             >::type
155         > set;
156         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
157     }
158
159     void SkipListMapHdrTest::SkipList_NOGC_xorshift_cmp_stat()
160     {
161         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
162             cc::skip_list::make_traits<
163                 co::compare< cmp >
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 >
167             >::type
168         > set;
169         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
170     }
171
172     void SkipListMapHdrTest::SkipList_NOGC_xorshift_cmpless_stat()
173     {
174         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
175             cc::skip_list::make_traits<
176                 co::less< less >
177                 ,co::compare< cmp >
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 >
181             >::type
182         > set;
183         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
184     }
185
186     void SkipListMapHdrTest::SkipList_NOGC_turbopas_less()
187     {
188         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
189             cc::skip_list::make_traits<
190                 co::less< less >
191                 ,co::item_counter< simple_item_counter >
192                 ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
193             >::type
194         > set;
195         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
196     }
197
198     void SkipListMapHdrTest::SkipList_NOGC_turbopas_cmp()
199     {
200         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
201             cc::skip_list::make_traits<
202                 co::compare< cmp >
203                 ,co::item_counter< simple_item_counter >
204                 ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
205             >::type
206         > set;
207         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
208     }
209
210     void SkipListMapHdrTest::SkipList_NOGC_turbopas_cmpless()
211     {
212         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
213             cc::skip_list::make_traits<
214                 co::less< less >
215                 ,co::compare< cmp >
216                 ,co::item_counter< simple_item_counter >
217                 ,cc::skip_list::random_level_generator< cc::skip_list::turbo_pascal >
218             >::type
219         > set;
220         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
221     }
222
223     void SkipListMapHdrTest::SkipList_NOGC_turbopas_less_stat()
224     {
225         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
226             cc::skip_list::make_traits<
227                 co::less< less >
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 >
231             >::type
232         > set;
233         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
234     }
235
236     void SkipListMapHdrTest::SkipList_NOGC_turbopas_cmp_stat()
237     {
238         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
239             cc::skip_list::make_traits<
240                 co::compare< cmp >
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 >
244             >::type
245         > set;
246         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
247     }
248
249     void SkipListMapHdrTest::SkipList_NOGC_turbopas_cmpless_stat()
250     {
251         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
252             cc::skip_list::make_traits<
253                 co::less< less >
254                 ,co::compare< cmp >
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 >
258             >::type
259         > set;
260         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
261     }
262
263     void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_less()
264     {
265         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
266             cc::skip_list::make_traits<
267                 co::less< less >
268                 ,co::item_counter< simple_item_counter >
269                 ,co::allocator< memory::MichaelAllocator<int> >
270             >::type
271         > set;
272         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
273     }
274
275     void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_cmp()
276     {
277             typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
278                 cc::skip_list::make_traits<
279                     co::compare< cmp >
280                     ,co::item_counter< simple_item_counter >
281                     ,co::allocator< memory::MichaelAllocator<int> >
282                 >::type
283             > set;
284             test_nogc< set, misc::print_skiplist_stat<set::stat> >();
285     }
286
287     void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_cmpless()
288     {
289         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
290             cc::skip_list::make_traits<
291                 co::less< less >
292                 ,co::compare< cmp >
293                 ,co::item_counter< simple_item_counter >
294                 ,co::allocator< memory::MichaelAllocator<int> >
295             >::type
296         > set;
297         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
298     }
299
300     void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_less_stat()
301     {
302         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
303             cc::skip_list::make_traits<
304                 co::less< less >
305                 ,co::item_counter< simple_item_counter >
306                 ,co::stat< cc::skip_list::stat<> >
307                 ,co::allocator< memory::MichaelAllocator<int> >
308             >::type
309         > set;
310         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
311     }
312
313     void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_cmp_stat()
314     {
315         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
316             cc::skip_list::make_traits<
317                 co::compare< cmp >
318                 ,co::item_counter< simple_item_counter >
319                 ,co::stat< cc::skip_list::stat<> >
320                 ,co::allocator< memory::MichaelAllocator<int> >
321             >::type
322         > set;
323         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
324     }
325
326     void SkipListMapHdrTest::SkipList_NOGC_michaelalloc_cmpless_stat()
327     {
328         typedef cc::SkipListMap< cds::gc::nogc, key_type, value_type,
329             cc::skip_list::make_traits<
330                 co::less< less >
331                 ,co::compare< cmp >
332                 ,co::item_counter< simple_item_counter >
333                 ,co::stat< cc::skip_list::stat<> >
334                 ,co::allocator< memory::MichaelAllocator<int> >
335             >::type
336         > set;
337         test_nogc< set, misc::print_skiplist_stat<set::stat> >();
338     }
339 } // namespace map