changelog
[libcds.git] / tests / unit / pqueue / pqueue_defs.h
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 #ifndef CDSUNIT_PQUEUE_PQUEUE_DEFS_H
32 #define CDSUNIT_PQUEUE_PQUEUE_DEFS_H
33
34 // MSPriorityQueue
35 #define CDSUNIT_DECLARE_MSPriorityQueue \
36     TEST_BOUNDED(MSPriorityQueue_static_less)   \
37     TEST_BOUNDED(MSPriorityQueue_static_less_stat) \
38     TEST_BOUNDED(MSPriorityQueue_static_cmp)    \
39     TEST_BOUNDED(MSPriorityQueue_static_mutex)  \
40     TEST_BOUNDED(MSPriorityQueue_dyn_less)      \
41     TEST_BOUNDED(MSPriorityQueue_dyn_less_stat) \
42     TEST_BOUNDED(MSPriorityQueue_dyn_cmp)       \
43     TEST_BOUNDED(MSPriorityQueue_dyn_mutex)
44 #define CDSUNIT_TEST_MSPriorityQueue    \
45     CPPUNIT_TEST(MSPriorityQueue_static_less)   \
46     CPPUNIT_TEST(MSPriorityQueue_static_less_stat) \
47     CPPUNIT_TEST(MSPriorityQueue_static_cmp)    \
48     CPPUNIT_TEST(MSPriorityQueue_static_mutex)  \
49     CPPUNIT_TEST(MSPriorityQueue_dyn_less)      \
50     CPPUNIT_TEST(MSPriorityQueue_dyn_less_stat) \
51     CPPUNIT_TEST(MSPriorityQueue_dyn_cmp)       \
52     CPPUNIT_TEST(MSPriorityQueue_dyn_mutex)
53
54
55 // EllenBinTree
56 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
57 #   define CDSUNIT_DECLARE_EllenBinTree_RCU_signal  \
58         TEST_CASE(EllenBinTree_RCU_shb_max) \
59         TEST_CASE(EllenBinTree_RCU_shb_max_stat) \
60         TEST_CASE(EllenBinTree_RCU_shb_min) \
61         TEST_CASE(EllenBinTree_RCU_shb_min_stat) \
62         TEST_CASE(EllenBinTree_RCU_sht_max) \
63         TEST_CASE(EllenBinTree_RCU_sht_max_stat) \
64         TEST_CASE(EllenBinTree_RCU_sht_min) \
65         TEST_CASE(EllenBinTree_RCU_sht_min_stat)
66 #   define CDSUNIT_TEST_EllenBinTree_RCU_signal \
67         CPPUNIT_TEST(EllenBinTree_RCU_shb_max)  \
68         CPPUNIT_TEST(EllenBinTree_RCU_shb_max_stat)  \
69         CPPUNIT_TEST(EllenBinTree_RCU_shb_min)  \
70         CPPUNIT_TEST(EllenBinTree_RCU_shb_min_stat)  \
71         CPPUNIT_TEST(EllenBinTree_RCU_sht_max)  \
72         CPPUNIT_TEST(EllenBinTree_RCU_sht_max_stat)  \
73         CPPUNIT_TEST(EllenBinTree_RCU_sht_min) \
74         CPPUNIT_TEST(EllenBinTree_RCU_sht_min_stat)
75 #else
76 #   define CDSUNIT_DECLARE_EllenBinTree_RCU_signal
77 #   define CDSUNIT_TEST_EllenBinTree_RCU_signal
78 #endif
79
80 #define CDSUNIT_DECLARE_EllenBinTree    \
81     TEST_CASE(EllenBinTree_HP_max)          \
82     TEST_CASE(EllenBinTree_HP_max_stat)     \
83     TEST_CASE(EllenBinTree_HP_min)          \
84     TEST_CASE(EllenBinTree_HP_min_stat)     \
85     TEST_CASE(EllenBinTree_DHP_max)         \
86     TEST_CASE(EllenBinTree_DHP_max_stat)    \
87     TEST_CASE(EllenBinTree_DHP_min)         \
88     TEST_CASE(EllenBinTree_DHP_min_stat)    \
89     TEST_CASE(EllenBinTree_RCU_gpi_max)     \
90     TEST_CASE(EllenBinTree_RCU_gpi_max_stat)     \
91     TEST_CASE(EllenBinTree_RCU_gpi_min)     \
92     TEST_CASE(EllenBinTree_RCU_gpi_min_stat)     \
93     TEST_CASE(EllenBinTree_RCU_gpb_max)     \
94     TEST_CASE(EllenBinTree_RCU_gpb_max_stat)     \
95     TEST_CASE(EllenBinTree_RCU_gpb_min)     \
96     TEST_CASE(EllenBinTree_RCU_gpb_min_stat)     \
97     TEST_CASE(EllenBinTree_RCU_gpt_max)     \
98     TEST_CASE(EllenBinTree_RCU_gpt_max_stat)     \
99     TEST_CASE(EllenBinTree_RCU_gpt_min)     \
100     TEST_CASE(EllenBinTree_RCU_gpt_min_stat)     \
101     CDSUNIT_DECLARE_EllenBinTree_RCU_signal
102 #define CDSUNIT_TEST_EllenBinTree       \
103     CPPUNIT_TEST(EllenBinTree_HP_max)       \
104     CPPUNIT_TEST(EllenBinTree_HP_max_stat)  \
105     CPPUNIT_TEST(EllenBinTree_HP_min)       \
106     CPPUNIT_TEST(EllenBinTree_HP_min_stat)  \
107     CPPUNIT_TEST(EllenBinTree_DHP_max)      \
108     CPPUNIT_TEST(EllenBinTree_DHP_max_stat) \
109     CPPUNIT_TEST(EllenBinTree_DHP_min)      \
110     CPPUNIT_TEST(EllenBinTree_DHP_min_stat) \
111     /*CPPUNIT_TEST(EllenBinTree_RCU_gpi_max)*/  \
112     /*CPPUNIT_TEST(EllenBinTree_RCU_gpi_max_stat)*/  \
113     /*CPPUNIT_TEST(EllenBinTree_RCU_gpi_min)*/  \
114     /*CPPUNIT_TEST(EllenBinTree_RCU_gpi_min_stat)*/  \
115     CPPUNIT_TEST(EllenBinTree_RCU_gpb_max)  \
116     CPPUNIT_TEST(EllenBinTree_RCU_gpb_max_stat)  \
117     CPPUNIT_TEST(EllenBinTree_RCU_gpb_min)  \
118     CPPUNIT_TEST(EllenBinTree_RCU_gpb_min_stat)  \
119     CPPUNIT_TEST(EllenBinTree_RCU_gpt_max)  \
120     CPPUNIT_TEST(EllenBinTree_RCU_gpt_max_stat)  \
121     CPPUNIT_TEST(EllenBinTree_RCU_gpt_min)  \
122     CPPUNIT_TEST(EllenBinTree_RCU_gpt_min_stat)  \
123     CDSUNIT_TEST_EllenBinTree_RCU_signal
124
125
126 // SkipList
127 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
128 #   define CDSUNIT_DECLARE_SkipList_RCU_signal  \
129     TEST_CASE(SkipList_RCU_shb_max) \
130     TEST_CASE(SkipList_RCU_shb_min) \
131     TEST_CASE(SkipList_RCU_sht_max) \
132     TEST_CASE(SkipList_RCU_sht_min)
133 #   define CDSUNIT_TEST_SkipList_RCU_signal \
134     CPPUNIT_TEST(SkipList_RCU_shb_max)  \
135     CPPUNIT_TEST(SkipList_RCU_shb_min)  \
136     CPPUNIT_TEST(SkipList_RCU_sht_max)  \
137     CPPUNIT_TEST(SkipList_RCU_sht_min)
138 #else
139 #   define CDSUNIT_DECLARE_SkipList_RCU_signal
140 #   define CDSUNIT_TEST_SkipList_RCU_signal
141 #endif
142
143 #define CDSUNIT_DECLARE_SkipList    \
144     TEST_CASE(SkipList_HP_max)          \
145     TEST_CASE(SkipList_HP_max_stat)     \
146     TEST_CASE(SkipList_HP_min)          \
147     TEST_CASE(SkipList_HP_min_stat)     \
148     TEST_CASE(SkipList_DHP_max)         \
149     TEST_CASE(SkipList_DHP_max_stat)    \
150     TEST_CASE(SkipList_DHP_min)         \
151     TEST_CASE(SkipList_DHP_min_stat)    \
152     TEST_CASE(SkipList_RCU_gpi_max)     \
153     TEST_CASE(SkipList_RCU_gpi_min)     \
154     TEST_CASE(SkipList_RCU_gpb_max)     \
155     TEST_CASE(SkipList_RCU_gpb_min)     \
156     TEST_CASE(SkipList_RCU_gpt_max)     \
157     TEST_CASE(SkipList_RCU_gpt_min)     \
158     CDSUNIT_DECLARE_SkipList_RCU_signal
159 #define CDSUNIT_TEST_SkipList       \
160     CPPUNIT_TEST(SkipList_HP_max)       \
161     CPPUNIT_TEST(SkipList_HP_max_stat)  \
162     CPPUNIT_TEST(SkipList_HP_min)       \
163     CPPUNIT_TEST(SkipList_HP_min_stat)  \
164     CPPUNIT_TEST(SkipList_DHP_max)      \
165     CPPUNIT_TEST(SkipList_DHP_max_stat) \
166     CPPUNIT_TEST(SkipList_DHP_min)      \
167     CPPUNIT_TEST(SkipList_DHP_min_stat) \
168     CPPUNIT_TEST(SkipList_RCU_gpi_max)  \
169     CPPUNIT_TEST(SkipList_RCU_gpi_min)  \
170     CPPUNIT_TEST(SkipList_RCU_gpb_max)  \
171     CPPUNIT_TEST(SkipList_RCU_gpb_min)  \
172     CPPUNIT_TEST(SkipList_RCU_gpt_max)  \
173     CPPUNIT_TEST(SkipList_RCU_gpt_min)  \
174     CDSUNIT_TEST_SkipList_RCU_signal
175
176 // FCPriorityQueue
177 #define CDSUNIT_DECLARE_FCPriorityQueue \
178     TEST_CASE(FCPQueue_vector)          \
179     TEST_CASE(FCPQueue_vector_stat)     \
180     TEST_CASE(FCPQueue_deque)           \
181     TEST_CASE(FCPQueue_deque_stat)      \
182     TEST_CASE(FCPQueue_boost_deque)          \
183     TEST_CASE(FCPQueue_boost_deque_stat)     \
184     TEST_CASE(FCPQueue_boost_stable_vector)  \
185     TEST_CASE(FCPQueue_boost_stable_vector_stat)
186
187 #define CDSUNIT_TEST_FCPriorityQueue \
188     CPPUNIT_TEST(FCPQueue_vector)          \
189     CPPUNIT_TEST(FCPQueue_vector_stat)     \
190     CPPUNIT_TEST(FCPQueue_deque)           \
191     CPPUNIT_TEST(FCPQueue_deque_stat)      \
192     CPPUNIT_TEST(FCPQueue_boost_deque)          \
193     CPPUNIT_TEST(FCPQueue_boost_deque_stat)     \
194     CPPUNIT_TEST(FCPQueue_boost_stable_vector)  \
195     CPPUNIT_TEST(FCPQueue_boost_stable_vector_stat)
196
197 // Std::priority_queue
198 #define CDSUNIT_DECLARE_StdPQueue       \
199     TEST_CASE(StdPQueue_vector_spin)    \
200     TEST_CASE(StdPQueue_vector_mutex)   \
201     TEST_CASE(StdPQueue_deque_spin)     \
202     TEST_CASE(StdPQueue_deque_mutex)
203 #define CDUNIT_TEST_StdPQueue           \
204     CPPUNIT_TEST(StdPQueue_vector_spin) \
205     CPPUNIT_TEST(StdPQueue_vector_mutex)\
206     CPPUNIT_TEST(StdPQueue_deque_spin)  \
207     CPPUNIT_TEST(StdPQueue_deque_mutex)
208
209
210 #endif // #ifndef CDSUNIT_PQUEUE_PQUEUE_DEFS_H