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];
212 CPPUNIT_ASSERT( m.get(gp, nKey ));
213 CPPUNIT_ASSERT( !gp.empty());
214 CPPUNIT_CHECK( gp->first == nKey );
215 CPPUNIT_CHECK( gp->second.m_val == nKey );
217 CPPUNIT_ASSERT( m.extract(gp, nKey));
218 CPPUNIT_ASSERT( !gp.empty());
219 CPPUNIT_CHECK( gp->first == nKey );
220 CPPUNIT_CHECK( gp->second.m_val == nKey );
221 CPPUNIT_CHECK( !m.get(gp, nKey));
224 CPPUNIT_CHECK( !m.extract(gp, nKey));
225 CPPUNIT_CHECK( gp.empty());
227 CPPUNIT_ASSERT( m.empty() );
229 for ( int i = 0; i < nLimit; ++i )
230 CPPUNIT_ASSERT( m.insert( arrRandom[i], arrRandom[i] ));
232 for ( int i = 0; i < nLimit; ++i ) {
233 int nKey = arrRandom[i];
234 CPPUNIT_ASSERT( m.get_with(gp, other_item(nKey), other_less() ));
235 CPPUNIT_ASSERT( !gp.empty());
236 CPPUNIT_CHECK( gp->first == nKey );
237 CPPUNIT_CHECK( gp->second.m_val == nKey );
239 CPPUNIT_ASSERT( m.extract_with(gp, other_item(nKey), other_less() ));
240 CPPUNIT_ASSERT( !gp.empty());
241 CPPUNIT_CHECK( gp->first == nKey );
242 CPPUNIT_CHECK( gp->second.m_val == nKey );
243 CPPUNIT_CHECK( !m.get_with(gp, other_item(nKey), other_less() ));
246 CPPUNIT_CHECK( !m.extract_with(gp, other_item(nKey), other_less() ));
247 CPPUNIT_CHECK( gp.empty());
249 CPPUNIT_ASSERT( m.empty() );
265 typedef typename Map::gc rcu;
266 typedef typename Map::rcu_lock rcu_lock;
267 typedef typename Map::value_type value_type;
268 typename Map::exempt_ptr ep;
270 static size_t const nLimit = 100;
272 for ( size_t i = 0; i < nLimit; ++i )
274 std::random_shuffle( arr, arr + nLimit );
276 for ( size_t i = 0; i < nLimit; ++i )
277 CPPUNIT_ASSERT( m.insert( arr[i], arr[i] ));
279 for ( size_t i = 0; i < nLimit; i += 2 ) {
284 pVal = m.get( nKey );
285 CPPUNIT_ASSERT( pVal != nullptr );
286 CPPUNIT_CHECK( pVal->first == nKey );
287 CPPUNIT_CHECK( pVal->second.m_val == nKey );
289 ep = m.extract( nKey );
290 CPPUNIT_ASSERT( ep );
291 CPPUNIT_ASSERT( !ep.empty() );
292 CPPUNIT_CHECK( pVal->first == ep->first );
293 CPPUNIT_CHECK( pVal->second.m_val == ep->second.m_val );
298 CPPUNIT_CHECK( m.get( nKey ) == nullptr );
299 ep = m.extract( nKey );
300 CPPUNIT_CHECK( !ep );
301 CPPUNIT_CHECK( ep.empty() );
304 pVal = m.get_with( other_item(nKey), other_less() );
305 CPPUNIT_ASSERT( pVal != nullptr );
306 CPPUNIT_CHECK( pVal->first == nKey );
307 CPPUNIT_CHECK( pVal->second.m_val == nKey );
309 ep = m.extract_with( other_item( nKey ), other_less() );
310 CPPUNIT_ASSERT( ep );
311 CPPUNIT_ASSERT( !ep.empty() );
312 CPPUNIT_CHECK( pVal->first == ep->first );
313 CPPUNIT_CHECK( pVal->second.m_val == (*ep).second.m_val );
318 CPPUNIT_CHECK( m.get_with( other_item(nKey), other_less() ) == nullptr );
319 CPPUNIT_CHECK( !m.extract_with( other_item(nKey), other_less() ));
320 CPPUNIT_CHECK( ep.empty() );
323 CPPUNIT_CHECK( m.empty() );
324 CPPUNIT_CHECK( check_size( m, 0 ));
327 CPPUNIT_CHECK( m.get( int(nLimit / 2) ) == nullptr );
328 ep = m.extract( int( nLimit / 2 ) );
329 CPPUNIT_CHECK( !ep );
330 CPPUNIT_CHECK( ep.empty() );
339 void test_int_with( Map& m )
341 std::pair<bool, bool> ensureResult;
344 CPPUNIT_ASSERT( m.empty() );
345 CPPUNIT_ASSERT( check_size( m, 0 ));
346 CPPUNIT_ASSERT( !m.find(25) );
347 CPPUNIT_ASSERT( m.insert( 25 ) ) ; // value = 0
348 CPPUNIT_ASSERT( m.find(25) );
349 CPPUNIT_ASSERT( !m.empty() );
350 CPPUNIT_ASSERT( check_size( m, 1 ));
351 CPPUNIT_ASSERT( m.find(25) );
353 CPPUNIT_ASSERT( !m.insert( 25 ) );
354 CPPUNIT_ASSERT( !m.empty() );
355 CPPUNIT_ASSERT( check_size( m, 1 ));
357 CPPUNIT_ASSERT( !m.find_with(10, less()) );
358 CPPUNIT_ASSERT( m.insert( 10, 10 ) );
359 CPPUNIT_ASSERT( !m.empty() );
360 CPPUNIT_ASSERT( check_size( m, 2 ));
361 CPPUNIT_ASSERT( m.find_with(10, less()) );
363 CPPUNIT_ASSERT( !m.insert( 10, 20 ) );
364 CPPUNIT_ASSERT( !m.empty() );
365 CPPUNIT_ASSERT( check_size( m, 2 ));
367 CPPUNIT_ASSERT( !m.find(30) );
368 CPPUNIT_ASSERT( m.insert_key( 30, insert_functor<Map>() ) ) ; // value = 90
369 CPPUNIT_ASSERT( !m.empty() );
370 CPPUNIT_ASSERT( check_size( m, 3 ));
371 CPPUNIT_ASSERT( m.find(30) );
373 CPPUNIT_ASSERT( !m.insert_key( 10, insert_functor<Map>() ) );
374 CPPUNIT_ASSERT( !m.insert_key( 25, insert_functor<Map>() ) );
375 CPPUNIT_ASSERT( !m.insert_key( 30, insert_functor<Map>() ) );
378 CPPUNIT_ASSERT( !m.find(27) );
379 ensureResult = m.ensure( 27, insert_functor<Map>() ) ; // value = 54
380 CPPUNIT_ASSERT( ensureResult.first );
381 CPPUNIT_ASSERT( ensureResult.second );
382 CPPUNIT_ASSERT( m.find(27) );
386 CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
388 CPPUNIT_ASSERT( m.find_with( 25, less(), std::ref( chk ) ) );
389 chk.m_nExpected = 90;
390 CPPUNIT_ASSERT( m.find( 30, std::ref( chk ) ) );
391 chk.m_nExpected = 54;
392 CPPUNIT_ASSERT( m.find( 27, std::ref( chk ) ) );
394 ensureResult = m.ensure( 10, insert_functor<Map>() ) ; // value = 50
395 CPPUNIT_ASSERT( ensureResult.first );
396 CPPUNIT_ASSERT( !ensureResult.second );
397 chk.m_nExpected = 50;
398 CPPUNIT_ASSERT( m.find( 10, std::ref( chk ) ) );
401 CPPUNIT_ASSERT( !m.find(100) );
402 CPPUNIT_ASSERT( !m.erase( 100 )) ; // not found
404 CPPUNIT_ASSERT( m.find(25) );
405 CPPUNIT_ASSERT( check_size( m, 4 ));
406 CPPUNIT_ASSERT( m.erase( 25 ));
407 CPPUNIT_ASSERT( !m.empty() );
408 CPPUNIT_ASSERT( check_size( m, 3 ));
409 CPPUNIT_ASSERT( !m.find(25) );
410 CPPUNIT_ASSERT( !m.erase( 25 ));
412 CPPUNIT_ASSERT( !m.find(258) );
413 CPPUNIT_ASSERT( m.insert(258))
414 CPPUNIT_ASSERT( check_size( m, 4 ));
415 CPPUNIT_ASSERT( m.find_with(258, less()) );
416 CPPUNIT_ASSERT( m.erase_with( 258, less() ));
417 CPPUNIT_ASSERT( !m.empty() );
418 CPPUNIT_ASSERT( check_size( m, 3 ));
419 CPPUNIT_ASSERT( !m.find(258) );
420 CPPUNIT_ASSERT( !m.erase_with( 258, less() ));
426 CPPUNIT_ASSERT( !m.find(29) );
427 CPPUNIT_ASSERT( m.insert(29, 290));
428 CPPUNIT_ASSERT( check_size( m, 4 ));
429 CPPUNIT_ASSERT( m.erase_with( 29, less(), std::ref( ext ) ) );
430 CPPUNIT_ASSERT( !m.empty() );
431 CPPUNIT_ASSERT( check_size( m, 3 ));
432 CPPUNIT_ASSERT( nVal == 290 );
434 CPPUNIT_ASSERT( !m.erase_with( 29, less(), std::ref( ext ) ) );
435 CPPUNIT_ASSERT( nVal == -1 );
437 CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) );
438 CPPUNIT_ASSERT( !m.empty() );
439 CPPUNIT_ASSERT( check_size( m, 2 ));
440 CPPUNIT_ASSERT( nVal == 90 );
442 CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) );
443 CPPUNIT_ASSERT( nVal == -1 );
446 CPPUNIT_ASSERT( m.empty() );
447 CPPUNIT_ASSERT( check_size( m, 0 ));
450 CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0
451 CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731
452 CPPUNIT_ASSERT( m.emplace( 149, value_type(941) )) ; // key = 149, val = 941
454 CPPUNIT_ASSERT( !m.empty() );
455 CPPUNIT_ASSERT( check_size( m, 3 ));
458 CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
459 chk.m_nExpected = 731;
460 CPPUNIT_ASSERT( m.find_with( 137, less(), std::ref(chk) ));
461 chk.m_nExpected = 941;
462 CPPUNIT_ASSERT( m.find( 149, std::ref(chk) ));
464 CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map
466 CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
467 CPPUNIT_ASSERT( !m.empty() );
468 CPPUNIT_ASSERT( check_size( m, 3 ));
471 CPPUNIT_ASSERT( m.empty() );
472 CPPUNIT_ASSERT( check_size( m, 0 ));
479 typedef typename Map::iterator iterator;
480 typedef typename Map::const_iterator const_iterator;
485 CPPUNIT_ASSERT( m.empty() );
486 CPPUNIT_ASSERT( check_size( m, 0 ));
488 CPPUNIT_ASSERT( m.find(10) == m.end() );
489 iterator it = m.insert( 10 );
490 CPPUNIT_ASSERT( it != m.end() );
491 CPPUNIT_ASSERT( !m.empty() );
492 CPPUNIT_ASSERT( check_size( m, 1 ));
493 CPPUNIT_ASSERT( m.find(10) == it );
494 CPPUNIT_ASSERT( it->first == 10 );
495 CPPUNIT_ASSERT( it->second.m_val == 0 );
497 CPPUNIT_ASSERT( m.find(100) == m.end() );
498 it = m.insert( 100, 200 );
499 CPPUNIT_ASSERT( it != m.end() );
500 CPPUNIT_ASSERT( !m.empty() );
501 CPPUNIT_ASSERT( check_size( m, 2 ));
502 CPPUNIT_ASSERT( m.find_with(100, less()) == it );
503 CPPUNIT_ASSERT( it->first == 100 );
504 CPPUNIT_ASSERT( it->second.m_val == 200 );
506 CPPUNIT_ASSERT( m.find(55) == m.end() );
507 it = m.insert_key( 55, insert_functor<Map>() );
508 CPPUNIT_ASSERT( it != m.end() );
509 CPPUNIT_ASSERT( !m.empty() );
510 CPPUNIT_ASSERT( check_size( m, 3 ));
511 CPPUNIT_ASSERT( m.find(55) == it );
512 CPPUNIT_ASSERT( it->first == 55 );
513 CPPUNIT_ASSERT( it->second.m_val == 55 * 3 );
515 CPPUNIT_ASSERT( m.insert( 55 ) == m.end() );
516 CPPUNIT_ASSERT( m.insert( 55, 10 ) == m.end() );
517 CPPUNIT_ASSERT( m.insert_key( 55, insert_functor<Map>()) == m.end() );
519 CPPUNIT_ASSERT( m.find(10) != m.end() );
520 std::pair<iterator, bool> ensureResult = m.ensure( 10 );
521 CPPUNIT_ASSERT( ensureResult.first != m.end() );
522 CPPUNIT_ASSERT( !ensureResult.second );
523 CPPUNIT_ASSERT( !m.empty() );
524 ensureResult.first->second.m_val = ensureResult.first->first * 5;
525 CPPUNIT_ASSERT( check_size( m, 3 ));
526 CPPUNIT_ASSERT( m.find(10) == ensureResult.first );
528 CPPUNIT_ASSERT( it != m.end() );
529 CPPUNIT_ASSERT( it->second.m_val == 50 );
531 CPPUNIT_ASSERT( m.find(120) == m.end() );
532 ensureResult = m.ensure( 120 );
533 CPPUNIT_ASSERT( ensureResult.first != m.end() );
534 CPPUNIT_ASSERT( ensureResult.second );
535 CPPUNIT_ASSERT( !m.empty() );
536 CPPUNIT_ASSERT( check_size( m, 4 ));
537 ensureResult.first->second.m_val = ensureResult.first->first * 5;
538 CPPUNIT_ASSERT( m.find_with(120, less()) == ensureResult.first );
539 it = m.find_with(120, less());
540 CPPUNIT_ASSERT( it != m.end() );
541 CPPUNIT_ASSERT( it->second.m_val == 120 * 5 );
542 CPPUNIT_ASSERT( m.find_with(120, less()) == m.find(120) );
545 it = m.emplace( 151 ) ; // key = 151, val = 0
546 CPPUNIT_ASSERT( it != m.end() );
547 CPPUNIT_ASSERT( it->first == 151 );
548 CPPUNIT_ASSERT( it->second.m_val == 0 );
550 it = m.emplace( 174, 471 ) ; // key == 174, val = 471
551 CPPUNIT_ASSERT( it != m.end() );
552 CPPUNIT_ASSERT( it->first == 174 );
553 CPPUNIT_ASSERT( it->second.m_val == 471 );
555 it = m.emplace( 190, value_type(91)) ; // key == 190, val = 19
556 CPPUNIT_ASSERT( it != m.end() );
557 CPPUNIT_ASSERT( it->first == 190 );
558 CPPUNIT_ASSERT( it->second.m_val == 91 );
560 it = m.emplace( 151, 1051 );
561 CPPUNIT_ASSERT( it == m.end());
564 CPPUNIT_ASSERT( it != m.end() );
565 CPPUNIT_ASSERT( it->first == 174 );
566 CPPUNIT_ASSERT( it->second.m_val == 471 );
569 CPPUNIT_ASSERT( it != m.end() );
570 CPPUNIT_ASSERT( it->first == 190 );
571 CPPUNIT_ASSERT( it->second.m_val == 91 );
574 CPPUNIT_ASSERT( it != m.end() );
575 CPPUNIT_ASSERT( it->first == 151 );
576 CPPUNIT_ASSERT( it->second.m_val == 0 );
584 for ( int i = 0; i < 500; ++i ) {
585 CPPUNIT_ASSERT( m.insert( i, i * 2 ) != m.end() );
587 CPPUNIT_ASSERT( check_size( m, 500 ));
590 typename Map::iterator it( m.begin() );
591 typename Map::const_iterator cit( m.cbegin() );
592 CPPUNIT_CHECK( it == cit );
593 CPPUNIT_CHECK( it != m.end() );
594 CPPUNIT_CHECK( it != m.cend() );
595 CPPUNIT_CHECK( cit != m.end() );
596 CPPUNIT_CHECK( cit != m.cend() );
598 CPPUNIT_CHECK( it != cit );
599 CPPUNIT_CHECK( it != m.end() );
600 CPPUNIT_CHECK( it != m.cend() );
601 CPPUNIT_CHECK( cit != m.end() );
602 CPPUNIT_CHECK( cit != m.cend() );
604 CPPUNIT_CHECK( it == cit );
605 CPPUNIT_CHECK( it != m.end() );
606 CPPUNIT_CHECK( it != m.cend() );
607 CPPUNIT_CHECK( cit != m.end() );
608 CPPUNIT_CHECK( cit != m.cend() );
612 for ( iterator it = m.begin(), itEnd = m.end(); it != itEnd; ++it ) {
614 CPPUNIT_CHECK( it2 == it );
615 CPPUNIT_CHECK( it2 != itEnd );
616 CPPUNIT_ASSERT( it->first * 2 == (*it).second.m_val );
617 it->second = it->first;
620 Map const& refMap = m;
621 for ( const_iterator it = refMap.begin(), itEnd = refMap.end(); it != itEnd; ++it ) {
622 CPPUNIT_ASSERT( it->first == it->second.m_val );
623 CPPUNIT_ASSERT( (*it).first == (*it).second.m_val );
631 typedef typename Map::iterator iterator;
632 typedef typename Map::const_iterator const_iterator;
636 const int nMaxCount = 500;
637 for ( int i = 0; i < nMaxCount; ++i ) {
638 CPPUNIT_ASSERT( s.insert( i, i * 2 ));
642 typename Map::iterator it( s.begin() );
643 typename Map::const_iterator cit( s.cbegin() );
644 CPPUNIT_CHECK( it == cit );
645 CPPUNIT_CHECK( it != s.end() );
646 CPPUNIT_CHECK( it != s.cend() );
647 CPPUNIT_CHECK( cit != s.end() );
648 CPPUNIT_CHECK( cit != s.cend() );
650 CPPUNIT_CHECK( it != cit );
651 CPPUNIT_CHECK( it != s.end() );
652 CPPUNIT_CHECK( it != s.cend() );
653 CPPUNIT_CHECK( cit != s.end() );
654 CPPUNIT_CHECK( cit != s.cend() );
656 CPPUNIT_CHECK( it == cit );
657 CPPUNIT_CHECK( it != s.end() );
658 CPPUNIT_CHECK( it != s.cend() );
659 CPPUNIT_CHECK( cit != s.end() );
660 CPPUNIT_CHECK( cit != s.cend() );
664 for ( iterator it = s.begin(), itEnd = s.end(); it != itEnd; ++it ) {
665 CPPUNIT_ASSERT( it->first * 2 == it->second.m_val );
666 CPPUNIT_ASSERT( (*it).first * 2 == (*it).second.m_val );
667 it->second.m_val = it->first;
670 CPPUNIT_ASSERT( nCount == nMaxCount );
672 Map const& refSet = s;
674 for ( const_iterator it = refSet.begin(), itEnd = refSet.end(); it != itEnd; ++it ) {
675 CPPUNIT_ASSERT( it->first == it->second.m_val );
676 CPPUNIT_ASSERT( (*it).first == (*it).second.m_val );
679 CPPUNIT_ASSERT( nCount == nMaxCount );
683 void Michael_HP_cmp();
684 void Michael_HP_less();
685 void Michael_HP_cmpmix();
687 void Michael_DHP_cmp();
688 void Michael_DHP_less();
689 void Michael_DHP_cmpmix();
691 void Michael_RCU_GPI_cmp();
692 void Michael_RCU_GPI_less();
693 void Michael_RCU_GPI_cmpmix();
695 void Michael_RCU_GPB_cmp();
696 void Michael_RCU_GPB_less();
697 void Michael_RCU_GPB_cmpmix();
699 void Michael_RCU_GPT_cmp();
700 void Michael_RCU_GPT_less();
701 void Michael_RCU_GPT_cmpmix();
703 void Michael_RCU_SHB_cmp();
704 void Michael_RCU_SHB_less();
705 void Michael_RCU_SHB_cmpmix();
707 void Michael_RCU_SHT_cmp();
708 void Michael_RCU_SHT_less();
709 void Michael_RCU_SHT_cmpmix();
711 void Michael_nogc_cmp();
712 void Michael_nogc_less();
713 void Michael_nogc_cmpmix();
717 void Lazy_HP_cmpmix();
720 void Lazy_DHP_less();
721 void Lazy_DHP_cmpmix();
723 void Lazy_RCU_GPI_cmp();
724 void Lazy_RCU_GPI_less();
725 void Lazy_RCU_GPI_cmpmix();
727 void Lazy_RCU_GPB_cmp();
728 void Lazy_RCU_GPB_less();
729 void Lazy_RCU_GPB_cmpmix();
731 void Lazy_RCU_GPT_cmp();
732 void Lazy_RCU_GPT_less();
733 void Lazy_RCU_GPT_cmpmix();
735 void Lazy_RCU_SHB_cmp();
736 void Lazy_RCU_SHB_less();
737 void Lazy_RCU_SHB_cmpmix();
739 void Lazy_RCU_SHT_cmp();
740 void Lazy_RCU_SHT_less();
741 void Lazy_RCU_SHT_cmpmix();
743 void Lazy_nogc_cmp();
744 void Lazy_nogc_less();
745 void Lazy_nogc_cmpmix();
748 void Split_HP_less();
749 void Split_HP_cmpmix();
750 void Split_HP_cmpmix_stat();
752 void Split_DHP_cmp();
753 void Split_DHP_less();
754 void Split_DHP_cmpmix();
755 void Split_DHP_cmpmix_stat();
757 void Split_RCU_GPI_cmp();
758 void Split_RCU_GPI_less();
759 void Split_RCU_GPI_cmpmix();
760 void Split_RCU_GPI_cmpmix_stat();
762 void Split_RCU_GPB_cmp();
763 void Split_RCU_GPB_less();
764 void Split_RCU_GPB_cmpmix();
765 void Split_RCU_GPB_cmpmix_stat();
767 void Split_RCU_GPT_cmp();
768 void Split_RCU_GPT_less();
769 void Split_RCU_GPT_cmpmix();
770 void Split_RCU_GPT_cmpmix_stat();
772 void Split_RCU_SHB_cmp();
773 void Split_RCU_SHB_less();
774 void Split_RCU_SHB_cmpmix();
775 void Split_RCU_SHB_cmpmix_stat();
777 void Split_RCU_SHT_cmp();
778 void Split_RCU_SHT_less();
779 void Split_RCU_SHT_cmpmix();
780 void Split_RCU_SHT_cmpmix_stat();
782 void Split_nogc_cmp();
783 void Split_nogc_less();
784 void Split_nogc_cmpmix();
785 void Split_nogc_cmpmix_stat();
787 void Split_Lazy_HP_cmp();
788 void Split_Lazy_HP_less();
789 void Split_Lazy_HP_cmpmix();
790 void Split_Lazy_HP_cmpmix_stat();
792 void Split_Lazy_DHP_cmp();
793 void Split_Lazy_DHP_less();
794 void Split_Lazy_DHP_cmpmix();
795 void Split_Lazy_DHP_cmpmix_stat();
797 void Split_Lazy_RCU_GPI_cmp();
798 void Split_Lazy_RCU_GPI_less();
799 void Split_Lazy_RCU_GPI_cmpmix();
800 void Split_Lazy_RCU_GPI_cmpmix_stat();
802 void Split_Lazy_RCU_GPB_cmp();
803 void Split_Lazy_RCU_GPB_less();
804 void Split_Lazy_RCU_GPB_cmpmix();
805 void Split_Lazy_RCU_GPB_cmpmix_stat();
807 void Split_Lazy_RCU_GPT_cmp();
808 void Split_Lazy_RCU_GPT_less();
809 void Split_Lazy_RCU_GPT_cmpmix();
810 void Split_Lazy_RCU_GPT_cmpmix_stat();
812 void Split_Lazy_RCU_SHB_cmp();
813 void Split_Lazy_RCU_SHB_less();
814 void Split_Lazy_RCU_SHB_cmpmix();
815 void Split_Lazy_RCU_SHB_cmpmix_stat();
817 void Split_Lazy_RCU_SHT_cmp();
818 void Split_Lazy_RCU_SHT_less();
819 void Split_Lazy_RCU_SHT_cmpmix();
820 void Split_Lazy_RCU_SHT_cmpmix_stat();
822 void Split_Lazy_nogc_cmp();
823 void Split_Lazy_nogc_less();
824 void Split_Lazy_nogc_cmpmix();
825 void Split_Lazy_nogc_cmpmix_stat();
827 CPPUNIT_TEST_SUITE(HashMapHdrTest)
828 CPPUNIT_TEST(Michael_HP_cmp)
829 CPPUNIT_TEST(Michael_HP_less)
830 CPPUNIT_TEST(Michael_HP_cmpmix)
832 CPPUNIT_TEST(Michael_DHP_cmp)
833 CPPUNIT_TEST(Michael_DHP_less)
834 CPPUNIT_TEST(Michael_DHP_cmpmix)
836 CPPUNIT_TEST(Michael_RCU_GPI_cmp)
837 CPPUNIT_TEST(Michael_RCU_GPI_less)
838 CPPUNIT_TEST(Michael_RCU_GPI_cmpmix)
840 CPPUNIT_TEST(Michael_RCU_GPB_cmp)
841 CPPUNIT_TEST(Michael_RCU_GPB_less)
842 CPPUNIT_TEST(Michael_RCU_GPB_cmpmix)
844 CPPUNIT_TEST(Michael_RCU_SHT_cmp)
845 CPPUNIT_TEST(Michael_RCU_SHT_less)
846 CPPUNIT_TEST(Michael_RCU_SHT_cmpmix)
848 CPPUNIT_TEST(Michael_RCU_SHB_cmp)
849 CPPUNIT_TEST(Michael_RCU_SHB_less)
850 CPPUNIT_TEST(Michael_RCU_SHB_cmpmix)
852 CPPUNIT_TEST(Michael_RCU_GPT_cmp)
853 CPPUNIT_TEST(Michael_RCU_GPT_less)
854 CPPUNIT_TEST(Michael_RCU_GPT_cmpmix)
856 CPPUNIT_TEST(Michael_nogc_cmp)
857 CPPUNIT_TEST(Michael_nogc_less)
858 CPPUNIT_TEST(Michael_nogc_cmpmix)
860 CPPUNIT_TEST(Lazy_HP_cmp)
861 CPPUNIT_TEST(Lazy_HP_less)
862 CPPUNIT_TEST(Lazy_HP_cmpmix)
864 CPPUNIT_TEST(Lazy_DHP_cmp)
865 CPPUNIT_TEST(Lazy_DHP_less)
866 CPPUNIT_TEST(Lazy_DHP_cmpmix)
868 CPPUNIT_TEST(Lazy_RCU_GPI_cmp)
869 CPPUNIT_TEST(Lazy_RCU_GPI_less)
870 CPPUNIT_TEST(Lazy_RCU_GPI_cmpmix)
872 CPPUNIT_TEST(Lazy_RCU_GPB_cmp)
873 CPPUNIT_TEST(Lazy_RCU_GPB_less)
874 CPPUNIT_TEST(Lazy_RCU_GPB_cmpmix)
876 CPPUNIT_TEST(Lazy_RCU_GPT_cmp)
877 CPPUNIT_TEST(Lazy_RCU_GPT_less)
878 CPPUNIT_TEST(Lazy_RCU_GPT_cmpmix)
880 CPPUNIT_TEST(Lazy_RCU_SHB_cmp)
881 CPPUNIT_TEST(Lazy_RCU_SHB_less)
882 CPPUNIT_TEST(Lazy_RCU_SHB_cmpmix)
884 CPPUNIT_TEST(Lazy_RCU_SHT_cmp)
885 CPPUNIT_TEST(Lazy_RCU_SHT_less)
886 CPPUNIT_TEST(Lazy_RCU_SHT_cmpmix)
888 CPPUNIT_TEST(Lazy_nogc_cmp)
889 CPPUNIT_TEST(Lazy_nogc_less)
890 CPPUNIT_TEST(Lazy_nogc_cmpmix)
892 CPPUNIT_TEST(Split_HP_cmp)
893 CPPUNIT_TEST(Split_HP_less)
894 CPPUNIT_TEST(Split_HP_cmpmix)
895 CPPUNIT_TEST( Split_HP_cmpmix_stat )
897 CPPUNIT_TEST(Split_DHP_cmp)
898 CPPUNIT_TEST(Split_DHP_less)
899 CPPUNIT_TEST(Split_DHP_cmpmix)
900 CPPUNIT_TEST( Split_DHP_cmpmix_stat )
902 CPPUNIT_TEST(Split_RCU_GPI_cmp)
903 CPPUNIT_TEST(Split_RCU_GPI_less)
904 CPPUNIT_TEST(Split_RCU_GPI_cmpmix)
905 CPPUNIT_TEST( Split_RCU_GPI_cmpmix_stat )
907 CPPUNIT_TEST(Split_RCU_GPB_cmp)
908 CPPUNIT_TEST(Split_RCU_GPB_less)
909 CPPUNIT_TEST(Split_RCU_GPB_cmpmix)
910 CPPUNIT_TEST( Split_RCU_GPB_cmpmix_stat )
912 CPPUNIT_TEST(Split_RCU_GPT_cmp)
913 CPPUNIT_TEST(Split_RCU_GPT_less)
914 CPPUNIT_TEST(Split_RCU_GPT_cmpmix)
915 CPPUNIT_TEST( Split_RCU_GPT_cmpmix_stat )
917 CPPUNIT_TEST(Split_RCU_SHB_cmp)
918 CPPUNIT_TEST(Split_RCU_SHB_less)
919 CPPUNIT_TEST(Split_RCU_SHB_cmpmix)
920 CPPUNIT_TEST( Split_RCU_SHB_cmpmix_stat )
922 CPPUNIT_TEST(Split_RCU_SHT_cmp)
923 CPPUNIT_TEST(Split_RCU_SHT_less)
924 CPPUNIT_TEST(Split_RCU_SHT_cmpmix)
925 CPPUNIT_TEST( Split_RCU_SHT_cmpmix_stat )
927 CPPUNIT_TEST(Split_nogc_cmp)
928 CPPUNIT_TEST(Split_nogc_less)
929 CPPUNIT_TEST(Split_nogc_cmpmix)
930 CPPUNIT_TEST( Split_nogc_cmpmix_stat )
932 CPPUNIT_TEST(Split_Lazy_HP_cmp)
933 CPPUNIT_TEST(Split_Lazy_HP_less)
934 CPPUNIT_TEST(Split_Lazy_HP_cmpmix)
935 CPPUNIT_TEST( Split_Lazy_HP_cmpmix_stat )
937 CPPUNIT_TEST(Split_Lazy_DHP_cmp)
938 CPPUNIT_TEST(Split_Lazy_DHP_less)
939 CPPUNIT_TEST(Split_Lazy_DHP_cmpmix)
940 CPPUNIT_TEST( Split_Lazy_DHP_cmpmix_stat )
942 CPPUNIT_TEST(Split_Lazy_RCU_GPI_cmp)
943 CPPUNIT_TEST(Split_Lazy_RCU_GPI_less)
944 CPPUNIT_TEST(Split_Lazy_RCU_GPI_cmpmix)
945 CPPUNIT_TEST( Split_Lazy_RCU_GPI_cmpmix_stat )
947 CPPUNIT_TEST(Split_Lazy_RCU_GPB_cmp)
948 CPPUNIT_TEST(Split_Lazy_RCU_GPB_less)
949 CPPUNIT_TEST(Split_Lazy_RCU_GPB_cmpmix)
950 CPPUNIT_TEST( Split_Lazy_RCU_GPB_cmpmix_stat )
952 CPPUNIT_TEST(Split_Lazy_RCU_GPT_cmp)
953 CPPUNIT_TEST(Split_Lazy_RCU_GPT_less)
954 CPPUNIT_TEST(Split_Lazy_RCU_GPT_cmpmix)
955 CPPUNIT_TEST( Split_Lazy_RCU_GPT_cmpmix_stat )
957 CPPUNIT_TEST(Split_Lazy_RCU_SHB_cmp)
958 CPPUNIT_TEST(Split_Lazy_RCU_SHB_less)
959 CPPUNIT_TEST(Split_Lazy_RCU_SHB_cmpmix)
960 CPPUNIT_TEST( Split_Lazy_RCU_SHB_cmpmix_stat )
962 CPPUNIT_TEST(Split_Lazy_RCU_SHT_cmp)
963 CPPUNIT_TEST(Split_Lazy_RCU_SHT_less)
964 CPPUNIT_TEST(Split_Lazy_RCU_SHT_cmpmix)
965 CPPUNIT_TEST( Split_Lazy_RCU_SHT_cmpmix_stat )
967 CPPUNIT_TEST(Split_Lazy_nogc_cmp)
968 CPPUNIT_TEST(Split_Lazy_nogc_less)
969 CPPUNIT_TEST(Split_Lazy_nogc_cmpmix)
970 CPPUNIT_TEST( Split_Lazy_nogc_cmpmix_stat )
971 CPPUNIT_TEST_SUITE_END()
976 #endif // #ifndef __CDSTEST_HDR_MAP_H