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 "test_intrusive_set_nogc.h"
33 #include <cds/intrusive/skip_list_nogc.h>
36 namespace ci = cds::intrusive;
37 typedef cds::gc::nogc gc_type;
39 class IntrusiveSkipListSet_NoGC : public cds_test::intrusive_set_nogc
42 typedef cds_test::intrusive_set_nogc base_class;
45 typedef typename base_class::base_int_item< ci::skip_list::node< gc_type>> base_item_type;
46 typedef typename base_class::member_int_item< ci::skip_list::node< gc_type>> member_item_type;
56 TEST_F( IntrusiveSkipListSet_NoGC, base_cmp )
58 struct traits : public ci::skip_list::traits
60 typedef ci::skip_list::base_hook< ci::opt::gc< gc_type >> hook;
61 typedef mock_disposer disposer;
62 typedef cmp<base_item_type> compare;
65 typedef ci::SkipListSet< gc_type, base_item_type, traits > set_type;
71 TEST_F( IntrusiveSkipListSet_NoGC, base_less )
73 struct traits : public ci::skip_list::traits
75 typedef ci::skip_list::base_hook< ci::opt::gc< gc_type >> hook;
76 typedef mock_disposer disposer;
77 typedef base_class::less<base_item_type> less;
78 typedef cds::atomicity::item_counter item_counter;
81 typedef ci::SkipListSet< gc_type, base_item_type, traits > set_type;
87 TEST_F( IntrusiveSkipListSet_NoGC, base_cmpmix )
89 struct traits : public ci::skip_list::traits
91 typedef ci::skip_list::base_hook< ci::opt::gc< gc_type >> hook;
92 typedef mock_disposer disposer;
93 typedef cmp<base_item_type> compare;
94 typedef base_class::less<base_item_type> less;
95 typedef ci::skip_list::stat<> stat;
98 typedef ci::SkipListSet< gc_type, base_item_type, traits > set_type;
104 TEST_F( IntrusiveSkipListSet_NoGC, base_xorshift )
106 struct traits : public ci::skip_list::traits
108 typedef ci::skip_list::base_hook< ci::opt::gc< gc_type >> hook;
109 typedef mock_disposer disposer;
110 typedef cmp<base_item_type> compare;
111 typedef ci::skip_list::xorshift random_level_generator;
114 typedef ci::SkipListSet< gc_type, base_item_type, traits > set_type;
121 TEST_F( IntrusiveSkipListSet_NoGC, member_cmp )
123 struct traits : public ci::skip_list::traits
125 typedef ci::skip_list::member_hook< offsetof(member_item_type, hMember), ci::opt::gc< gc_type >> hook;
126 typedef mock_disposer disposer;
127 typedef cmp<member_item_type> compare;
130 typedef ci::SkipListSet< gc_type, member_item_type, traits > set_type;
136 TEST_F( IntrusiveSkipListSet_NoGC, member_less )
138 struct traits : public ci::skip_list::traits
140 typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< gc_type >> hook;
141 typedef mock_disposer disposer;
142 typedef base_class::less<member_item_type> less;
143 typedef cds::atomicity::item_counter item_counter;
144 typedef ci::opt::v::sequential_consistent memory_model;
147 typedef ci::SkipListSet< gc_type, member_item_type, traits > set_type;
153 TEST_F( IntrusiveSkipListSet_NoGC, member_cmpmix )
155 struct traits : public ci::skip_list::traits
157 typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< gc_type >> hook;
158 typedef mock_disposer disposer;
159 typedef cmp<member_item_type> compare;
160 typedef base_class::less<member_item_type> less;
161 typedef ci::skip_list::stat<> stat;
164 typedef ci::SkipListSet< gc_type, member_item_type, traits > set_type;
170 TEST_F( IntrusiveSkipListSet_NoGC, member_xorshift )
172 struct traits : public ci::skip_list::traits
174 typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< gc_type >> hook;
175 typedef mock_disposer disposer;
176 typedef cmp<member_item_type> compare;
177 typedef ci::skip_list::xorshift random_level_generator;
180 typedef ci::SkipListSet< gc_type, member_item_type, traits > set_type;