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_lazy.h"
32 #include <cds/intrusive/lazy_list_hp.h>
35 void IntrusiveLazyListHeaderTest::HP_base_cmp()
37 typedef base_int_item< cds::gc::HP > item;
38 struct traits : public ci::lazy_list::traits
40 typedef ci::lazy_list::base_hook< co::gc<cds::gc::HP> > hook;
41 typedef cmp<item> compare;
42 typedef faked_disposer disposer;
44 typedef ci::LazyList< cds::gc::HP, item, traits > list;
47 void IntrusiveLazyListHeaderTest::HP_base_less()
49 typedef base_int_item< cds::gc::HP > item;
50 typedef ci::LazyList< cds::gc::HP
52 ,ci::lazy_list::make_traits<
53 ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::HP> > >
54 ,co::less< less<item> >
55 ,ci::opt::disposer< faked_disposer >
60 void IntrusiveLazyListHeaderTest::HP_base_cmpmix()
62 typedef base_int_item< cds::gc::HP > item;
63 typedef ci::LazyList< cds::gc::HP
65 ,ci::lazy_list::make_traits<
66 ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::HP> > >
67 ,co::less< less<item> >
68 ,co::compare< cmp<item> >
69 ,ci::opt::disposer< faked_disposer >
74 void IntrusiveLazyListHeaderTest::HP_base_ic()
76 typedef base_int_item< cds::gc::HP > item;
77 typedef ci::LazyList< cds::gc::HP
79 ,ci::lazy_list::make_traits<
80 ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::HP> > >
81 ,co::less< less<item> >
82 ,co::compare< cmp<item> >
83 ,ci::opt::disposer< faked_disposer >
84 ,co::item_counter< cds::atomicity::item_counter >
89 void IntrusiveLazyListHeaderTest::HP_member_cmp()
91 typedef member_int_item< cds::gc::HP > item;
92 typedef ci::LazyList< cds::gc::HP
94 ,ci::lazy_list::make_traits<
95 ci::opt::hook< ci::lazy_list::member_hook<
96 offsetof( item, hMember ),
99 ,co::compare< cmp<item> >
100 ,ci::opt::disposer< faked_disposer >
105 void IntrusiveLazyListHeaderTest::HP_member_less()
107 typedef member_int_item< cds::gc::HP > item;
108 struct traits : public ci::lazy_list::traits
110 typedef ci::lazy_list::member_hook< offsetof( item, hMember ), co::gc<cds::gc::HP>> hook;
111 typedef IntrusiveLazyListHeaderTest::less<item> less;
112 typedef faked_disposer disposer;
114 typedef ci::LazyList< cds::gc::HP, item, traits > list;
117 void IntrusiveLazyListHeaderTest::HP_member_cmpmix()
119 typedef member_int_item< cds::gc::HP > item;
120 typedef ci::LazyList< cds::gc::HP
122 ,ci::lazy_list::make_traits<
123 ci::opt::hook< ci::lazy_list::member_hook<
124 offsetof( item, hMember ),
127 ,co::less< less<item> >
128 ,co::compare< cmp<item> >
129 ,ci::opt::disposer< faked_disposer >
134 void IntrusiveLazyListHeaderTest::HP_member_ic()
136 typedef member_int_item< cds::gc::HP > item;
137 typedef ci::LazyList< cds::gc::HP
139 ,ci::lazy_list::make_traits<
140 ci::opt::hook< ci::lazy_list::member_hook<
141 offsetof( item, hMember ),
144 ,co::compare< cmp<item> >
145 ,ci::opt::disposer< faked_disposer >
146 ,co::item_counter< cds::atomicity::item_counter >
151 } // namespace ordlist
153 CPPUNIT_TEST_SUITE_REGISTRATION(ordlist::IntrusiveLazyListHeaderTest);