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.
30 #ifndef CDSUNIT_SET_TEST_SKIPLIST_RCU_H
31 #define CDSUNIT_SET_TEST_SKIPLIST_RCU_H
33 #include "test_set_rcu.h"
34 #include <cds/container/skip_list_set_rcu.h>
36 namespace cc = cds::container;
39 class SkipListSet: public cds_test::container_set_rcu
41 typedef cds_test::container_set_rcu base_class;
43 typedef cds::urcu::gc<RCU> rcu_type;
49 cds::threading::Manager::attachThread();
54 cds::threading::Manager::detachThread();
59 TYPED_TEST_CASE_P( SkipListSet );
61 //TYPED_TEST_P( SkipListSet, compare )
62 TYPED_TEST_P( SkipListSet, compare )
64 typedef typename TestFixture::rcu_type rcu_type;
65 typedef typename TestFixture::int_item int_item;
67 typedef cc::SkipListSet< rcu_type, int_item,
68 typename cc::skip_list::make_traits<
69 cds::opt::compare< typename TestFixture::cmp >
77 TYPED_TEST_P( SkipListSet, less )
79 typedef typename TestFixture::rcu_type rcu_type;
80 typedef typename TestFixture::int_item int_item;
82 typedef cc::SkipListSet< rcu_type, int_item,
83 typename cc::skip_list::make_traits<
84 cds::opt::less< typename TestFixture::less >
92 TYPED_TEST_P( SkipListSet, cmpmix )
94 typedef typename TestFixture::rcu_type rcu_type;
95 typedef typename TestFixture::int_item int_item;
97 typedef cc::SkipListSet< rcu_type, int_item,
98 typename cc::skip_list::make_traits<
99 cds::opt::less< typename TestFixture::less >
100 ,cds::opt::compare< typename TestFixture::cmp >
108 TYPED_TEST_P( SkipListSet, item_counting )
110 typedef typename TestFixture::rcu_type rcu_type;
111 typedef typename TestFixture::int_item int_item;
113 struct set_traits: public cc::skip_list::traits
115 typedef typename TestFixture::cmp compare;
116 typedef typename TestFixture::less less;
117 typedef cds::atomicity::item_counter item_counter;
119 typedef cc::SkipListSet< rcu_type, int_item, set_traits >set_type;
125 TYPED_TEST_P( SkipListSet, backoff )
127 typedef typename TestFixture::rcu_type rcu_type;
128 typedef typename TestFixture::int_item int_item;
130 struct set_traits: public cc::skip_list::traits
132 typedef typename TestFixture::cmp compare;
133 typedef typename TestFixture::less less;
134 typedef cds::atomicity::item_counter item_counter;
135 typedef cds::backoff::yield back_off;
137 typedef cc::SkipListSet< rcu_type, int_item, set_traits >set_type;
143 TYPED_TEST_P( SkipListSet, stat )
145 typedef typename TestFixture::rcu_type rcu_type;
146 typedef typename TestFixture::int_item int_item;
148 struct set_traits: public cc::skip_list::traits
150 typedef typename TestFixture::cmp compare;
151 typedef typename TestFixture::less less;
152 typedef cds::atomicity::item_counter item_counter;
153 typedef cds::backoff::yield back_off;
154 typedef cc::skip_list::stat<> stat;
156 typedef cc::SkipListSet< rcu_type, int_item, set_traits >set_type;
162 TYPED_TEST_P( SkipListSet, random_level_generator )
164 typedef typename TestFixture::rcu_type rcu_type;
165 typedef typename TestFixture::int_item int_item;
167 struct set_traits: public cc::skip_list::traits
169 typedef typename TestFixture::cmp compare;
170 typedef typename TestFixture::less less;
171 typedef cds::atomicity::item_counter item_counter;
172 typedef cc::skip_list::stat<> stat;
173 typedef cc::skip_list::xorshift random_level_generator;
174 typedef cds::opt::v::rcu_assert_deadlock rcu_check_deadlock;
176 typedef cc::SkipListSet< rcu_type, int_item, set_traits >set_type;
183 // GCC 5: All this->test names should be written on single line, otherwise a runtime error will be encountered like as
184 // "No this->test named <test_name> can be found in this this->test case"
185 REGISTER_TYPED_TEST_CASE_P( SkipListSet,
186 compare, less, cmpmix, item_counting, backoff, stat, random_level_generator
190 #endif // CDSUNIT_SET_TEST_SKIPLIST_RCU_H