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 "list/hdr_intrusive_michael.h"
32 #include <cds/intrusive/michael_list_hp.h>
35 void IntrusiveMichaelListHeaderTest::HP_base_cmp()
37 typedef base_int_item< cds::gc::HP > item;
38 struct traits : public ci::michael_list::traits {
39 typedef ci::michael_list::base_hook< co::gc<cds::gc::HP> > hook;
40 typedef cmp<item> compare;
41 typedef faked_disposer disposer;
43 typedef ci::MichaelList< cds::gc::HP, item, traits > list;
46 void IntrusiveMichaelListHeaderTest::HP_base_less()
48 typedef base_int_item< cds::gc::HP > item;
49 typedef ci::MichaelList< cds::gc::HP
51 ,ci::michael_list::make_traits<
52 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
53 ,co::less< less<item> >
54 ,ci::opt::disposer< faked_disposer >
59 void IntrusiveMichaelListHeaderTest::HP_base_cmpmix()
61 typedef base_int_item< cds::gc::HP > item;
62 typedef ci::MichaelList< cds::gc::HP
64 ,ci::michael_list::make_traits<
65 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
66 ,co::less< less<item> >
67 ,co::compare< cmp<item> >
68 ,ci::opt::disposer< faked_disposer >
73 void IntrusiveMichaelListHeaderTest::HP_base_ic()
75 typedef base_int_item< cds::gc::HP > item;
76 typedef ci::MichaelList< cds::gc::HP
78 ,ci::michael_list::make_traits<
79 ci::opt::hook< ci::michael_list::base_hook< co::gc<cds::gc::HP> > >
80 ,co::less< less<item> >
81 ,co::compare< cmp<item> >
82 ,ci::opt::disposer< faked_disposer >
83 ,co::item_counter< cds::atomicity::item_counter >
88 void IntrusiveMichaelListHeaderTest::HP_member_cmp()
90 typedef member_int_item< cds::gc::HP > item;
91 typedef ci::MichaelList< cds::gc::HP
93 ,ci::michael_list::make_traits<
94 ci::opt::hook< ci::michael_list::member_hook<
95 offsetof( item, hMember ),
98 ,co::compare< cmp<item> >
99 ,ci::opt::disposer< faked_disposer >
104 void IntrusiveMichaelListHeaderTest::HP_member_less()
106 typedef member_int_item< cds::gc::HP > item;
107 typedef ci::MichaelList< cds::gc::HP
109 ,ci::michael_list::make_traits<
110 ci::opt::hook< ci::michael_list::member_hook<
111 offsetof( item, hMember ),
114 ,co::less< less<item> >
115 ,ci::opt::disposer< faked_disposer >
120 void IntrusiveMichaelListHeaderTest::HP_member_cmpmix()
122 typedef member_int_item< cds::gc::HP > item;
123 typedef ci::MichaelList< cds::gc::HP
125 ,ci::michael_list::make_traits<
126 ci::opt::hook< ci::michael_list::member_hook<
127 offsetof( item, hMember ),
130 ,co::less< less<item> >
131 ,co::compare< cmp<item> >
132 ,ci::opt::disposer< faked_disposer >
137 void IntrusiveMichaelListHeaderTest::HP_member_ic()
139 typedef member_int_item< cds::gc::HP > item;
140 typedef ci::MichaelList< cds::gc::HP
142 ,ci::michael_list::make_traits<
143 ci::opt::hook< ci::michael_list::member_hook<
144 offsetof( item, hMember ),
147 ,co::compare< cmp<item> >
148 ,ci::opt::disposer< faked_disposer >
149 ,co::item_counter< cds::atomicity::item_counter >
154 } // namespace ordlist
156 CPPUNIT_TEST_SUITE_REGISTRATION(ordlist::IntrusiveMichaelListHeaderTest);