3 #ifndef CDSTEST_HDR_MAP_H
4 #define CDSTEST_HDR_MAP_H
5 #include "size_check.h"
7 #include "cppunit/cppunit_proxy.h"
8 #include <cds/os/timer.h>
9 #include <cds/opt/hash.h>
10 #include <functional> // ref
11 #include <algorithm> // random_shuffle
13 namespace cds { namespace container {}}
16 using misc::check_size;
18 namespace cc = cds::container;
19 namespace co = cds::opt;
21 // MichaelHashSet based on MichaelList
22 class HashMapHdrTest: public CppUnitMini::TestCase
38 value_type( value_type&& v )
42 value_type( value_type const& v )
46 value_type& operator=( value_type const& v )
53 typedef std::pair<key_type const, value_type> pair_type;
57 bool operator ()(int v1, int v2 ) const
64 int operator ()(int v1, int v2 ) const
68 return v1 > v2 ? 1 : 0;
73 bool operator ()(int v1, int v2 ) const
80 size_t operator()( int i ) const
82 return co::v::hash<int>()( i );
86 size_t operator()( T const& i ) const
88 return co::v::hash<int>()( i.nKey );
92 struct simple_item_counter {
114 operator size_t() const
120 template <typename Map>
121 struct insert_functor
123 typedef typename Map::value_type pair_type;
126 void operator()( pair_type& item )
128 item.second.m_val = item.first * 3;
132 void operator()( bool bNew, pair_type& item )
135 item.second.m_val = item.first * 2;
137 item.second.m_val = item.first * 5;
144 check_value( int nExpected )
145 : m_nExpected( nExpected )
148 template <typename T>
149 void operator ()( T& pair )
151 CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected );
153 template <typename T, typename Q>
154 void operator ()( T& pair, Q )
156 CPPUNIT_ASSERT_CURRENT( pair.second.m_val == m_nExpected );
160 struct extract_functor
163 void operator()( pair_type const& val )
165 *m_pVal = val.second.m_val;
172 other_item( int key )
179 bool operator ()(int v1, other_item const& v2 ) const
183 bool operator ()(other_item const& v1, int v2 ) const
198 CPPUNIT_ASSERT( m.empty() );
200 const int nLimit = 100;
201 typename Map::guarded_ptr gp;
202 int arrRandom[nLimit];
203 for ( int i = 0; i < nLimit; ++i )
205 std::random_shuffle( arrRandom, arrRandom + nLimit );
207 for ( int i = 0; i < nLimit; ++i )
208 CPPUNIT_ASSERT( m.insert( arrRandom[i], arrRandom[i] ));
210 for ( int i = 0; i < nLimit; ++i ) {
211 int nKey = arrRandom[i];
213 CPPUNIT_ASSERT( gp );
214 CPPUNIT_ASSERT( !gp.empty());
215 CPPUNIT_CHECK( gp->first == nKey );
216 CPPUNIT_CHECK( gp->second.m_val == nKey );
219 gp = m.extract( nKey );
220 CPPUNIT_ASSERT( gp );
221 CPPUNIT_ASSERT( !gp.empty());
222 CPPUNIT_CHECK( gp->first == nKey );
223 CPPUNIT_CHECK( gp->second.m_val == nKey );
227 CPPUNIT_CHECK( !gp );
229 CPPUNIT_CHECK( !m.extract(nKey));
230 CPPUNIT_CHECK( gp.empty());
232 CPPUNIT_ASSERT( m.empty() );
234 for ( int i = 0; i < nLimit; ++i )
235 CPPUNIT_ASSERT( m.insert( arrRandom[i], arrRandom[i] ));
237 for ( int i = 0; i < nLimit; ++i ) {
238 int nKey = arrRandom[i];
239 gp = m.get_with( other_item( nKey ), other_less() );
240 CPPUNIT_ASSERT( gp );
241 CPPUNIT_ASSERT( !gp.empty());
242 CPPUNIT_CHECK( gp->first == nKey );
243 CPPUNIT_CHECK( gp->second.m_val == nKey );
246 gp = m.extract_with( other_item( nKey ), other_less() );
247 CPPUNIT_ASSERT( gp );
248 CPPUNIT_ASSERT( !gp.empty());
249 CPPUNIT_CHECK( gp->first == nKey );
250 CPPUNIT_CHECK( gp->second.m_val == nKey );
253 gp = m.get_with( other_item( nKey ), other_less() );
254 CPPUNIT_CHECK( !gp );
256 CPPUNIT_CHECK( !m.extract_with(other_item(nKey), other_less() ));
257 CPPUNIT_CHECK( gp.empty());
259 CPPUNIT_ASSERT( m.empty() );
275 typedef typename Map::gc rcu;
276 typedef typename Map::rcu_lock rcu_lock;
277 typedef typename Map::value_type value_type;
278 typename Map::exempt_ptr ep;
280 static size_t const nLimit = 100;
282 for ( size_t i = 0; i < nLimit; ++i )
284 std::random_shuffle( arr, arr + nLimit );
286 for ( size_t i = 0; i < nLimit; ++i )
287 CPPUNIT_ASSERT( m.insert( arr[i], arr[i] ));
289 for ( size_t i = 0; i < nLimit; i += 2 ) {
294 pVal = m.get( nKey );
295 CPPUNIT_ASSERT( pVal != nullptr );
296 CPPUNIT_CHECK( pVal->first == nKey );
297 CPPUNIT_CHECK( pVal->second.m_val == nKey );
299 ep = m.extract( nKey );
300 CPPUNIT_ASSERT( ep );
301 CPPUNIT_ASSERT( !ep.empty() );
302 CPPUNIT_CHECK( pVal->first == ep->first );
303 CPPUNIT_CHECK( pVal->second.m_val == ep->second.m_val );
308 CPPUNIT_CHECK( m.get( nKey ) == nullptr );
309 ep = m.extract( nKey );
310 CPPUNIT_CHECK( !ep );
311 CPPUNIT_CHECK( ep.empty() );
314 pVal = m.get_with( other_item(nKey), other_less() );
315 CPPUNIT_ASSERT( pVal != nullptr );
316 CPPUNIT_CHECK( pVal->first == nKey );
317 CPPUNIT_CHECK( pVal->second.m_val == nKey );
319 ep = m.extract_with( other_item( nKey ), other_less() );
320 CPPUNIT_ASSERT( ep );
321 CPPUNIT_ASSERT( !ep.empty() );
322 CPPUNIT_CHECK( pVal->first == ep->first );
323 CPPUNIT_CHECK( pVal->second.m_val == (*ep).second.m_val );
328 CPPUNIT_CHECK( m.get_with( other_item(nKey), other_less() ) == nullptr );
329 CPPUNIT_CHECK( !m.extract_with( other_item(nKey), other_less() ));
330 CPPUNIT_CHECK( ep.empty() );
333 CPPUNIT_CHECK( m.empty() );
334 CPPUNIT_CHECK( check_size( m, 0 ));
337 CPPUNIT_CHECK( m.get( int(nLimit / 2) ) == nullptr );
338 ep = m.extract( int( nLimit / 2 ) );
339 CPPUNIT_CHECK( !ep );
340 CPPUNIT_CHECK( ep.empty() );
349 void test_int_with( Map& m )
351 std::pair<bool, bool> ensureResult;
354 CPPUNIT_ASSERT( m.empty() );
355 CPPUNIT_ASSERT( check_size( m, 0 ));
356 CPPUNIT_ASSERT( !m.find(25) );
357 CPPUNIT_ASSERT( m.insert( 25 ) ) ; // value = 0
358 CPPUNIT_ASSERT( m.find(25) );
359 CPPUNIT_ASSERT( !m.empty() );
360 CPPUNIT_ASSERT( check_size( m, 1 ));
361 CPPUNIT_ASSERT( m.find(25) );
363 CPPUNIT_ASSERT( !m.insert( 25 ) );
364 CPPUNIT_ASSERT( !m.empty() );
365 CPPUNIT_ASSERT( check_size( m, 1 ));
367 CPPUNIT_ASSERT( !m.find_with(10, less()) );
368 CPPUNIT_ASSERT( m.insert( 10, 10 ) );
369 CPPUNIT_ASSERT( !m.empty() );
370 CPPUNIT_ASSERT( check_size( m, 2 ));
371 CPPUNIT_ASSERT( m.find_with(10, less()) );
373 CPPUNIT_ASSERT( !m.insert( 10, 20 ) );
374 CPPUNIT_ASSERT( !m.empty() );
375 CPPUNIT_ASSERT( check_size( m, 2 ));
377 CPPUNIT_ASSERT( !m.find(30) );
378 CPPUNIT_ASSERT( m.insert_with( 30, insert_functor<Map>() ) ) ; // value = 90
379 CPPUNIT_ASSERT( !m.empty() );
380 CPPUNIT_ASSERT( check_size( m, 3 ));
381 CPPUNIT_ASSERT( m.find(30) );
383 CPPUNIT_ASSERT( !m.insert_with( 10, insert_functor<Map>() ) );
384 CPPUNIT_ASSERT( !m.insert_with( 25, insert_functor<Map>() ) );
385 CPPUNIT_ASSERT( !m.insert_with( 30, insert_functor<Map>() ) );
388 CPPUNIT_ASSERT( !m.find(27) );
389 ensureResult = m.ensure( 27, insert_functor<Map>() ) ; // value = 54
390 CPPUNIT_ASSERT( ensureResult.first );
391 CPPUNIT_ASSERT( ensureResult.second );
392 CPPUNIT_ASSERT( m.find(27) );
396 CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
398 CPPUNIT_ASSERT( m.find_with( 25, less(), std::ref( chk ) ) );
399 chk.m_nExpected = 90;
400 CPPUNIT_ASSERT( m.find( 30, std::ref( chk ) ) );
401 chk.m_nExpected = 54;
402 CPPUNIT_ASSERT( m.find( 27, std::ref( chk ) ) );
404 ensureResult = m.ensure( 10, insert_functor<Map>() ) ; // value = 50
405 CPPUNIT_ASSERT( ensureResult.first );
406 CPPUNIT_ASSERT( !ensureResult.second );
407 chk.m_nExpected = 50;
408 CPPUNIT_ASSERT( m.find( 10, std::ref( chk ) ) );
411 CPPUNIT_ASSERT( !m.find(100) );
412 CPPUNIT_ASSERT( !m.erase( 100 )) ; // not found
414 CPPUNIT_ASSERT( m.find(25) );
415 CPPUNIT_ASSERT( check_size( m, 4 ));
416 CPPUNIT_ASSERT( m.erase( 25 ));
417 CPPUNIT_ASSERT( !m.empty() );
418 CPPUNIT_ASSERT( check_size( m, 3 ));
419 CPPUNIT_ASSERT( !m.find(25) );
420 CPPUNIT_ASSERT( !m.erase( 25 ));
422 CPPUNIT_ASSERT( !m.find(258) );
423 CPPUNIT_ASSERT( m.insert(258))
424 CPPUNIT_ASSERT( check_size( m, 4 ));
425 CPPUNIT_ASSERT( m.find_with(258, less()) );
426 CPPUNIT_ASSERT( m.erase_with( 258, less() ));
427 CPPUNIT_ASSERT( !m.empty() );
428 CPPUNIT_ASSERT( check_size( m, 3 ));
429 CPPUNIT_ASSERT( !m.find(258) );
430 CPPUNIT_ASSERT( !m.erase_with( 258, less() ));
436 CPPUNIT_ASSERT( !m.find(29) );
437 CPPUNIT_ASSERT( m.insert(29, 290));
438 CPPUNIT_ASSERT( check_size( m, 4 ));
439 CPPUNIT_ASSERT( m.erase_with( 29, less(), std::ref( ext ) ) );
440 CPPUNIT_ASSERT( !m.empty() );
441 CPPUNIT_ASSERT( check_size( m, 3 ));
442 CPPUNIT_ASSERT( nVal == 290 );
444 CPPUNIT_ASSERT( !m.erase_with( 29, less(), std::ref( ext ) ) );
445 CPPUNIT_ASSERT( nVal == -1 );
447 CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) );
448 CPPUNIT_ASSERT( !m.empty() );
449 CPPUNIT_ASSERT( check_size( m, 2 ));
450 CPPUNIT_ASSERT( nVal == 90 );
452 CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) );
453 CPPUNIT_ASSERT( nVal == -1 );
456 CPPUNIT_ASSERT( m.empty() );
457 CPPUNIT_ASSERT( check_size( m, 0 ));
460 CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0
461 CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731
462 CPPUNIT_ASSERT( m.emplace( 149, value_type(941) )) ; // key = 149, val = 941
464 CPPUNIT_ASSERT( !m.empty() );
465 CPPUNIT_ASSERT( check_size( m, 3 ));
468 CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
469 chk.m_nExpected = 731;
470 CPPUNIT_ASSERT( m.find_with( 137, less(), std::ref(chk) ));
471 chk.m_nExpected = 941;
472 CPPUNIT_ASSERT( m.find( 149, std::ref(chk) ));
474 CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map
476 CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
477 CPPUNIT_ASSERT( !m.empty() );
478 CPPUNIT_ASSERT( check_size( m, 3 ));
481 CPPUNIT_ASSERT( m.empty() );
482 CPPUNIT_ASSERT( check_size( m, 0 ));
489 typedef typename Map::iterator iterator;
490 typedef typename Map::const_iterator const_iterator;
495 CPPUNIT_ASSERT( m.empty() );
496 CPPUNIT_ASSERT( check_size( m, 0 ));
498 CPPUNIT_ASSERT( m.find(10) == m.end() );
499 iterator it = m.insert( 10 );
500 CPPUNIT_ASSERT( it != m.end() );
501 CPPUNIT_ASSERT( !m.empty() );
502 CPPUNIT_ASSERT( check_size( m, 1 ));
503 CPPUNIT_ASSERT( m.find(10) == it );
504 CPPUNIT_ASSERT( it->first == 10 );
505 CPPUNIT_ASSERT( it->second.m_val == 0 );
507 CPPUNIT_ASSERT( m.find(100) == m.end() );
508 it = m.insert( 100, 200 );
509 CPPUNIT_ASSERT( it != m.end() );
510 CPPUNIT_ASSERT( !m.empty() );
511 CPPUNIT_ASSERT( check_size( m, 2 ));
512 CPPUNIT_ASSERT( m.find_with(100, less()) == it );
513 CPPUNIT_ASSERT( it->first == 100 );
514 CPPUNIT_ASSERT( it->second.m_val == 200 );
516 CPPUNIT_ASSERT( m.find(55) == m.end() );
517 it = m.insert_with( 55, insert_functor<Map>() );
518 CPPUNIT_ASSERT( it != m.end() );
519 CPPUNIT_ASSERT( !m.empty() );
520 CPPUNIT_ASSERT( check_size( m, 3 ));
521 CPPUNIT_ASSERT( m.find(55) == it );
522 CPPUNIT_ASSERT( it->first == 55 );
523 CPPUNIT_ASSERT( it->second.m_val == 55 * 3 );
525 CPPUNIT_ASSERT( m.insert( 55 ) == m.end() );
526 CPPUNIT_ASSERT( m.insert( 55, 10 ) == m.end() );
527 CPPUNIT_ASSERT( m.insert_with( 55, insert_functor<Map>()) == m.end() );
529 CPPUNIT_ASSERT( m.find(10) != m.end() );
530 std::pair<iterator, bool> ensureResult = m.ensure( 10 );
531 CPPUNIT_ASSERT( ensureResult.first != m.end() );
532 CPPUNIT_ASSERT( !ensureResult.second );
533 CPPUNIT_ASSERT( !m.empty() );
534 ensureResult.first->second.m_val = ensureResult.first->first * 5;
535 CPPUNIT_ASSERT( check_size( m, 3 ));
536 CPPUNIT_ASSERT( m.find(10) == ensureResult.first );
538 CPPUNIT_ASSERT( it != m.end() );
539 CPPUNIT_ASSERT( it->second.m_val == 50 );
541 CPPUNIT_ASSERT( m.find(120) == m.end() );
542 ensureResult = m.ensure( 120 );
543 CPPUNIT_ASSERT( ensureResult.first != m.end() );
544 CPPUNIT_ASSERT( ensureResult.second );
545 CPPUNIT_ASSERT( !m.empty() );
546 CPPUNIT_ASSERT( check_size( m, 4 ));
547 ensureResult.first->second.m_val = ensureResult.first->first * 5;
548 CPPUNIT_ASSERT( m.find_with(120, less()) == ensureResult.first );
549 it = m.find_with(120, less());
550 CPPUNIT_ASSERT( it != m.end() );
551 CPPUNIT_ASSERT( it->second.m_val == 120 * 5 );
552 CPPUNIT_ASSERT( m.find_with(120, less()) == m.find(120) );
555 it = m.emplace( 151 ) ; // key = 151, val = 0
556 CPPUNIT_ASSERT( it != m.end() );
557 CPPUNIT_ASSERT( it->first == 151 );
558 CPPUNIT_ASSERT( it->second.m_val == 0 );
560 it = m.emplace( 174, 471 ) ; // key == 174, val = 471
561 CPPUNIT_ASSERT( it != m.end() );
562 CPPUNIT_ASSERT( it->first == 174 );
563 CPPUNIT_ASSERT( it->second.m_val == 471 );
565 it = m.emplace( 190, value_type(91)) ; // key == 190, val = 19
566 CPPUNIT_ASSERT( it != m.end() );
567 CPPUNIT_ASSERT( it->first == 190 );
568 CPPUNIT_ASSERT( it->second.m_val == 91 );
570 it = m.emplace( 151, 1051 );
571 CPPUNIT_ASSERT( it == m.end());
574 CPPUNIT_ASSERT( it != m.end() );
575 CPPUNIT_ASSERT( it->first == 174 );
576 CPPUNIT_ASSERT( it->second.m_val == 471 );
579 CPPUNIT_ASSERT( it != m.end() );
580 CPPUNIT_ASSERT( it->first == 190 );
581 CPPUNIT_ASSERT( it->second.m_val == 91 );
584 CPPUNIT_ASSERT( it != m.end() );
585 CPPUNIT_ASSERT( it->first == 151 );
586 CPPUNIT_ASSERT( it->second.m_val == 0 );
594 for ( int i = 0; i < 500; ++i ) {
595 CPPUNIT_ASSERT( m.insert( i, i * 2 ) != m.end() );
597 CPPUNIT_ASSERT( check_size( m, 500 ));
600 typename Map::iterator it( m.begin() );
601 typename Map::const_iterator cit( m.cbegin() );
602 CPPUNIT_CHECK( it == cit );
603 CPPUNIT_CHECK( it != m.end() );
604 CPPUNIT_CHECK( it != m.cend() );
605 CPPUNIT_CHECK( cit != m.end() );
606 CPPUNIT_CHECK( cit != m.cend() );
608 CPPUNIT_CHECK( it != cit );
609 CPPUNIT_CHECK( it != m.end() );
610 CPPUNIT_CHECK( it != m.cend() );
611 CPPUNIT_CHECK( cit != m.end() );
612 CPPUNIT_CHECK( cit != m.cend() );
614 CPPUNIT_CHECK( it == cit );
615 CPPUNIT_CHECK( it != m.end() );
616 CPPUNIT_CHECK( it != m.cend() );
617 CPPUNIT_CHECK( cit != m.end() );
618 CPPUNIT_CHECK( cit != m.cend() );
622 for ( iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) {
624 CPPUNIT_CHECK( it2 == it );
625 CPPUNIT_CHECK( it2 != itEnd );
626 CPPUNIT_ASSERT( it->first * 2 == (*it).second.m_val );
627 it->second = it->first;
630 Map const& refMap = m;
631 for ( const_iterator it = refMap.begin(), itEnd = refMap.end(); it != itEnd; ++it ) {
632 CPPUNIT_ASSERT( it->first == it->second.m_val );
633 CPPUNIT_ASSERT( (*it).first == (*it).second.m_val );
641 typedef typename Map::iterator iterator;
642 typedef typename Map::const_iterator const_iterator;
646 const int nMaxCount = 500;
647 for ( int i = 0; i < nMaxCount; ++i ) {
648 CPPUNIT_ASSERT( s.insert( i, i * 2 ));
652 typename Map::iterator it( s.begin() );
653 typename Map::const_iterator cit( s.cbegin() );
654 CPPUNIT_CHECK( it == cit );
655 CPPUNIT_CHECK( it != s.end() );
656 CPPUNIT_CHECK( it != s.cend() );
657 CPPUNIT_CHECK( cit != s.end() );
658 CPPUNIT_CHECK( cit != s.cend() );
660 CPPUNIT_CHECK( it != cit );
661 CPPUNIT_CHECK( it != s.end() );
662 CPPUNIT_CHECK( it != s.cend() );
663 CPPUNIT_CHECK( cit != s.end() );
664 CPPUNIT_CHECK( cit != s.cend() );
666 CPPUNIT_CHECK( it == cit );
667 CPPUNIT_CHECK( it != s.end() );
668 CPPUNIT_CHECK( it != s.cend() );
669 CPPUNIT_CHECK( cit != s.end() );
670 CPPUNIT_CHECK( cit != s.cend() );
674 for ( iterator it = s.begin(), itEnd = s.end(); it != itEnd; ++it ) {
675 CPPUNIT_ASSERT( it->first * 2 == it->second.m_val );
676 CPPUNIT_ASSERT( (*it).first * 2 == (*it).second.m_val );
677 it->second.m_val = it->first;
680 CPPUNIT_ASSERT( nCount == nMaxCount );
682 Map const& refSet = s;
684 for ( const_iterator it = refSet.begin(), itEnd = refSet.end(); it != itEnd; ++it ) {
685 CPPUNIT_ASSERT( it->first == it->second.m_val );
686 CPPUNIT_ASSERT( (*it).first == (*it).second.m_val );
689 CPPUNIT_ASSERT( nCount == nMaxCount );
693 void Michael_HP_cmp();
694 void Michael_HP_less();
695 void Michael_HP_cmpmix();
697 void Michael_DHP_cmp();
698 void Michael_DHP_less();
699 void Michael_DHP_cmpmix();
701 void Michael_RCU_GPI_cmp();
702 void Michael_RCU_GPI_less();
703 void Michael_RCU_GPI_cmpmix();
705 void Michael_RCU_GPB_cmp();
706 void Michael_RCU_GPB_less();
707 void Michael_RCU_GPB_cmpmix();
709 void Michael_RCU_GPT_cmp();
710 void Michael_RCU_GPT_less();
711 void Michael_RCU_GPT_cmpmix();
713 void Michael_RCU_SHB_cmp();
714 void Michael_RCU_SHB_less();
715 void Michael_RCU_SHB_cmpmix();
717 void Michael_RCU_SHT_cmp();
718 void Michael_RCU_SHT_less();
719 void Michael_RCU_SHT_cmpmix();
721 void Michael_nogc_cmp();
722 void Michael_nogc_less();
723 void Michael_nogc_cmpmix();
727 void Lazy_HP_cmpmix();
730 void Lazy_DHP_less();
731 void Lazy_DHP_cmpmix();
733 void Lazy_RCU_GPI_cmp();
734 void Lazy_RCU_GPI_less();
735 void Lazy_RCU_GPI_cmpmix();
737 void Lazy_RCU_GPB_cmp();
738 void Lazy_RCU_GPB_less();
739 void Lazy_RCU_GPB_cmpmix();
741 void Lazy_RCU_GPT_cmp();
742 void Lazy_RCU_GPT_less();
743 void Lazy_RCU_GPT_cmpmix();
745 void Lazy_RCU_SHB_cmp();
746 void Lazy_RCU_SHB_less();
747 void Lazy_RCU_SHB_cmpmix();
749 void Lazy_RCU_SHT_cmp();
750 void Lazy_RCU_SHT_less();
751 void Lazy_RCU_SHT_cmpmix();
753 void Lazy_nogc_cmp();
754 void Lazy_nogc_less();
755 void Lazy_nogc_cmpmix();
758 void Split_HP_less();
759 void Split_HP_cmpmix();
760 void Split_HP_cmpmix_stat();
762 void Split_DHP_cmp();
763 void Split_DHP_less();
764 void Split_DHP_cmpmix();
765 void Split_DHP_cmpmix_stat();
767 void Split_RCU_GPI_cmp();
768 void Split_RCU_GPI_less();
769 void Split_RCU_GPI_cmpmix();
770 void Split_RCU_GPI_cmpmix_stat();
772 void Split_RCU_GPB_cmp();
773 void Split_RCU_GPB_less();
774 void Split_RCU_GPB_cmpmix();
775 void Split_RCU_GPB_cmpmix_stat();
777 void Split_RCU_GPT_cmp();
778 void Split_RCU_GPT_less();
779 void Split_RCU_GPT_cmpmix();
780 void Split_RCU_GPT_cmpmix_stat();
782 void Split_RCU_SHB_cmp();
783 void Split_RCU_SHB_less();
784 void Split_RCU_SHB_cmpmix();
785 void Split_RCU_SHB_cmpmix_stat();
787 void Split_RCU_SHT_cmp();
788 void Split_RCU_SHT_less();
789 void Split_RCU_SHT_cmpmix();
790 void Split_RCU_SHT_cmpmix_stat();
792 void Split_nogc_cmp();
793 void Split_nogc_less();
794 void Split_nogc_cmpmix();
795 void Split_nogc_cmpmix_stat();
797 void Split_Lazy_HP_cmp();
798 void Split_Lazy_HP_less();
799 void Split_Lazy_HP_cmpmix();
800 void Split_Lazy_HP_cmpmix_stat();
802 void Split_Lazy_DHP_cmp();
803 void Split_Lazy_DHP_less();
804 void Split_Lazy_DHP_cmpmix();
805 void Split_Lazy_DHP_cmpmix_stat();
807 void Split_Lazy_RCU_GPI_cmp();
808 void Split_Lazy_RCU_GPI_less();
809 void Split_Lazy_RCU_GPI_cmpmix();
810 void Split_Lazy_RCU_GPI_cmpmix_stat();
812 void Split_Lazy_RCU_GPB_cmp();
813 void Split_Lazy_RCU_GPB_less();
814 void Split_Lazy_RCU_GPB_cmpmix();
815 void Split_Lazy_RCU_GPB_cmpmix_stat();
817 void Split_Lazy_RCU_GPT_cmp();
818 void Split_Lazy_RCU_GPT_less();
819 void Split_Lazy_RCU_GPT_cmpmix();
820 void Split_Lazy_RCU_GPT_cmpmix_stat();
822 void Split_Lazy_RCU_SHB_cmp();
823 void Split_Lazy_RCU_SHB_less();
824 void Split_Lazy_RCU_SHB_cmpmix();
825 void Split_Lazy_RCU_SHB_cmpmix_stat();
827 void Split_Lazy_RCU_SHT_cmp();
828 void Split_Lazy_RCU_SHT_less();
829 void Split_Lazy_RCU_SHT_cmpmix();
830 void Split_Lazy_RCU_SHT_cmpmix_stat();
832 void Split_Lazy_nogc_cmp();
833 void Split_Lazy_nogc_less();
834 void Split_Lazy_nogc_cmpmix();
835 void Split_Lazy_nogc_cmpmix_stat();
837 CPPUNIT_TEST_SUITE(HashMapHdrTest)
838 CPPUNIT_TEST(Michael_HP_cmp)
839 CPPUNIT_TEST(Michael_HP_less)
840 CPPUNIT_TEST(Michael_HP_cmpmix)
842 CPPUNIT_TEST(Michael_DHP_cmp)
843 CPPUNIT_TEST(Michael_DHP_less)
844 CPPUNIT_TEST(Michael_DHP_cmpmix)
846 CPPUNIT_TEST(Michael_RCU_GPI_cmp)
847 CPPUNIT_TEST(Michael_RCU_GPI_less)
848 CPPUNIT_TEST(Michael_RCU_GPI_cmpmix)
850 CPPUNIT_TEST(Michael_RCU_GPB_cmp)
851 CPPUNIT_TEST(Michael_RCU_GPB_less)
852 CPPUNIT_TEST(Michael_RCU_GPB_cmpmix)
854 CPPUNIT_TEST(Michael_RCU_SHT_cmp)
855 CPPUNIT_TEST(Michael_RCU_SHT_less)
856 CPPUNIT_TEST(Michael_RCU_SHT_cmpmix)
858 CPPUNIT_TEST(Michael_RCU_SHB_cmp)
859 CPPUNIT_TEST(Michael_RCU_SHB_less)
860 CPPUNIT_TEST(Michael_RCU_SHB_cmpmix)
862 CPPUNIT_TEST(Michael_RCU_GPT_cmp)
863 CPPUNIT_TEST(Michael_RCU_GPT_less)
864 CPPUNIT_TEST(Michael_RCU_GPT_cmpmix)
866 CPPUNIT_TEST(Michael_nogc_cmp)
867 CPPUNIT_TEST(Michael_nogc_less)
868 CPPUNIT_TEST(Michael_nogc_cmpmix)
870 CPPUNIT_TEST(Lazy_HP_cmp)
871 CPPUNIT_TEST(Lazy_HP_less)
872 CPPUNIT_TEST(Lazy_HP_cmpmix)
874 CPPUNIT_TEST(Lazy_DHP_cmp)
875 CPPUNIT_TEST(Lazy_DHP_less)
876 CPPUNIT_TEST(Lazy_DHP_cmpmix)
878 CPPUNIT_TEST(Lazy_RCU_GPI_cmp)
879 CPPUNIT_TEST(Lazy_RCU_GPI_less)
880 CPPUNIT_TEST(Lazy_RCU_GPI_cmpmix)
882 CPPUNIT_TEST(Lazy_RCU_GPB_cmp)
883 CPPUNIT_TEST(Lazy_RCU_GPB_less)
884 CPPUNIT_TEST(Lazy_RCU_GPB_cmpmix)
886 CPPUNIT_TEST(Lazy_RCU_GPT_cmp)
887 CPPUNIT_TEST(Lazy_RCU_GPT_less)
888 CPPUNIT_TEST(Lazy_RCU_GPT_cmpmix)
890 CPPUNIT_TEST(Lazy_RCU_SHB_cmp)
891 CPPUNIT_TEST(Lazy_RCU_SHB_less)
892 CPPUNIT_TEST(Lazy_RCU_SHB_cmpmix)
894 CPPUNIT_TEST(Lazy_RCU_SHT_cmp)
895 CPPUNIT_TEST(Lazy_RCU_SHT_less)
896 CPPUNIT_TEST(Lazy_RCU_SHT_cmpmix)
898 CPPUNIT_TEST(Lazy_nogc_cmp)
899 CPPUNIT_TEST(Lazy_nogc_less)
900 CPPUNIT_TEST(Lazy_nogc_cmpmix)
902 CPPUNIT_TEST(Split_HP_cmp)
903 CPPUNIT_TEST(Split_HP_less)
904 CPPUNIT_TEST(Split_HP_cmpmix)
905 CPPUNIT_TEST( Split_HP_cmpmix_stat )
907 CPPUNIT_TEST(Split_DHP_cmp)
908 CPPUNIT_TEST(Split_DHP_less)
909 CPPUNIT_TEST(Split_DHP_cmpmix)
910 CPPUNIT_TEST( Split_DHP_cmpmix_stat )
912 CPPUNIT_TEST(Split_RCU_GPI_cmp)
913 CPPUNIT_TEST(Split_RCU_GPI_less)
914 CPPUNIT_TEST(Split_RCU_GPI_cmpmix)
915 CPPUNIT_TEST( Split_RCU_GPI_cmpmix_stat )
917 CPPUNIT_TEST(Split_RCU_GPB_cmp)
918 CPPUNIT_TEST(Split_RCU_GPB_less)
919 CPPUNIT_TEST(Split_RCU_GPB_cmpmix)
920 CPPUNIT_TEST( Split_RCU_GPB_cmpmix_stat )
922 CPPUNIT_TEST(Split_RCU_GPT_cmp)
923 CPPUNIT_TEST(Split_RCU_GPT_less)
924 CPPUNIT_TEST(Split_RCU_GPT_cmpmix)
925 CPPUNIT_TEST( Split_RCU_GPT_cmpmix_stat )
927 CPPUNIT_TEST(Split_RCU_SHB_cmp)
928 CPPUNIT_TEST(Split_RCU_SHB_less)
929 CPPUNIT_TEST(Split_RCU_SHB_cmpmix)
930 CPPUNIT_TEST( Split_RCU_SHB_cmpmix_stat )
932 CPPUNIT_TEST(Split_RCU_SHT_cmp)
933 CPPUNIT_TEST(Split_RCU_SHT_less)
934 CPPUNIT_TEST(Split_RCU_SHT_cmpmix)
935 CPPUNIT_TEST( Split_RCU_SHT_cmpmix_stat )
937 CPPUNIT_TEST(Split_nogc_cmp)
938 CPPUNIT_TEST(Split_nogc_less)
939 CPPUNIT_TEST(Split_nogc_cmpmix)
940 CPPUNIT_TEST( Split_nogc_cmpmix_stat )
942 CPPUNIT_TEST(Split_Lazy_HP_cmp)
943 CPPUNIT_TEST(Split_Lazy_HP_less)
944 CPPUNIT_TEST(Split_Lazy_HP_cmpmix)
945 CPPUNIT_TEST( Split_Lazy_HP_cmpmix_stat )
947 CPPUNIT_TEST(Split_Lazy_DHP_cmp)
948 CPPUNIT_TEST(Split_Lazy_DHP_less)
949 CPPUNIT_TEST(Split_Lazy_DHP_cmpmix)
950 CPPUNIT_TEST( Split_Lazy_DHP_cmpmix_stat )
952 CPPUNIT_TEST(Split_Lazy_RCU_GPI_cmp)
953 CPPUNIT_TEST(Split_Lazy_RCU_GPI_less)
954 CPPUNIT_TEST(Split_Lazy_RCU_GPI_cmpmix)
955 CPPUNIT_TEST( Split_Lazy_RCU_GPI_cmpmix_stat )
957 CPPUNIT_TEST(Split_Lazy_RCU_GPB_cmp)
958 CPPUNIT_TEST(Split_Lazy_RCU_GPB_less)
959 CPPUNIT_TEST(Split_Lazy_RCU_GPB_cmpmix)
960 CPPUNIT_TEST( Split_Lazy_RCU_GPB_cmpmix_stat )
962 CPPUNIT_TEST(Split_Lazy_RCU_GPT_cmp)
963 CPPUNIT_TEST(Split_Lazy_RCU_GPT_less)
964 CPPUNIT_TEST(Split_Lazy_RCU_GPT_cmpmix)
965 CPPUNIT_TEST( Split_Lazy_RCU_GPT_cmpmix_stat )
967 CPPUNIT_TEST(Split_Lazy_RCU_SHB_cmp)
968 CPPUNIT_TEST(Split_Lazy_RCU_SHB_less)
969 CPPUNIT_TEST(Split_Lazy_RCU_SHB_cmpmix)
970 CPPUNIT_TEST( Split_Lazy_RCU_SHB_cmpmix_stat )
972 CPPUNIT_TEST(Split_Lazy_RCU_SHT_cmp)
973 CPPUNIT_TEST(Split_Lazy_RCU_SHT_less)
974 CPPUNIT_TEST(Split_Lazy_RCU_SHT_cmpmix)
975 CPPUNIT_TEST( Split_Lazy_RCU_SHT_cmpmix_stat )
977 CPPUNIT_TEST(Split_Lazy_nogc_cmp)
978 CPPUNIT_TEST(Split_Lazy_nogc_less)
979 CPPUNIT_TEST(Split_Lazy_nogc_cmpmix)
980 CPPUNIT_TEST( Split_Lazy_nogc_cmpmix_stat )
981 CPPUNIT_TEST_SUITE_END()
986 #endif // #ifndef CDSTEST_HDR_MAP_H