Added copyright and license
[libcds.git] / tests / test-hdr / set / hdr_intrusive_skiplist_set_rcu.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 CDSTEST_HDR_INTRUSIVE_SKIPLIST_SET_RCU_H
32 #define CDSTEST_HDR_INTRUSIVE_SKIPLIST_SET_RCU_H
33
34 #include "set/hdr_intrusive_set.h"
35
36 namespace set {
37
38     class IntrusiveSkipListSetRCU: public IntrusiveHashSetHdrTest
39     {
40         typedef IntrusiveHashSetHdrTest base_class;
41
42         static size_t const c_nArrSize = 1000;
43
44         template <typename Set>
45         struct extract_disposer {
46             void operator()( typename Set::value_type * pVal ) const
47             {
48                 pVal->nVal = 0;
49             }
50         };
51
52     protected:
53         struct other_key {
54             int nKey;
55
56             other_key()
57             {}
58
59             other_key( int key )
60                 : nKey(key)
61             {}
62
63             template <typename Q>
64             other_key& operator=( Q const& src )
65             {
66                 nKey = src.nKey;
67                 return *this;
68             }
69         };
70
71         template <typename StoredType>
72         struct other_key_less
73         {
74             bool operator ()( StoredType const& n, other_key k ) const
75             {
76                 return n.nKey < k.nKey;
77             }
78             bool operator ()( other_key k, StoredType const& n ) const
79             {
80                 return k.nKey < n.nKey;
81             }
82         };
83
84         struct copy_other_key
85         {
86             template <typename Q>
87             void operator()( other_key& dest, Q const& src ) const
88             {
89                 dest.nKey = src.nKey;
90             }
91         };
92
93     protected:
94
95         template <class Set, typename PrintStat>
96         void test_skiplist()
97         {
98             {
99                 Set s;
100                 base_class::test_int_with( s );
101             }
102
103             test_skiplist_<Set, PrintStat >();
104         }
105
106         template <class Set, typename PrintStat>
107         void test_skiplist_()
108         {
109             Set s;
110             s.clear();
111             CPPUNIT_ASSERT( s.empty() );
112             CPPUNIT_ASSERT( check_size( s, 0 ));
113
114             typedef typename Set::gc::scoped_lock   rcu_lock;
115             typedef typename Set::value_type        value_type;
116             typedef typename Set::iterator          set_iterator;
117             typedef typename Set::const_iterator    const_set_iterator;
118
119             value_type  v[c_nArrSize];
120             int nCount = 0;
121             int nPrevKey = 0;
122
123             // Test iterator - ascending order
124             for ( int i = 0; i < (int) (sizeof(v)/sizeof(v[0])); ++i ) {
125                 v[i].nKey = i;
126                 v[i].nVal = i * 2;
127
128                 CPPUNIT_ASSERT( s.insert( v[i] ));
129             }
130             CPPUNIT_ASSERT( check_size( s, sizeof(v)/sizeof(v[0]) ));
131
132             //CPPUNIT_MSG( PrintStat()(s, "Iterator test, ascending insert order") );
133
134             nCount = 0;
135             nPrevKey = 0;
136             {
137                 rcu_lock l;
138                 for ( set_iterator it = s.begin(), itEnd = s.end(); it != itEnd; ++it ) {
139                     CPPUNIT_ASSERT( (*it).nKey * 2 == it->nVal );
140                     CPPUNIT_ASSERT( s.contains( it->nKey ));
141                     it->nVal = (*it).nKey;
142                     ++nCount;
143                     if ( it != s.begin() ) {
144                         CPPUNIT_ASSERT( nPrevKey + 1 == it->nKey );
145                     }
146                     nPrevKey = it->nKey;
147                 }
148             }
149             CPPUNIT_ASSERT( check_size( s, sizeof(v)/sizeof(v[0]) ));
150             CPPUNIT_ASSERT( nCount == sizeof(v)/sizeof(v[0]));
151
152             nCount = 0;
153             {
154                 rcu_lock l;
155                 for ( const_set_iterator it = s.cbegin(), itEnd = s.cend(); it != itEnd; ++it ) {
156                     CPPUNIT_ASSERT( (*it).nKey == it->nVal );
157                     ++nCount;
158                     if ( it != s.cbegin() ) {
159                         CPPUNIT_ASSERT( nPrevKey + 1 == it->nKey );
160                     }
161                     nPrevKey = it->nKey;
162                 }
163             }
164             CPPUNIT_CHECK( check_size( s, sizeof(v)/sizeof(v[0]) ));
165             CPPUNIT_CHECK( nCount == sizeof(v)/sizeof(v[0]));
166
167             for ( size_t i = 0; i < sizeof(v)/sizeof(v[0]); ++i ) {
168                 CPPUNIT_ASSERT( v[i].nKey == v[i].nVal );
169                 CPPUNIT_ASSERT( s.contains( v[i].nKey ));
170             }
171
172             s.clear();
173             CPPUNIT_CHECK( s.empty() );
174             CPPUNIT_CHECK( check_size( s, 0));
175             Set::gc::force_dispose();
176
177             for ( size_t i = 0; i < (int) sizeof(v)/sizeof(v[0]); ++i ) {
178                 CPPUNIT_CHECK( v[i].nDisposeCount == 1 );
179             }
180
181             // Test iterator - descending order
182             for ( int i = (int) sizeof(v)/sizeof(v[0]) - 1; i >= 0; --i ) {
183                 v[i].nKey = i;
184                 v[i].nVal = i * 2;
185
186                 CPPUNIT_ASSERT( s.insert( v[i] ));
187             }
188             CPPUNIT_CHECK( check_size( s, sizeof(v)/sizeof(v[0]) ));
189
190             //CPPUNIT_MSG( PrintStat()(s, "Iterator test, descending insert order") );
191
192             nCount = 0;
193             {
194                 rcu_lock l;
195                 for ( set_iterator it = s.begin(), itEnd = s.end(); it != itEnd; ++it ) {
196                     CPPUNIT_ASSERT( (*it).nKey * 2 == it->nVal );
197                     it->nVal = (*it).nKey;
198                     ++nCount;
199                     if ( it != s.begin() ) {
200                         CPPUNIT_ASSERT( nPrevKey + 1 == it->nKey );
201                     }
202                     nPrevKey = it->nKey;
203                 }
204             }
205             CPPUNIT_ASSERT( check_size( s, sizeof(v)/sizeof(v[0]) ));
206             CPPUNIT_ASSERT( nCount == sizeof(v)/sizeof(v[0]));
207
208             nCount = 0;
209             {
210                 rcu_lock l;
211                 for ( const_set_iterator it = s.cbegin(), itEnd = s.cend(); it != itEnd; ++it ) {
212                     CPPUNIT_ASSERT( (*it).nKey == it->nVal );
213                     ++nCount;
214                     if ( it != s.cbegin() ) {
215                         CPPUNIT_ASSERT( nPrevKey + 1 == it->nKey );
216                     }
217                     nPrevKey = it->nKey;
218                 }
219             }
220             CPPUNIT_ASSERT( check_size( s, sizeof(v)/sizeof(v[0]) ));
221             CPPUNIT_ASSERT( nCount == sizeof(v)/sizeof(v[0]));
222
223             for ( size_t i = 0; i < sizeof(v)/sizeof(v[0]); ++i ) {
224                 CPPUNIT_ASSERT( v[i].nKey == v[i].nVal );
225             }
226
227             s.clear();
228             CPPUNIT_ASSERT( s.empty() );
229             CPPUNIT_ASSERT( check_size( s, 0 ));
230             Set::gc::force_dispose();
231
232             for ( size_t i = 0; i < sizeof(v)/sizeof(v[0]); ++i ) {
233                 CPPUNIT_ASSERT( v[i].nDisposeCount == 2 );
234             }
235
236             // Test iterator - random order
237             fill_skiplist( s, v );
238             CPPUNIT_ASSERT( check_size( s, sizeof(v)/sizeof(v[0]) ));
239             //CPPUNIT_MSG( PrintStat()(s, "Iterator test, random insert order") );
240
241             nCount = 0;
242             {
243                 rcu_lock l;
244                 for ( set_iterator it = s.begin(), itEnd = s.end(); it != itEnd; ++it ) {
245                     CPPUNIT_ASSERT( (*it).nKey * 2 == it->nVal );
246                     it->nVal = (*it).nKey;
247                     ++nCount;
248                     if ( it != s.begin() ) {
249                         CPPUNIT_ASSERT( nPrevKey + 1 == it->nKey );
250                     }
251                     nPrevKey = it->nKey;
252                 }
253             }
254             CPPUNIT_ASSERT( check_size( s, sizeof(v)/sizeof(v[0]) ));
255             CPPUNIT_ASSERT( nCount == sizeof(v)/sizeof(v[0]));
256
257             nCount = 0;
258             {
259                 rcu_lock l;
260                 for ( const_set_iterator it = s.cbegin(), itEnd = s.cend(); it != itEnd; ++it ) {
261                     CPPUNIT_ASSERT( (*it).nKey == it->nVal );
262                     ++nCount;
263                     if ( it != s.cbegin() ) {
264                         CPPUNIT_ASSERT( nPrevKey + 1 == it->nKey );
265                     }
266                     nPrevKey = it->nKey;
267                 }
268             }
269             CPPUNIT_ASSERT( check_size( s, sizeof(v)/sizeof(v[0]) ));
270             CPPUNIT_ASSERT( nCount == sizeof(v)/sizeof(v[0]));
271
272             for ( size_t i = 0; i < sizeof(v)/sizeof(v[0]); ++i ) {
273                 CPPUNIT_ASSERT( v[i].nKey == v[i].nVal );
274             }
275
276             s.clear();
277             CPPUNIT_ASSERT( s.empty() );
278             CPPUNIT_ASSERT( check_size( s, 0 ));
279             Set::gc::force_dispose();
280
281             for ( size_t i = 0; i < sizeof(v)/sizeof(v[0]); ++i ) {
282                 CPPUNIT_ASSERT( v[i].nDisposeCount == 3 );
283             }
284
285             // extract/get test
286             {
287                 typename Set::exempt_ptr ep;
288                 typename Set::raw_ptr rp;
289                 // extract
290                 {
291                     fill_skiplist( s, v );
292
293                     for ( int i = c_nArrSize - 1; i >= 0; i -= 1 ) {
294                         {
295                             rcu_lock l;
296                             rp = s.get( i );
297                             CPPUNIT_ASSERT( rp );
298                             CPPUNIT_CHECK( rp->nKey == i );
299                             CPPUNIT_CHECK( rp->nVal == i * 2 );
300                             rp->nVal *= 2;
301                         }
302                         rp.release();
303
304                         ep = s.extract( i );
305                         CPPUNIT_ASSERT( ep );
306                         CPPUNIT_ASSERT( !ep.empty() );
307                         CPPUNIT_CHECK( ep->nKey == i );
308                         CPPUNIT_CHECK( ep->nVal == i * 4 );
309                         ep.release();
310
311                         {
312                             rcu_lock l;
313                             CPPUNIT_CHECK( !s.get( i ));
314                         }
315                         ep = s.extract( i );
316                         CPPUNIT_CHECK( !ep );
317                         CPPUNIT_ASSERT( ep.empty() );
318                     }
319                     CPPUNIT_CHECK( s.empty() );
320                 }
321                 Set::gc::force_dispose();
322
323                 // extract_with
324                 {
325                     fill_skiplist( s, v );
326                     for ( int i = c_nArrSize - 1; i >= 0; i -= 1 ) {
327                         {
328                             rcu_lock l;
329                             rp = s.get_with( other_key(i), other_key_less<typename Set::value_type>() );
330                             CPPUNIT_ASSERT( rp );
331                             CPPUNIT_CHECK( rp->nKey == i );
332                             CPPUNIT_CHECK( rp->nVal == i * 2 );
333                             rp->nVal *= 2;
334                         }
335                         rp.release();
336
337                         ep = s.extract_with( other_key( i ), other_key_less<typename Set::value_type>() );
338                         CPPUNIT_ASSERT( ep );
339                         CPPUNIT_ASSERT( !ep.empty() );
340                         CPPUNIT_CHECK( ep->nKey == i );
341                         CPPUNIT_CHECK( ep->nVal == i * 4 );
342                         ep.release();
343
344                         {
345                             rcu_lock l;
346                             CPPUNIT_CHECK( !s.get_with( other_key( i ), other_key_less<typename Set::value_type>() ));
347                         }
348                         ep = s.extract_with( other_key( i ), other_key_less<typename Set::value_type>() );
349                         CPPUNIT_CHECK( !ep );
350                     }
351                     CPPUNIT_CHECK( s.empty() );
352                 }
353                 Set::gc::force_dispose();
354
355                 // extract_min
356                 {
357                     fill_skiplist( s, v );
358                     int nPrevKey;
359
360                     ep = s.extract_min();
361                     CPPUNIT_ASSERT( ep );
362                     CPPUNIT_ASSERT( !ep.empty());
363                     nPrevKey = ep->nKey;
364                     ep.release();
365
366                     while ( !s.empty() ) {
367                         ep = s.extract_min();
368                         CPPUNIT_ASSERT( ep );
369                         CPPUNIT_ASSERT( !ep.empty());
370                         CPPUNIT_CHECK( ep->nKey == nPrevKey + 1 );
371                         CPPUNIT_CHECK( ep->nVal == (nPrevKey + 1) * 2 );
372                         nPrevKey = ep->nKey;
373                         ep.release();
374                     }
375                     ep = s.extract_min();
376                     CPPUNIT_CHECK( !ep );
377                     CPPUNIT_CHECK( !s.extract_max() );
378                 }
379                 Set::gc::force_dispose();
380
381                 // extract_max
382                 {
383                     fill_skiplist( s, v );
384                     int nPrevKey;
385
386                     ep = s.extract_max();
387                     CPPUNIT_ASSERT( ep );
388                     CPPUNIT_ASSERT( !ep.empty());
389                     nPrevKey = ep->nKey;
390                     ep.release();
391
392                     while ( !s.empty() ) {
393                         ep = s.extract_max();
394                         CPPUNIT_ASSERT( ep );
395                         CPPUNIT_ASSERT( !ep.empty());
396                         CPPUNIT_CHECK( ep->nKey == nPrevKey - 1 );
397                         CPPUNIT_CHECK( ep->nVal == (nPrevKey - 1) * 2 );
398                         nPrevKey = ep->nKey;
399                         ep.release();
400                     }
401                     ep = s.extract_min();
402                     CPPUNIT_CHECK( !ep );
403                     CPPUNIT_CHECK( !s.extract_max() );
404                 }
405                 Set::gc::force_dispose();
406             }
407
408             CPPUNIT_MSG( PrintStat()(s, nullptr) );
409         }
410
411         template <typename Set>
412         void fill_skiplist( Set& s, typename Set::value_type * pArr )
413         {
414             int nRand[c_nArrSize];
415             for ( int i = 0; i < (int) c_nArrSize; ++i ) {
416                 nRand[i] = i;
417             }
418             shuffle( nRand, nRand + c_nArrSize );
419
420             for ( int i = 0; i < (int) c_nArrSize; ++i ) {
421                 pArr[i].nKey = nRand[i];
422                 pArr[i].nVal = nRand[i] * 2;
423                 CPPUNIT_ASSERT( s.insert( pArr[i] ));
424             }
425             CPPUNIT_CHECK( check_size( s, c_nArrSize ));
426         }
427
428     public:
429
430         // Skip-list RCU
431         void skiplist_rcu_gpi_base_cmp();
432         void skiplist_rcu_gpi_base_less();
433         void skiplist_rcu_gpi_base_cmpmix();
434         void skiplist_rcu_gpi_base_cmp_stat();
435         void skiplist_rcu_gpi_base_less_stat();
436         void skiplist_rcu_gpi_base_cmpmix_stat();
437         void skiplist_rcu_gpi_base_cmp_xorshift();
438         void skiplist_rcu_gpi_base_less_xorshift();
439         void skiplist_rcu_gpi_base_cmpmix_xorshift();
440         void skiplist_rcu_gpi_base_cmp_xorshift_stat();
441         void skiplist_rcu_gpi_base_less_xorshift_stat();
442         void skiplist_rcu_gpi_base_cmpmix_xorshift_stat();
443         void skiplist_rcu_gpi_base_cmp_pascal();
444         void skiplist_rcu_gpi_base_less_pascal();
445         void skiplist_rcu_gpi_base_cmpmix_pascal();
446         void skiplist_rcu_gpi_base_cmp_pascal_stat();
447         void skiplist_rcu_gpi_base_less_pascal_stat();
448         void skiplist_rcu_gpi_base_cmpmix_pascal_stat();
449
450         void skiplist_rcu_gpi_member_cmp();
451         void skiplist_rcu_gpi_member_less();
452         void skiplist_rcu_gpi_member_cmpmix();
453         void skiplist_rcu_gpi_member_cmp_stat();
454         void skiplist_rcu_gpi_member_less_stat();
455         void skiplist_rcu_gpi_member_cmpmix_stat();
456         void skiplist_rcu_gpi_member_cmp_xorshift();
457         void skiplist_rcu_gpi_member_less_xorshift();
458         void skiplist_rcu_gpi_member_cmpmix_xorshift();
459         void skiplist_rcu_gpi_member_cmp_xorshift_stat();
460         void skiplist_rcu_gpi_member_less_xorshift_stat();
461         void skiplist_rcu_gpi_member_cmpmix_xorshift_stat();
462         void skiplist_rcu_gpi_member_cmp_pascal();
463         void skiplist_rcu_gpi_member_less_pascal();
464         void skiplist_rcu_gpi_member_cmpmix_pascal();
465         void skiplist_rcu_gpi_member_cmp_pascal_stat();
466         void skiplist_rcu_gpi_member_less_pascal_stat();
467         void skiplist_rcu_gpi_member_cmpmix_pascal_stat();
468
469         // general_buffered
470         void skiplist_rcu_gpb_base_cmp();
471         void skiplist_rcu_gpb_base_less();
472         void skiplist_rcu_gpb_base_cmpmix();
473         void skiplist_rcu_gpb_base_cmp_stat();
474         void skiplist_rcu_gpb_base_less_stat();
475         void skiplist_rcu_gpb_base_cmpmix_stat();
476         void skiplist_rcu_gpb_base_cmp_xorshift();
477         void skiplist_rcu_gpb_base_less_xorshift();
478         void skiplist_rcu_gpb_base_cmpmix_xorshift();
479         void skiplist_rcu_gpb_base_cmp_xorshift_stat();
480         void skiplist_rcu_gpb_base_less_xorshift_stat();
481         void skiplist_rcu_gpb_base_cmpmix_xorshift_stat();
482         void skiplist_rcu_gpb_base_cmp_pascal();
483         void skiplist_rcu_gpb_base_less_pascal();
484         void skiplist_rcu_gpb_base_cmpmix_pascal();
485         void skiplist_rcu_gpb_base_cmp_pascal_stat();
486         void skiplist_rcu_gpb_base_less_pascal_stat();
487         void skiplist_rcu_gpb_base_cmpmix_pascal_stat();
488
489         void skiplist_rcu_gpb_member_cmp();
490         void skiplist_rcu_gpb_member_less();
491         void skiplist_rcu_gpb_member_cmpmix();
492         void skiplist_rcu_gpb_member_cmp_stat();
493         void skiplist_rcu_gpb_member_less_stat();
494         void skiplist_rcu_gpb_member_cmpmix_stat();
495         void skiplist_rcu_gpb_member_cmp_xorshift();
496         void skiplist_rcu_gpb_member_less_xorshift();
497         void skiplist_rcu_gpb_member_cmpmix_xorshift();
498         void skiplist_rcu_gpb_member_cmp_xorshift_stat();
499         void skiplist_rcu_gpb_member_less_xorshift_stat();
500         void skiplist_rcu_gpb_member_cmpmix_xorshift_stat();
501         void skiplist_rcu_gpb_member_cmp_pascal();
502         void skiplist_rcu_gpb_member_less_pascal();
503         void skiplist_rcu_gpb_member_cmpmix_pascal();
504         void skiplist_rcu_gpb_member_cmp_pascal_stat();
505         void skiplist_rcu_gpb_member_less_pascal_stat();
506         void skiplist_rcu_gpb_member_cmpmix_pascal_stat();
507
508         // general_threaded
509         void skiplist_rcu_gpt_base_cmp();
510         void skiplist_rcu_gpt_base_less();
511         void skiplist_rcu_gpt_base_cmpmix();
512         void skiplist_rcu_gpt_base_cmp_stat();
513         void skiplist_rcu_gpt_base_less_stat();
514         void skiplist_rcu_gpt_base_cmpmix_stat();
515         void skiplist_rcu_gpt_base_cmp_xorshift();
516         void skiplist_rcu_gpt_base_less_xorshift();
517         void skiplist_rcu_gpt_base_cmpmix_xorshift();
518         void skiplist_rcu_gpt_base_cmp_xorshift_stat();
519         void skiplist_rcu_gpt_base_less_xorshift_stat();
520         void skiplist_rcu_gpt_base_cmpmix_xorshift_stat();
521         void skiplist_rcu_gpt_base_cmp_pascal();
522         void skiplist_rcu_gpt_base_less_pascal();
523         void skiplist_rcu_gpt_base_cmpmix_pascal();
524         void skiplist_rcu_gpt_base_cmp_pascal_stat();
525         void skiplist_rcu_gpt_base_less_pascal_stat();
526         void skiplist_rcu_gpt_base_cmpmix_pascal_stat();
527
528         void skiplist_rcu_gpt_member_cmp();
529         void skiplist_rcu_gpt_member_less();
530         void skiplist_rcu_gpt_member_cmpmix();
531         void skiplist_rcu_gpt_member_cmp_stat();
532         void skiplist_rcu_gpt_member_less_stat();
533         void skiplist_rcu_gpt_member_cmpmix_stat();
534         void skiplist_rcu_gpt_member_cmp_xorshift();
535         void skiplist_rcu_gpt_member_less_xorshift();
536         void skiplist_rcu_gpt_member_cmpmix_xorshift();
537         void skiplist_rcu_gpt_member_cmp_xorshift_stat();
538         void skiplist_rcu_gpt_member_less_xorshift_stat();
539         void skiplist_rcu_gpt_member_cmpmix_xorshift_stat();
540         void skiplist_rcu_gpt_member_cmp_pascal();
541         void skiplist_rcu_gpt_member_less_pascal();
542         void skiplist_rcu_gpt_member_cmpmix_pascal();
543         void skiplist_rcu_gpt_member_cmp_pascal_stat();
544         void skiplist_rcu_gpt_member_less_pascal_stat();
545         void skiplist_rcu_gpt_member_cmpmix_pascal_stat();
546
547         // signal_buffered
548         void skiplist_rcu_shb_base_cmp();
549         void skiplist_rcu_shb_base_less();
550         void skiplist_rcu_shb_base_cmpmix();
551         void skiplist_rcu_shb_base_cmp_stat();
552         void skiplist_rcu_shb_base_less_stat();
553         void skiplist_rcu_shb_base_cmpmix_stat();
554         void skiplist_rcu_shb_base_cmp_xorshift();
555         void skiplist_rcu_shb_base_less_xorshift();
556         void skiplist_rcu_shb_base_cmpmix_xorshift();
557         void skiplist_rcu_shb_base_cmp_xorshift_stat();
558         void skiplist_rcu_shb_base_less_xorshift_stat();
559         void skiplist_rcu_shb_base_cmpmix_xorshift_stat();
560         void skiplist_rcu_shb_base_cmp_pascal();
561         void skiplist_rcu_shb_base_less_pascal();
562         void skiplist_rcu_shb_base_cmpmix_pascal();
563         void skiplist_rcu_shb_base_cmp_pascal_stat();
564         void skiplist_rcu_shb_base_less_pascal_stat();
565         void skiplist_rcu_shb_base_cmpmix_pascal_stat();
566
567         void skiplist_rcu_shb_member_cmp();
568         void skiplist_rcu_shb_member_less();
569         void skiplist_rcu_shb_member_cmpmix();
570         void skiplist_rcu_shb_member_cmp_stat();
571         void skiplist_rcu_shb_member_less_stat();
572         void skiplist_rcu_shb_member_cmpmix_stat();
573         void skiplist_rcu_shb_member_cmp_xorshift();
574         void skiplist_rcu_shb_member_less_xorshift();
575         void skiplist_rcu_shb_member_cmpmix_xorshift();
576         void skiplist_rcu_shb_member_cmp_xorshift_stat();
577         void skiplist_rcu_shb_member_less_xorshift_stat();
578         void skiplist_rcu_shb_member_cmpmix_xorshift_stat();
579         void skiplist_rcu_shb_member_cmp_pascal();
580         void skiplist_rcu_shb_member_less_pascal();
581         void skiplist_rcu_shb_member_cmpmix_pascal();
582         void skiplist_rcu_shb_member_cmp_pascal_stat();
583         void skiplist_rcu_shb_member_less_pascal_stat();
584         void skiplist_rcu_shb_member_cmpmix_pascal_stat();
585
586         // signal_threaded
587         void skiplist_rcu_sht_base_cmp();
588         void skiplist_rcu_sht_base_less();
589         void skiplist_rcu_sht_base_cmpmix();
590         void skiplist_rcu_sht_base_cmp_stat();
591         void skiplist_rcu_sht_base_less_stat();
592         void skiplist_rcu_sht_base_cmpmix_stat();
593         void skiplist_rcu_sht_base_cmp_xorshift();
594         void skiplist_rcu_sht_base_less_xorshift();
595         void skiplist_rcu_sht_base_cmpmix_xorshift();
596         void skiplist_rcu_sht_base_cmp_xorshift_stat();
597         void skiplist_rcu_sht_base_less_xorshift_stat();
598         void skiplist_rcu_sht_base_cmpmix_xorshift_stat();
599         void skiplist_rcu_sht_base_cmp_pascal();
600         void skiplist_rcu_sht_base_less_pascal();
601         void skiplist_rcu_sht_base_cmpmix_pascal();
602         void skiplist_rcu_sht_base_cmp_pascal_stat();
603         void skiplist_rcu_sht_base_less_pascal_stat();
604         void skiplist_rcu_sht_base_cmpmix_pascal_stat();
605
606         void skiplist_rcu_sht_member_cmp();
607         void skiplist_rcu_sht_member_less();
608         void skiplist_rcu_sht_member_cmpmix();
609         void skiplist_rcu_sht_member_cmp_stat();
610         void skiplist_rcu_sht_member_less_stat();
611         void skiplist_rcu_sht_member_cmpmix_stat();
612         void skiplist_rcu_sht_member_cmp_xorshift();
613         void skiplist_rcu_sht_member_less_xorshift();
614         void skiplist_rcu_sht_member_cmpmix_xorshift();
615         void skiplist_rcu_sht_member_cmp_xorshift_stat();
616         void skiplist_rcu_sht_member_less_xorshift_stat();
617         void skiplist_rcu_sht_member_cmpmix_xorshift_stat();
618         void skiplist_rcu_sht_member_cmp_pascal();
619         void skiplist_rcu_sht_member_less_pascal();
620         void skiplist_rcu_sht_member_cmpmix_pascal();
621         void skiplist_rcu_sht_member_cmp_pascal_stat();
622         void skiplist_rcu_sht_member_less_pascal_stat();
623         void skiplist_rcu_sht_member_cmpmix_pascal_stat();
624
625         CPPUNIT_TEST_SUITE(IntrusiveSkipListSetRCU)
626             CPPUNIT_TEST(skiplist_rcu_gpi_base_cmp)
627             CPPUNIT_TEST(skiplist_rcu_gpi_base_less)
628             CPPUNIT_TEST(skiplist_rcu_gpi_base_cmpmix)
629             CPPUNIT_TEST(skiplist_rcu_gpi_base_cmp_stat)
630             CPPUNIT_TEST(skiplist_rcu_gpi_base_less_stat)
631             CPPUNIT_TEST(skiplist_rcu_gpi_base_cmpmix_stat)
632             CPPUNIT_TEST(skiplist_rcu_gpi_base_cmp_xorshift)
633             CPPUNIT_TEST(skiplist_rcu_gpi_base_less_xorshift)
634             CPPUNIT_TEST(skiplist_rcu_gpi_base_cmpmix_xorshift)
635             CPPUNIT_TEST(skiplist_rcu_gpi_base_cmp_xorshift_stat)
636             CPPUNIT_TEST(skiplist_rcu_gpi_base_less_xorshift_stat)
637             CPPUNIT_TEST(skiplist_rcu_gpi_base_cmpmix_xorshift_stat)
638             CPPUNIT_TEST(skiplist_rcu_gpi_base_cmp_pascal)
639             CPPUNIT_TEST(skiplist_rcu_gpi_base_less_pascal)
640             CPPUNIT_TEST(skiplist_rcu_gpi_base_cmpmix_pascal)
641             CPPUNIT_TEST(skiplist_rcu_gpi_base_cmp_pascal_stat)
642             CPPUNIT_TEST(skiplist_rcu_gpi_base_less_pascal_stat)
643             CPPUNIT_TEST(skiplist_rcu_gpi_base_cmpmix_pascal_stat)
644
645             CPPUNIT_TEST(skiplist_rcu_gpi_member_cmp)
646             CPPUNIT_TEST(skiplist_rcu_gpi_member_less)
647             CPPUNIT_TEST(skiplist_rcu_gpi_member_cmpmix)
648             CPPUNIT_TEST(skiplist_rcu_gpi_member_cmp_stat)
649             CPPUNIT_TEST(skiplist_rcu_gpi_member_less_stat)
650             CPPUNIT_TEST(skiplist_rcu_gpi_member_cmpmix_stat)
651             CPPUNIT_TEST(skiplist_rcu_gpi_member_cmp_xorshift)
652             CPPUNIT_TEST(skiplist_rcu_gpi_member_less_xorshift)
653             CPPUNIT_TEST(skiplist_rcu_gpi_member_cmpmix_xorshift)
654             CPPUNIT_TEST(skiplist_rcu_gpi_member_cmp_xorshift_stat)
655             CPPUNIT_TEST(skiplist_rcu_gpi_member_less_xorshift_stat)
656             CPPUNIT_TEST(skiplist_rcu_gpi_member_cmpmix_xorshift_stat)
657             CPPUNIT_TEST(skiplist_rcu_gpi_member_cmp_pascal)
658             CPPUNIT_TEST(skiplist_rcu_gpi_member_less_pascal)
659             CPPUNIT_TEST(skiplist_rcu_gpi_member_cmpmix_pascal)
660             CPPUNIT_TEST(skiplist_rcu_gpi_member_cmp_pascal_stat)
661             CPPUNIT_TEST(skiplist_rcu_gpi_member_less_pascal_stat)
662             CPPUNIT_TEST(skiplist_rcu_gpi_member_cmpmix_pascal_stat)
663
664             //
665             CPPUNIT_TEST(skiplist_rcu_gpb_base_cmp)
666             CPPUNIT_TEST(skiplist_rcu_gpb_base_less)
667             CPPUNIT_TEST(skiplist_rcu_gpb_base_cmpmix)
668             CPPUNIT_TEST(skiplist_rcu_gpb_base_cmp_stat)
669             CPPUNIT_TEST(skiplist_rcu_gpb_base_less_stat)
670             CPPUNIT_TEST(skiplist_rcu_gpb_base_cmpmix_stat)
671             CPPUNIT_TEST(skiplist_rcu_gpb_base_cmp_xorshift)
672             CPPUNIT_TEST(skiplist_rcu_gpb_base_less_xorshift)
673             CPPUNIT_TEST(skiplist_rcu_gpb_base_cmpmix_xorshift)
674             CPPUNIT_TEST(skiplist_rcu_gpb_base_cmp_xorshift_stat)
675             CPPUNIT_TEST(skiplist_rcu_gpb_base_less_xorshift_stat)
676             CPPUNIT_TEST(skiplist_rcu_gpb_base_cmpmix_xorshift_stat)
677             CPPUNIT_TEST(skiplist_rcu_gpb_base_cmp_pascal)
678             CPPUNIT_TEST(skiplist_rcu_gpb_base_less_pascal)
679             CPPUNIT_TEST(skiplist_rcu_gpb_base_cmpmix_pascal)
680             CPPUNIT_TEST(skiplist_rcu_gpb_base_cmp_pascal_stat)
681             CPPUNIT_TEST(skiplist_rcu_gpb_base_less_pascal_stat)
682             CPPUNIT_TEST(skiplist_rcu_gpb_base_cmpmix_pascal_stat)
683
684             CPPUNIT_TEST(skiplist_rcu_gpb_member_cmp)
685             CPPUNIT_TEST(skiplist_rcu_gpb_member_less)
686             CPPUNIT_TEST(skiplist_rcu_gpb_member_cmpmix)
687             CPPUNIT_TEST(skiplist_rcu_gpb_member_cmp_stat)
688             CPPUNIT_TEST(skiplist_rcu_gpb_member_less_stat)
689             CPPUNIT_TEST(skiplist_rcu_gpb_member_cmpmix_stat)
690             CPPUNIT_TEST(skiplist_rcu_gpb_member_cmp_xorshift)
691             CPPUNIT_TEST(skiplist_rcu_gpb_member_less_xorshift)
692             CPPUNIT_TEST(skiplist_rcu_gpb_member_cmpmix_xorshift)
693             CPPUNIT_TEST(skiplist_rcu_gpb_member_cmp_xorshift_stat)
694             CPPUNIT_TEST(skiplist_rcu_gpb_member_less_xorshift_stat)
695             CPPUNIT_TEST(skiplist_rcu_gpb_member_cmpmix_xorshift_stat)
696             CPPUNIT_TEST(skiplist_rcu_gpb_member_cmp_pascal)
697             CPPUNIT_TEST(skiplist_rcu_gpb_member_less_pascal)
698             CPPUNIT_TEST(skiplist_rcu_gpb_member_cmpmix_pascal)
699             CPPUNIT_TEST(skiplist_rcu_gpb_member_cmp_pascal_stat)
700             CPPUNIT_TEST(skiplist_rcu_gpb_member_less_pascal_stat)
701             CPPUNIT_TEST(skiplist_rcu_gpb_member_cmpmix_pascal_stat)
702
703             //
704             CPPUNIT_TEST(skiplist_rcu_gpt_base_cmp)
705             CPPUNIT_TEST(skiplist_rcu_gpt_base_less)
706             CPPUNIT_TEST(skiplist_rcu_gpt_base_cmpmix)
707             CPPUNIT_TEST(skiplist_rcu_gpt_base_cmp_stat)
708             CPPUNIT_TEST(skiplist_rcu_gpt_base_less_stat)
709             CPPUNIT_TEST(skiplist_rcu_gpt_base_cmpmix_stat)
710             CPPUNIT_TEST(skiplist_rcu_gpt_base_cmp_xorshift)
711             CPPUNIT_TEST(skiplist_rcu_gpt_base_less_xorshift)
712             CPPUNIT_TEST(skiplist_rcu_gpt_base_cmpmix_xorshift)
713             CPPUNIT_TEST(skiplist_rcu_gpt_base_cmp_xorshift_stat)
714             CPPUNIT_TEST(skiplist_rcu_gpt_base_less_xorshift_stat)
715             CPPUNIT_TEST(skiplist_rcu_gpt_base_cmpmix_xorshift_stat)
716             CPPUNIT_TEST(skiplist_rcu_gpt_base_cmp_pascal)
717             CPPUNIT_TEST(skiplist_rcu_gpt_base_less_pascal)
718             CPPUNIT_TEST(skiplist_rcu_gpt_base_cmpmix_pascal)
719             CPPUNIT_TEST(skiplist_rcu_gpt_base_cmp_pascal_stat)
720             CPPUNIT_TEST(skiplist_rcu_gpt_base_less_pascal_stat)
721             CPPUNIT_TEST(skiplist_rcu_gpt_base_cmpmix_pascal_stat)
722
723             CPPUNIT_TEST(skiplist_rcu_gpt_member_cmp)
724             CPPUNIT_TEST(skiplist_rcu_gpt_member_less)
725             CPPUNIT_TEST(skiplist_rcu_gpt_member_cmpmix)
726             CPPUNIT_TEST(skiplist_rcu_gpt_member_cmp_stat)
727             CPPUNIT_TEST(skiplist_rcu_gpt_member_less_stat)
728             CPPUNIT_TEST(skiplist_rcu_gpt_member_cmpmix_stat)
729             CPPUNIT_TEST(skiplist_rcu_gpt_member_cmp_xorshift)
730             CPPUNIT_TEST(skiplist_rcu_gpt_member_less_xorshift)
731             CPPUNIT_TEST(skiplist_rcu_gpt_member_cmpmix_xorshift)
732             CPPUNIT_TEST(skiplist_rcu_gpt_member_cmp_xorshift_stat)
733             CPPUNIT_TEST(skiplist_rcu_gpt_member_less_xorshift_stat)
734             CPPUNIT_TEST(skiplist_rcu_gpt_member_cmpmix_xorshift_stat)
735             CPPUNIT_TEST(skiplist_rcu_gpt_member_cmp_pascal)
736             CPPUNIT_TEST(skiplist_rcu_gpt_member_less_pascal)
737             CPPUNIT_TEST(skiplist_rcu_gpt_member_cmpmix_pascal)
738             CPPUNIT_TEST(skiplist_rcu_gpt_member_cmp_pascal_stat)
739             CPPUNIT_TEST(skiplist_rcu_gpt_member_less_pascal_stat)
740             CPPUNIT_TEST(skiplist_rcu_gpt_member_cmpmix_pascal_stat)
741
742             //
743             CPPUNIT_TEST(skiplist_rcu_shb_base_cmp)
744             CPPUNIT_TEST(skiplist_rcu_shb_base_less)
745             CPPUNIT_TEST(skiplist_rcu_shb_base_cmpmix)
746             CPPUNIT_TEST(skiplist_rcu_shb_base_cmp_stat)
747             CPPUNIT_TEST(skiplist_rcu_shb_base_less_stat)
748             CPPUNIT_TEST(skiplist_rcu_shb_base_cmpmix_stat)
749             CPPUNIT_TEST(skiplist_rcu_shb_base_cmp_xorshift)
750             CPPUNIT_TEST(skiplist_rcu_shb_base_less_xorshift)
751             CPPUNIT_TEST(skiplist_rcu_shb_base_cmpmix_xorshift)
752             CPPUNIT_TEST(skiplist_rcu_shb_base_cmp_xorshift_stat)
753             CPPUNIT_TEST(skiplist_rcu_shb_base_less_xorshift_stat)
754             CPPUNIT_TEST(skiplist_rcu_shb_base_cmpmix_xorshift_stat)
755             CPPUNIT_TEST(skiplist_rcu_shb_base_cmp_pascal)
756             CPPUNIT_TEST(skiplist_rcu_shb_base_less_pascal)
757             CPPUNIT_TEST(skiplist_rcu_shb_base_cmpmix_pascal)
758             CPPUNIT_TEST(skiplist_rcu_shb_base_cmp_pascal_stat)
759             CPPUNIT_TEST(skiplist_rcu_shb_base_less_pascal_stat)
760             CPPUNIT_TEST(skiplist_rcu_shb_base_cmpmix_pascal_stat)
761
762             CPPUNIT_TEST(skiplist_rcu_shb_member_cmp)
763             CPPUNIT_TEST(skiplist_rcu_shb_member_less)
764             CPPUNIT_TEST(skiplist_rcu_shb_member_cmpmix)
765             CPPUNIT_TEST(skiplist_rcu_shb_member_cmp_stat)
766             CPPUNIT_TEST(skiplist_rcu_shb_member_less_stat)
767             CPPUNIT_TEST(skiplist_rcu_shb_member_cmpmix_stat)
768             CPPUNIT_TEST(skiplist_rcu_shb_member_cmp_xorshift)
769             CPPUNIT_TEST(skiplist_rcu_shb_member_less_xorshift)
770             CPPUNIT_TEST(skiplist_rcu_shb_member_cmpmix_xorshift)
771             CPPUNIT_TEST(skiplist_rcu_shb_member_cmp_xorshift_stat)
772             CPPUNIT_TEST(skiplist_rcu_shb_member_less_xorshift_stat)
773             CPPUNIT_TEST(skiplist_rcu_shb_member_cmpmix_xorshift_stat)
774             CPPUNIT_TEST(skiplist_rcu_shb_member_cmp_pascal)
775             CPPUNIT_TEST(skiplist_rcu_shb_member_less_pascal)
776             CPPUNIT_TEST(skiplist_rcu_shb_member_cmpmix_pascal)
777             CPPUNIT_TEST(skiplist_rcu_shb_member_cmp_pascal_stat)
778             CPPUNIT_TEST(skiplist_rcu_shb_member_less_pascal_stat)
779             CPPUNIT_TEST(skiplist_rcu_shb_member_cmpmix_pascal_stat)
780
781             //
782             CPPUNIT_TEST(skiplist_rcu_sht_base_cmp)
783             CPPUNIT_TEST(skiplist_rcu_sht_base_less)
784             CPPUNIT_TEST(skiplist_rcu_sht_base_cmpmix)
785             CPPUNIT_TEST(skiplist_rcu_sht_base_cmp_stat)
786             CPPUNIT_TEST(skiplist_rcu_sht_base_less_stat)
787             CPPUNIT_TEST(skiplist_rcu_sht_base_cmpmix_stat)
788             CPPUNIT_TEST(skiplist_rcu_sht_base_cmp_xorshift)
789             CPPUNIT_TEST(skiplist_rcu_sht_base_less_xorshift)
790             CPPUNIT_TEST(skiplist_rcu_sht_base_cmpmix_xorshift)
791             CPPUNIT_TEST(skiplist_rcu_sht_base_cmp_xorshift_stat)
792             CPPUNIT_TEST(skiplist_rcu_sht_base_less_xorshift_stat)
793             CPPUNIT_TEST(skiplist_rcu_sht_base_cmpmix_xorshift_stat)
794             CPPUNIT_TEST(skiplist_rcu_sht_base_cmp_pascal)
795             CPPUNIT_TEST(skiplist_rcu_sht_base_less_pascal)
796             CPPUNIT_TEST(skiplist_rcu_sht_base_cmpmix_pascal)
797             CPPUNIT_TEST(skiplist_rcu_sht_base_cmp_pascal_stat)
798             CPPUNIT_TEST(skiplist_rcu_sht_base_less_pascal_stat)
799             CPPUNIT_TEST(skiplist_rcu_sht_base_cmpmix_pascal_stat)
800
801             CPPUNIT_TEST(skiplist_rcu_sht_member_cmp)
802             CPPUNIT_TEST(skiplist_rcu_sht_member_less)
803             CPPUNIT_TEST(skiplist_rcu_sht_member_cmpmix)
804             CPPUNIT_TEST(skiplist_rcu_sht_member_cmp_stat)
805             CPPUNIT_TEST(skiplist_rcu_sht_member_less_stat)
806             CPPUNIT_TEST(skiplist_rcu_sht_member_cmpmix_stat)
807             CPPUNIT_TEST(skiplist_rcu_sht_member_cmp_xorshift)
808             CPPUNIT_TEST(skiplist_rcu_sht_member_less_xorshift)
809             CPPUNIT_TEST(skiplist_rcu_sht_member_cmpmix_xorshift)
810             CPPUNIT_TEST(skiplist_rcu_sht_member_cmp_xorshift_stat)
811             CPPUNIT_TEST(skiplist_rcu_sht_member_less_xorshift_stat)
812             CPPUNIT_TEST(skiplist_rcu_sht_member_cmpmix_xorshift_stat)
813             CPPUNIT_TEST(skiplist_rcu_sht_member_cmp_pascal)
814             CPPUNIT_TEST(skiplist_rcu_sht_member_less_pascal)
815             CPPUNIT_TEST(skiplist_rcu_sht_member_cmpmix_pascal)
816             CPPUNIT_TEST(skiplist_rcu_sht_member_cmp_pascal_stat)
817             CPPUNIT_TEST(skiplist_rcu_sht_member_less_pascal_stat)
818             CPPUNIT_TEST(skiplist_rcu_sht_member_cmpmix_pascal_stat)
819
820         CPPUNIT_TEST_SUITE_END()
821     };
822 } // namespace set
823
824 #endif // #ifndef CDSTEST_HDR_INTRUSIVE_SKIPLIST_SET_RCU_H