3 #ifndef __CDSTEST_HDR_SET_H
4 #define __CDSTEST_HDR_SET_H
6 #include "cppunit/cppunit_proxy.h"
7 #include "size_check.h"
9 #include <cds/opt/hash.h>
10 #include <cds/os/timer.h>
11 #include <functional> // ref
12 #include <algorithm> // random_shuffle
14 // forward namespace declaration
16 namespace container {}
21 using misc::check_size;
23 namespace cc = cds::container;
24 namespace co = cds::opt;
27 class HashSetHdrTest: public CppUnitMini::TestCase
32 unsigned int nFindCount ; // count of find-functor calling
33 unsigned int nEnsureNewCount;
34 unsigned int nEnsureCount;
38 memset( this, 0, sizeof(*this));
41 void copy( stat const& s )
43 nFindCount = s.nFindCount;
44 nEnsureCount = s.nEnsureCount;
45 nEnsureNewCount = s.nEnsureNewCount;
49 struct item: public stat
62 item (int key, int val )
67 item( std::pair<int,int> const& p )
77 item& operator=(item const& i)
91 //item& operator=(item&& i)
110 size_t operator()( int i ) const
112 return co::v::hash<int>()( i );
115 size_t operator()( std::pair<int,int> const& i ) const
117 return co::v::hash<int>()( i.first );
120 template <typename Item>
121 size_t operator()( Item const& i ) const
123 return (*this)( i.key() );
127 struct simple_item_counter {
130 simple_item_counter()
149 operator size_t() const
155 template <typename T>
158 bool operator ()(const T& v1, const T& v2 ) const
160 return v1.key() < v2.key();
163 template <typename Q>
164 bool operator ()(const T& v1, const Q& v2 ) const
166 return v1.key() < v2;
169 template <typename Q>
170 bool operator ()(const Q& v1, const T& v2 ) const
172 return v1 < v2.key();
175 bool operator ()( std::pair<int, int> const& v1, const T& v2 ) const
177 return v1.first < v2.key();
180 bool operator ()(const T& v1, std::pair<int, int> const& v2 ) const
182 return v1.key() < v2.first;
189 other_item( int key )
201 template <typename T>
202 bool operator ()(T const& v1, other_item const& v2 ) const
204 return v1.key() < v2.nKey;
206 template <typename T>
207 bool operator ()(other_item const& v1, T const& v2 ) const
209 return v1.nKey < v2.key();
213 template <typename T>
215 int operator ()(const T& v1, const T& v2 ) const
217 if ( v1.key() < v2.key() )
219 return v1.key() > v2.key() ? 1 : 0;
222 template <typename Q>
223 int operator ()(const T& v1, const Q& v2 ) const
227 return v1.key() > v2 ? 1 : 0;
230 template <typename Q>
231 int operator ()(const Q& v1, const T& v2 ) const
235 return v1 > v2.key() ? 1 : 0;
238 int operator()( std::pair<int,int> const& v1, T const& v2 ) const
240 if ( v1.first < v2.key() )
242 return v1.first > v2.key() ? 1 : 0;
245 int operator()( T const& v1, std::pair<int,int> const& v2 ) const
247 if ( v1.key() < v2.first )
249 return v1.key() > v2.first ? 1 : 0;
253 template <typename T>
256 bool operator ()(const T& v1, const T& v2 ) const
258 return v1.key() == v2.key();
261 template <typename Q>
262 bool operator ()(const T& v1, const Q& v2 ) const
264 return v1.key() == v2;
267 template <typename Q>
268 bool operator ()(const Q& v1, const T& v2 ) const
270 return v1 == v2.key();
273 bool operator ()( std::pair<int, int> const& v1, const T& v2 ) const
275 return v1.first == v2.key();
278 bool operator ()(const T& v1, std::pair<int, int> const& v2 ) const
280 return v1.key() == v2.first;
286 template <typename Item, typename T>
287 void operator()( Item& i, T& val )
291 template <typename Item, typename T>
292 void operator()( Item& i, T const& val )
298 template <typename Item>
303 template <typename T>
304 void operator()( Item& i, T& /*val*/ )
309 void operator()( Item const& i )
315 struct insert_functor
317 template <typename Item>
318 void operator()(Item& i )
320 i.nVal = i.nKey * 100;
324 template <typename Item, typename Q>
325 static void ensure_func( bool bNew, Item& i, Q& /*val*/ )
333 struct ensure_functor
335 template <typename Item, typename Q>
336 void operator()( bool bNew, Item& i, Q& val )
338 ensure_func( bNew, i, val );
349 CPPUNIT_ASSERT( s.empty() );
351 const int nLimit = 100;
352 typename Set::guarded_ptr gp;
353 int arrRandom[nLimit];
354 for ( int i = 0; i < nLimit; ++i )
356 std::random_shuffle( arrRandom, arrRandom + nLimit );
358 for ( int i = 0; i < nLimit; ++i )
359 CPPUNIT_ASSERT( s.insert( arrRandom[i] ));
361 for ( int i = 0; i < nLimit; ++i ) {
362 int nKey = arrRandom[i];
363 CPPUNIT_ASSERT( s.get(gp, nKey ));
364 CPPUNIT_ASSERT( !gp.empty());
365 CPPUNIT_CHECK( gp->nKey == nKey );
366 CPPUNIT_CHECK( gp->nVal == nKey );
368 CPPUNIT_ASSERT( s.extract(gp, nKey));
369 CPPUNIT_ASSERT( !gp.empty());
370 CPPUNIT_CHECK( gp->nKey == nKey );
371 CPPUNIT_CHECK( gp->nVal == nKey );
372 CPPUNIT_CHECK( !s.get(gp, nKey));
375 CPPUNIT_CHECK( !s.extract(gp, nKey));
376 CPPUNIT_CHECK( gp.empty());
378 CPPUNIT_ASSERT( s.empty() );
381 for ( int i = 0; i < nLimit; ++i )
382 CPPUNIT_ASSERT( s.insert( arrRandom[i] ));
384 for ( int i = 0; i < nLimit; ++i ) {
385 int nKey = arrRandom[i];
386 CPPUNIT_ASSERT( s.get_with(gp, other_item(nKey), other_less() ));
387 CPPUNIT_ASSERT( !gp.empty());
388 CPPUNIT_CHECK( gp->nKey == nKey );
389 CPPUNIT_CHECK( gp->nVal == nKey );
391 CPPUNIT_ASSERT( s.extract_with(gp, other_item(nKey), other_less() ));
392 CPPUNIT_ASSERT( !gp.empty());
393 CPPUNIT_CHECK( gp->nKey == nKey );
394 CPPUNIT_CHECK( gp->nVal == nKey );
395 CPPUNIT_CHECK( !s.get_with(gp, other_item(nKey), other_less() ));
398 CPPUNIT_CHECK( !s.extract_with(gp, other_item(nKey), other_less() ));
399 CPPUNIT_CHECK( gp.empty());
401 CPPUNIT_ASSERT( s.empty() );
416 typedef typename Set::gc rcu;
417 typedef typename Set::rcu_lock rcu_lock;
418 typedef typename Set::value_type value_type;
419 typename Set::exempt_ptr ep;
421 static size_t const nLimit = 100;
423 for ( size_t i = 0; i < nLimit; ++i )
425 std::random_shuffle( arr, arr + nLimit );
427 for ( size_t i = 0; i < nLimit; ++i )
428 CPPUNIT_ASSERT( s.insert( arr[i] ));
430 for ( size_t i = 0; i < nLimit; i += 2 ) {
435 pVal = s.get( nKey );
436 CPPUNIT_ASSERT( pVal != nullptr );
437 CPPUNIT_CHECK( pVal->nKey == nKey );
438 CPPUNIT_CHECK( pVal->nVal == nKey );
440 CPPUNIT_ASSERT( s.extract( ep, nKey ));
441 CPPUNIT_ASSERT( !ep.empty() );
442 CPPUNIT_CHECK( pVal->nKey == ep->nKey );
443 CPPUNIT_CHECK( pVal->nVal == (*ep).nVal );
448 CPPUNIT_CHECK( s.get( nKey ) == nullptr );
449 CPPUNIT_CHECK( !s.extract( ep, nKey ));
450 CPPUNIT_CHECK( ep.empty() );
453 pVal = s.get_with( other_item(nKey), other_less() );
454 CPPUNIT_ASSERT( pVal != nullptr );
455 CPPUNIT_CHECK( pVal->nKey == nKey );
456 CPPUNIT_CHECK( pVal->nVal == nKey );
458 CPPUNIT_ASSERT( s.extract_with( ep, other_item(nKey), other_less() ));
459 CPPUNIT_ASSERT( !ep.empty() );
460 CPPUNIT_CHECK( pVal->nKey == ep->nKey );
461 CPPUNIT_CHECK( pVal->nVal == (*ep).nVal );
466 CPPUNIT_CHECK( s.get_with( other_item( nKey ), other_less() ) == nullptr );
467 CPPUNIT_CHECK( !s.extract_with( ep, other_item(nKey), other_less() ));
468 CPPUNIT_CHECK( ep.empty() );
471 CPPUNIT_CHECK( s.empty() );
472 CPPUNIT_CHECK( check_size( s, 0 ));
475 CPPUNIT_CHECK( s.get( int( nLimit / 2 ) ) == nullptr );
476 CPPUNIT_CHECK( !s.extract( ep, int(nLimit / 2) ));
477 CPPUNIT_CHECK( ep.empty() );
486 void test_int_with( Set& s)
488 typedef typename Set::value_type value_type;
494 CPPUNIT_ASSERT( !s.find( 10 ) );
495 CPPUNIT_ASSERT( s.insert( 10 ));
496 CPPUNIT_ASSERT( !s.empty() );
497 CPPUNIT_ASSERT( check_size( s, 1 ));
498 CPPUNIT_ASSERT( s.find( 10 ) );
500 CPPUNIT_ASSERT( !s.insert( 10 ));
501 CPPUNIT_ASSERT( !s.empty() );
502 CPPUNIT_ASSERT( check_size( s, 1 ));
504 CPPUNIT_ASSERT( !s.find_with( 20, less<value_type>() ) );
505 CPPUNIT_ASSERT( s.insert( std::make_pair(20, 25) ));
506 CPPUNIT_ASSERT( !s.empty() );
507 CPPUNIT_ASSERT( check_size( s, 2 ));
508 CPPUNIT_ASSERT( s.find_with( 10, less<value_type>() ) );
509 CPPUNIT_ASSERT( s.find( key = 20 ) );
510 CPPUNIT_ASSERT( s.find_with( key, less<value_type>(), find_functor() ) );
514 CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
515 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
516 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
517 CPPUNIT_ASSERT( f.m_found.nFindCount == 1 );
519 CPPUNIT_ASSERT( s.find( key, find_functor() ) );
523 CPPUNIT_ASSERT( s.find_with( key, less<value_type>(), std::ref( f ) ) );
524 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
525 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
526 CPPUNIT_ASSERT( f.m_found.nFindCount == 2 );
528 CPPUNIT_ASSERT( !s.empty() );
529 CPPUNIT_ASSERT( check_size( s, 2 ));
531 CPPUNIT_ASSERT( !s.find( 25 ) );
532 CPPUNIT_ASSERT( s.insert( std::make_pair(25, -1), insert_functor() ));
533 CPPUNIT_ASSERT( !s.empty() );
534 CPPUNIT_ASSERT( check_size( s, 3 ));
538 CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
539 CPPUNIT_ASSERT( f.m_found.nKey == 25 );
540 CPPUNIT_ASSERT( f.m_found.nVal == 2500 );
547 CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
548 CPPUNIT_ASSERT( f.m_found.nKey == 10 );
549 CPPUNIT_ASSERT( f.m_found.nVal == 10 );
550 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 0 );
551 CPPUNIT_ASSERT( f.m_found.nEnsureNewCount == 0 );
553 std::pair<bool, bool> ensureResult = s.ensure( key, ensure_functor() );
554 CPPUNIT_ASSERT( ensureResult.first && !ensureResult.second );
555 CPPUNIT_ASSERT( !s.empty() );
556 CPPUNIT_ASSERT( check_size( s, 3 ));
559 CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
560 CPPUNIT_ASSERT( f.m_found.nKey == 10 );
561 CPPUNIT_ASSERT( f.m_found.nVal == 10 );
562 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 1 );
563 CPPUNIT_ASSERT( f.m_found.nEnsureNewCount == 0 );
566 ensureResult = s.ensure( std::make_pair(13, 1300), ensure_functor() );
567 CPPUNIT_ASSERT( ensureResult.first && ensureResult.second );
568 CPPUNIT_ASSERT( !s.empty() );
569 CPPUNIT_ASSERT( check_size( s, 4 ));
573 CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
574 CPPUNIT_ASSERT( f.m_found.nKey == 13 );
575 CPPUNIT_ASSERT( f.m_found.nVal == 1300 );
576 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 0 );
577 CPPUNIT_ASSERT( f.m_found.nEnsureNewCount == 1 );
581 CPPUNIT_ASSERT( s.erase(13) );
582 CPPUNIT_ASSERT( !s.find( 13 ));
583 CPPUNIT_ASSERT( !s.empty() );
584 CPPUNIT_ASSERT( check_size( s, 3 ));
585 CPPUNIT_ASSERT( !s.erase(13) );
586 CPPUNIT_ASSERT( !s.empty() );
587 CPPUNIT_ASSERT( check_size( s, 3 ));
589 CPPUNIT_ASSERT( s.find( 10 ));
590 CPPUNIT_ASSERT( s.erase_with( 10, less<value_type>() ));
591 CPPUNIT_ASSERT( !s.find( 10 ));
592 CPPUNIT_ASSERT( !s.empty() );
593 CPPUNIT_ASSERT( check_size( s, 2 ));
594 CPPUNIT_ASSERT( !s.erase_with(10, less<value_type>()) );
595 CPPUNIT_ASSERT( !s.empty() );
596 CPPUNIT_ASSERT( check_size( s, 2 ));
598 CPPUNIT_ASSERT( s.find(20) );
601 CPPUNIT_ASSERT( s.erase( 20, std::ref( f ) ) );
602 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
603 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
605 CPPUNIT_ASSERT( s.insert(235))
606 CPPUNIT_ASSERT( s.erase_with( 235, less<value_type>(), std::ref( f ) ) );
607 CPPUNIT_ASSERT( f.m_found.nKey == 235 );
608 CPPUNIT_ASSERT( f.m_found.nVal == 235 );
610 CPPUNIT_ASSERT( !s.find( 20 ));
611 CPPUNIT_ASSERT( !s.empty() );
612 CPPUNIT_ASSERT( check_size( s, 1 ));
615 CPPUNIT_ASSERT( s.empty() );
616 CPPUNIT_ASSERT( check_size( s, 0 ));
619 CPPUNIT_ASSERT( s.emplace( 151 )) ; // key = 151, val = 151
620 CPPUNIT_ASSERT( s.emplace( 174, 471 )) ; // key = 174, val = 471
621 CPPUNIT_ASSERT( s.emplace( std::make_pair( 190, 91 ) )) ; // key == 190, val = 91
622 CPPUNIT_ASSERT( !s.empty() );
623 CPPUNIT_ASSERT( check_size( s, 3 ));
625 CPPUNIT_ASSERT( s.find(151));
626 CPPUNIT_ASSERT( s.find_with(174, less<value_type>()));
627 CPPUNIT_ASSERT( s.find(190));
632 CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
633 CPPUNIT_ASSERT( f.m_found.nKey == 151 );
634 CPPUNIT_ASSERT( f.m_found.nVal == 151 );
637 CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
638 CPPUNIT_ASSERT( f.m_found.nKey == 174 );
639 CPPUNIT_ASSERT( f.m_found.nVal == 471 );
642 CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
643 CPPUNIT_ASSERT( f.m_found.nKey == 190 );
644 CPPUNIT_ASSERT( f.m_found.nVal == 91 );
648 CPPUNIT_ASSERT( s.empty() );
649 CPPUNIT_ASSERT( check_size( s, 0 ));
656 typedef typename Set::value_type value_type;
657 typedef typename Set::iterator iterator;
658 typedef typename Set::const_iterator const_iterator;
664 CPPUNIT_ASSERT( s.empty() );
665 CPPUNIT_ASSERT( check_size( s, 0 ));
669 CPPUNIT_ASSERT( it != s.end() );
670 CPPUNIT_ASSERT( it->key() == 10 );
671 CPPUNIT_ASSERT( it->val() == 10 );
672 CPPUNIT_ASSERT( !s.empty() );
673 CPPUNIT_ASSERT( check_size( s, 1 ));
674 CPPUNIT_ASSERT( s.insert( 10 ) == s.end() );
676 it = s.insert( std::make_pair( 50, 25 ));
677 CPPUNIT_ASSERT( it != s.end() );
678 CPPUNIT_ASSERT( it->key() == 50 );
679 CPPUNIT_ASSERT( it->val() == 25 );
680 CPPUNIT_ASSERT( !s.empty() );
681 CPPUNIT_ASSERT( check_size( s, 2 ));
682 CPPUNIT_ASSERT( s.insert( 50 ) == s.end() );
685 std::pair< iterator, bool> ensureResult;
686 ensureResult = s.ensure( 20 );
687 CPPUNIT_ASSERT( ensureResult.first != s.end() );
688 CPPUNIT_ASSERT( ensureResult.second );
689 CPPUNIT_ASSERT( ensureResult.first->key() == 20 );
690 CPPUNIT_ASSERT( ensureResult.first->val() == 20 );
691 CPPUNIT_ASSERT( !s.empty() );
692 CPPUNIT_ASSERT( check_size( s, 3 ));
694 ensureResult = s.ensure( std::make_pair( 20, 200 ));
695 CPPUNIT_ASSERT( ensureResult.first != s.end() );
696 CPPUNIT_ASSERT( !ensureResult.second );
697 CPPUNIT_ASSERT( ensureResult.first->key() == 20 );
698 CPPUNIT_ASSERT( ensureResult.first->val() == 20 );
699 CPPUNIT_ASSERT( !s.empty() );
700 CPPUNIT_ASSERT( check_size( s, 3 ));
701 ensureResult.first->nVal = 22;
703 ensureResult = s.ensure( std::make_pair( 30, 33 ));
704 CPPUNIT_ASSERT( ensureResult.first != s.end() );
705 CPPUNIT_ASSERT( ensureResult.second );
706 CPPUNIT_ASSERT( ensureResult.first->key() == 30 );
707 CPPUNIT_ASSERT( ensureResult.first->val() == 33 );
708 CPPUNIT_ASSERT( !s.empty() );
709 CPPUNIT_ASSERT( check_size( s, 4 ));
713 CPPUNIT_ASSERT( it != s.end() );
714 CPPUNIT_ASSERT( it->key() == 10 );
715 CPPUNIT_ASSERT( it->val() == 10 );
717 it = s.find_with( 20, less<value_type>() );
718 CPPUNIT_ASSERT( it != s.end() );
719 CPPUNIT_ASSERT( it->key() == 20 );
720 CPPUNIT_ASSERT( it->val() == 22 );
723 CPPUNIT_ASSERT( it != s.end() );
724 CPPUNIT_ASSERT( it->key() == 30 );
725 CPPUNIT_ASSERT( it->val() == 33 );
728 CPPUNIT_ASSERT( it == s.end() );
731 CPPUNIT_ASSERT( it != s.end() );
732 CPPUNIT_ASSERT( it->key() == 50 );
733 CPPUNIT_ASSERT( it->val() == 25 );
736 it = s.emplace( 151 ) ; // key = 151, val = 151
737 CPPUNIT_ASSERT( it != s.end() );
738 CPPUNIT_ASSERT( it->key() == 151 );
739 CPPUNIT_ASSERT( it->val() == 151 );
741 it = s.emplace( 174, 471 ) ; // key == 174, val = 471
742 CPPUNIT_ASSERT( it != s.end() );
743 CPPUNIT_ASSERT( it->key() == 174 );
744 CPPUNIT_ASSERT( it->val() == 471 );
746 it = s.emplace( std::make_pair( 190, 91 )) ; // key == 190, val = 91
747 CPPUNIT_ASSERT( it != s.end() );
748 CPPUNIT_ASSERT( it->key() == 190 );
749 CPPUNIT_ASSERT( it->val() == 91 );
752 CPPUNIT_ASSERT( it != s.end() );
753 CPPUNIT_ASSERT( it->key() == 174 );
754 CPPUNIT_ASSERT( it->val() == 471 );
756 it = s.find_with( 190, less<value_type>() );
757 CPPUNIT_ASSERT( it != s.end() );
758 CPPUNIT_ASSERT( it->key() == 190 );
759 CPPUNIT_ASSERT( it->val() == 91 );
762 CPPUNIT_ASSERT( it != s.end() );
763 CPPUNIT_ASSERT( it->key() == 151 );
764 CPPUNIT_ASSERT( it->val() == 151 );
767 //CPPUNIT_ASSERT( s.empty() );
768 //CPPUNIT_ASSERT( check_size( s, 0 ));
775 for ( int i = 0; i < 500; ++i ) {
776 CPPUNIT_ASSERT( s.insert( std::make_pair( i, i * 2) ) != s.end() );
778 for ( iterator it = s.begin(), itEnd = s.end(); it != itEnd; ++it ) {
779 CPPUNIT_ASSERT( (*it).nKey * 2 == it->nVal );
780 it->nVal = (*it).nKey;
783 Set const& refSet = s;
784 for ( const_iterator it = refSet.begin(), itEnd = refSet.end(); it != itEnd; ++it ) {
785 CPPUNIT_ASSERT( (*it).nKey == it->nVal );
793 typedef typename Set::value_type value_type;
794 typedef typename Set::iterator iterator;
795 typedef typename Set::const_iterator const_iterator;
799 const size_t nMaxCount = 500;
800 for ( int i = 0; size_t(i) < nMaxCount; ++i ) {
801 CPPUNIT_ASSERT( s.insert( std::make_pair( i, i * 2) ));
804 for ( iterator it = s.begin(), itEnd = s.end(); it != itEnd; ++it ) {
805 CPPUNIT_ASSERT_EX( (*it).nKey * 2 == it->nVal,
806 "Step " << nCount << ": Iterator key=" << it->nKey << ", value expected=" << it->nKey * 2 << ", value real=" << it->nVal
808 it->nVal = (*it).nKey;
811 CPPUNIT_ASSERT( nCount == nMaxCount );
814 Set const& refSet = s;
815 for ( const_iterator it = refSet.begin(), itEnd = refSet.end(); it != itEnd; ++it ) {
816 CPPUNIT_ASSERT_EX( (*it).nKey == it->nVal,
817 "Step " << nCount << ": Iterator key=" << it->nKey << ", value expected=" << it->nKey << ", value real=" << it->nVal
821 CPPUNIT_ASSERT( nCount == nMaxCount );
824 void Michael_HP_cmp();
825 void Michael_HP_less();
826 void Michael_HP_cmpmix();
828 void Michael_PTB_cmp();
829 void Michael_PTB_less();
830 void Michael_PTB_cmpmix();
832 void Michael_RCU_GPI_cmp();
833 void Michael_RCU_GPI_less();
834 void Michael_RCU_GPI_cmpmix();
836 void Michael_RCU_GPT_cmp();
837 void Michael_RCU_GPT_less();
838 void Michael_RCU_GPT_cmpmix();
840 void Michael_RCU_GPB_cmp();
841 void Michael_RCU_GPB_less();
842 void Michael_RCU_GPB_cmpmix();
844 void Michael_RCU_SHT_cmp();
845 void Michael_RCU_SHT_less();
846 void Michael_RCU_SHT_cmpmix();
848 void Michael_RCU_SHB_cmp();
849 void Michael_RCU_SHB_less();
850 void Michael_RCU_SHB_cmpmix();
852 void Michael_nogc_cmp();
853 void Michael_nogc_less();
854 void Michael_nogc_cmpmix();
858 void Lazy_HP_cmpmix();
861 void Lazy_PTB_less();
862 void Lazy_PTB_cmpmix();
864 void Lazy_RCU_GPI_cmp();
865 void Lazy_RCU_GPI_less();
866 void Lazy_RCU_GPI_cmpmix();
868 void Lazy_RCU_GPB_cmp();
869 void Lazy_RCU_GPB_less();
870 void Lazy_RCU_GPB_cmpmix();
872 void Lazy_RCU_GPT_cmp();
873 void Lazy_RCU_GPT_less();
874 void Lazy_RCU_GPT_cmpmix();
876 void Lazy_RCU_SHB_cmp();
877 void Lazy_RCU_SHB_less();
878 void Lazy_RCU_SHB_cmpmix();
880 void Lazy_RCU_SHT_cmp();
881 void Lazy_RCU_SHT_less();
882 void Lazy_RCU_SHT_cmpmix();
884 void Lazy_nogc_cmp();
885 void Lazy_nogc_less();
886 void Lazy_nogc_cmpmix();
889 void Split_HP_less();
890 void Split_HP_cmpmix();
892 void Split_PTB_cmp();
893 void Split_PTB_less();
894 void Split_PTB_cmpmix();
896 void Split_RCU_GPI_cmp();
897 void Split_RCU_GPI_less();
898 void Split_RCU_GPI_cmpmix();
900 void Split_RCU_GPB_cmp();
901 void Split_RCU_GPB_less();
902 void Split_RCU_GPB_cmpmix();
904 void Split_RCU_GPT_cmp();
905 void Split_RCU_GPT_less();
906 void Split_RCU_GPT_cmpmix();
908 void Split_RCU_SHB_cmp();
909 void Split_RCU_SHB_less();
910 void Split_RCU_SHB_cmpmix();
912 void Split_RCU_SHT_cmp();
913 void Split_RCU_SHT_less();
914 void Split_RCU_SHT_cmpmix();
916 void Split_nogc_cmp();
917 void Split_nogc_less();
918 void Split_nogc_cmpmix();
921 void Split_Lazy_HP_cmp();
922 void Split_Lazy_HP_less();
923 void Split_Lazy_HP_cmpmix();
925 void Split_Lazy_PTB_cmp();
926 void Split_Lazy_PTB_less();
927 void Split_Lazy_PTB_cmpmix();
929 void Split_Lazy_RCU_GPI_cmp();
930 void Split_Lazy_RCU_GPI_less();
931 void Split_Lazy_RCU_GPI_cmpmix();
933 void Split_Lazy_RCU_GPB_cmp();
934 void Split_Lazy_RCU_GPB_less();
935 void Split_Lazy_RCU_GPB_cmpmix();
937 void Split_Lazy_RCU_GPT_cmp();
938 void Split_Lazy_RCU_GPT_less();
939 void Split_Lazy_RCU_GPT_cmpmix();
941 void Split_Lazy_RCU_SHB_cmp();
942 void Split_Lazy_RCU_SHB_less();
943 void Split_Lazy_RCU_SHB_cmpmix();
945 void Split_Lazy_RCU_SHT_cmp();
946 void Split_Lazy_RCU_SHT_less();
947 void Split_Lazy_RCU_SHT_cmpmix();
949 void Split_Lazy_nogc_cmp();
950 void Split_Lazy_nogc_less();
951 void Split_Lazy_nogc_cmpmix();
953 CPPUNIT_TEST_SUITE(HashSetHdrTest)
954 CPPUNIT_TEST(Michael_HP_cmp)
955 CPPUNIT_TEST(Michael_HP_less)
956 CPPUNIT_TEST(Michael_HP_cmpmix)
958 CPPUNIT_TEST(Michael_PTB_cmp)
959 CPPUNIT_TEST(Michael_PTB_less)
960 CPPUNIT_TEST(Michael_PTB_cmpmix)
962 CPPUNIT_TEST(Michael_RCU_GPI_cmp)
963 CPPUNIT_TEST(Michael_RCU_GPI_less)
964 CPPUNIT_TEST(Michael_RCU_GPI_cmpmix)
966 CPPUNIT_TEST(Michael_RCU_GPB_cmp)
967 CPPUNIT_TEST(Michael_RCU_GPB_less)
968 CPPUNIT_TEST(Michael_RCU_GPB_cmpmix)
970 CPPUNIT_TEST(Michael_RCU_GPT_cmp)
971 CPPUNIT_TEST(Michael_RCU_GPT_less)
972 CPPUNIT_TEST(Michael_RCU_GPT_cmpmix)
974 CPPUNIT_TEST(Michael_RCU_SHB_cmp)
975 CPPUNIT_TEST(Michael_RCU_SHB_less)
976 CPPUNIT_TEST(Michael_RCU_SHB_cmpmix)
978 CPPUNIT_TEST(Michael_RCU_SHT_cmp)
979 CPPUNIT_TEST(Michael_RCU_SHT_less)
980 CPPUNIT_TEST(Michael_RCU_SHT_cmpmix)
982 CPPUNIT_TEST(Michael_nogc_cmp)
983 CPPUNIT_TEST(Michael_nogc_less)
984 CPPUNIT_TEST(Michael_nogc_cmpmix)
986 CPPUNIT_TEST(Lazy_HP_cmp)
987 CPPUNIT_TEST(Lazy_HP_less)
988 CPPUNIT_TEST(Lazy_HP_cmpmix)
990 CPPUNIT_TEST(Lazy_PTB_cmp)
991 CPPUNIT_TEST(Lazy_PTB_less)
992 CPPUNIT_TEST(Lazy_PTB_cmpmix)
994 CPPUNIT_TEST(Lazy_RCU_GPI_cmp)
995 CPPUNIT_TEST(Lazy_RCU_GPI_less)
996 CPPUNIT_TEST(Lazy_RCU_GPI_cmpmix)
998 CPPUNIT_TEST(Lazy_RCU_GPB_cmp)
999 CPPUNIT_TEST(Lazy_RCU_GPB_less)
1000 CPPUNIT_TEST(Lazy_RCU_GPB_cmpmix)
1002 CPPUNIT_TEST(Lazy_RCU_GPT_cmp)
1003 CPPUNIT_TEST(Lazy_RCU_GPT_less)
1004 CPPUNIT_TEST(Lazy_RCU_GPT_cmpmix)
1006 CPPUNIT_TEST(Lazy_RCU_SHB_cmp)
1007 CPPUNIT_TEST(Lazy_RCU_SHB_less)
1008 CPPUNIT_TEST(Lazy_RCU_SHB_cmpmix)
1010 CPPUNIT_TEST(Lazy_RCU_SHT_cmp)
1011 CPPUNIT_TEST(Lazy_RCU_SHT_less)
1012 CPPUNIT_TEST(Lazy_RCU_SHT_cmpmix)
1014 CPPUNIT_TEST(Lazy_nogc_cmp)
1015 CPPUNIT_TEST(Lazy_nogc_less)
1016 CPPUNIT_TEST(Lazy_nogc_cmpmix)
1018 CPPUNIT_TEST(Split_HP_cmp)
1019 CPPUNIT_TEST(Split_HP_less)
1020 CPPUNIT_TEST(Split_HP_cmpmix)
1022 CPPUNIT_TEST(Split_PTB_cmp)
1023 CPPUNIT_TEST(Split_PTB_less)
1024 CPPUNIT_TEST(Split_PTB_cmpmix)
1026 CPPUNIT_TEST(Split_RCU_GPI_cmp)
1027 CPPUNIT_TEST(Split_RCU_GPI_less)
1028 CPPUNIT_TEST(Split_RCU_GPI_cmpmix)
1030 CPPUNIT_TEST(Split_RCU_GPB_cmp)
1031 CPPUNIT_TEST(Split_RCU_GPB_less)
1032 CPPUNIT_TEST(Split_RCU_GPB_cmpmix)
1034 CPPUNIT_TEST(Split_RCU_GPT_cmp)
1035 CPPUNIT_TEST(Split_RCU_GPT_less)
1036 CPPUNIT_TEST(Split_RCU_GPT_cmpmix)
1038 CPPUNIT_TEST(Split_RCU_SHB_cmp)
1039 CPPUNIT_TEST(Split_RCU_SHB_less)
1040 CPPUNIT_TEST(Split_RCU_SHB_cmpmix)
1042 CPPUNIT_TEST(Split_RCU_SHT_cmp)
1043 CPPUNIT_TEST(Split_RCU_SHT_less)
1044 CPPUNIT_TEST(Split_RCU_SHT_cmpmix)
1046 CPPUNIT_TEST(Split_nogc_cmp)
1047 CPPUNIT_TEST(Split_nogc_less)
1048 CPPUNIT_TEST(Split_nogc_cmpmix)
1050 CPPUNIT_TEST(Split_Lazy_HP_cmp)
1051 CPPUNIT_TEST(Split_Lazy_HP_less)
1052 CPPUNIT_TEST(Split_Lazy_HP_cmpmix)
1054 CPPUNIT_TEST(Split_Lazy_PTB_cmp)
1055 CPPUNIT_TEST(Split_Lazy_PTB_less)
1056 CPPUNIT_TEST(Split_Lazy_PTB_cmpmix)
1058 CPPUNIT_TEST(Split_Lazy_RCU_GPI_cmp)
1059 CPPUNIT_TEST(Split_Lazy_RCU_GPI_less)
1060 CPPUNIT_TEST(Split_Lazy_RCU_GPI_cmpmix)
1062 CPPUNIT_TEST(Split_Lazy_RCU_GPB_cmp)
1063 CPPUNIT_TEST(Split_Lazy_RCU_GPB_less)
1064 CPPUNIT_TEST(Split_Lazy_RCU_GPB_cmpmix)
1066 CPPUNIT_TEST(Split_Lazy_RCU_GPT_cmp)
1067 CPPUNIT_TEST(Split_Lazy_RCU_GPT_less)
1068 CPPUNIT_TEST(Split_Lazy_RCU_GPT_cmpmix)
1070 CPPUNIT_TEST(Split_Lazy_RCU_SHB_cmp)
1071 CPPUNIT_TEST(Split_Lazy_RCU_SHB_less)
1072 CPPUNIT_TEST(Split_Lazy_RCU_SHB_cmpmix)
1074 CPPUNIT_TEST(Split_Lazy_RCU_SHT_cmp)
1075 CPPUNIT_TEST(Split_Lazy_RCU_SHT_less)
1076 CPPUNIT_TEST(Split_Lazy_RCU_SHT_cmpmix)
1078 CPPUNIT_TEST(Split_Lazy_nogc_cmp)
1079 CPPUNIT_TEST(Split_Lazy_nogc_less)
1080 CPPUNIT_TEST(Split_Lazy_nogc_cmpmix)
1082 CPPUNIT_TEST_SUITE_END()
1088 #endif // __CDSTEST_HDR_SET_H