3 #ifndef CDSTEST_HDR_LAZY_H
4 #define CDSTEST_HDR_LAZY_H
6 #include "cppunit/cppunit_proxy.h"
7 #include <cds/container/details/lazy_list_base.h>
10 namespace cc = cds::container;
11 namespace co = cds::container::opt;
13 class LazyListTestHeader: public CppUnitMini::TestCase
17 int nUpdateExistsCall;
40 item(int key, int val)
61 bool operator ()(const T& v1, const T& v2 ) const
63 return v1.key() < v2.key();
67 bool operator ()(const T& v1, const Q& v2 ) const
73 bool operator ()(const Q& v1, const T& v2 ) const
82 bool operator ()(const T& v1, const T& v2 ) const
84 return v1.key() == v2.key();
88 bool operator ()(const T& v1, const Q& v2 ) const
90 return v1.key() == v2;
94 bool operator ()(const Q& v1, const T& v2 ) const
96 return v1 == v2.key();
100 template <typename T>
102 int operator ()(const T& v1, const T& v2 ) const
104 if ( v1.key() < v2.key() )
106 return v1.key() > v2.key() ? 1 : 0;
109 template <typename Q>
110 int operator ()(const T& v1, const Q& v2 ) const
114 return v1.key() > v2 ? 1 : 0;
117 template <typename Q>
118 int operator ()(const Q& v1, const T& v2 ) const
122 return v1 > v2.key() ? 1 : 0;
126 struct insert_functor {
127 void operator ()( item& i )
129 i.nVal = i.nKey * 1033;
132 struct dummy_insert_functor {
133 void operator ()( item& /*i*/ )
135 // This functor should not be called
136 TestCase::current_test()->error( "CPPUNIT_ASSERT", "dummy_insert_functor should not be called", __FILE__, __LINE__ );
140 static void insert_function( item& i )
142 i.nVal = i.nKey * 1024;
144 static void dummy_insert_function( item& /*i*/ )
146 // This function should not be called
147 TestCase::current_test()->error( "CPPUNIT_ASSERT", "dummy_insert_function should not be called", __FILE__, __LINE__ );
150 struct erase_functor {
151 unsigned int nEraseCall;
157 void operator()( item const& /*i*/)
164 unsigned int m_nMultiplier;
166 check_value( unsigned int nMultiplier )
167 : m_nMultiplier( nMultiplier )
170 check_value( const check_value& s )
171 : m_nMultiplier( s.m_nMultiplier )
174 void operator()( item& i, int )
176 CPPUNIT_ASSERT_CURRENT( int(i.nKey * m_nMultiplier) == i.nVal );
180 struct check_exact_value {
183 check_exact_value( int nExpected )
184 : m_nExpected( nExpected )
187 check_exact_value( check_exact_value const& s)
188 : m_nExpected( s.m_nExpected )
191 void operator()( item& i, int )
193 CPPUNIT_ASSERT_CURRENT( i.nVal == m_nExpected );
197 struct dummy_check_value {
198 void operator()( item& /*i*/, int )
200 // This functor should not be called
201 TestCase::current_test()->error( "CPPUNIT_ASSERT", "dummy_check_value should not be called", __FILE__, __LINE__ );
205 struct update_functor {
206 void operator()( bool /*bNew*/, item& i, int /*n*/ )
208 i.nVal = i.nKey * 1024;
212 static void update_func( bool /*bNew*/, item& i, int n )
231 template <typename T1, typename T2>
232 bool operator()( T1 const& t1, T2 const& t2 ) const
234 return t1.nKey < t2.nKey;
239 template <class OrdList>
240 void test_with( OrdList& l )
242 typedef typename OrdList::value_type value_type;
244 // The list should be empty
245 CPPUNIT_ASSERT( l.empty() );
248 CPPUNIT_ASSERT( l.insert( 50 ) );
249 CPPUNIT_ASSERT( l.insert( item( 25 )) );
250 CPPUNIT_ASSERT( l.insert( item( 100 )) );
252 // insert failed - such key exists
253 CPPUNIT_ASSERT( !l.insert( 50 ) );
254 CPPUNIT_ASSERT( !l.insert( item( 100 )) );
258 // The list should not be empty
259 CPPUNIT_ASSERT( !l.empty() );
261 // and now the list is empty
262 CPPUNIT_ASSERT( l.empty() );
264 // Test insert with functor
266 CPPUNIT_ASSERT( l.insert( 100, insert_functor() ) );
270 CPPUNIT_ASSERT( l.insert( item( 25 ), std::ref( f ) ) );
271 CPPUNIT_ASSERT( !l.insert( item( 100 ), std::ref( f ) ) );
273 // Test insert with function
274 CPPUNIT_ASSERT( l.insert( 50, insert_function ));
275 CPPUNIT_ASSERT( !l.insert( 25, dummy_insert_function ));
276 CPPUNIT_ASSERT( !l.insert( 100, dummy_insert_functor() ));
278 // The list should not be empty
279 CPPUNIT_ASSERT( !l.empty() );
281 // Check inserted values
286 CPPUNIT_ASSERT( l.contains( 100 ));
287 CPPUNIT_ASSERT( l.find( i, check_value(1033) ));
291 CPPUNIT_ASSERT( l.contains( 25, lt<value_type>() ));
292 CPPUNIT_ASSERT( l.find_with( i, lt<value_type>(), std::ref( f ) ) );
295 CPPUNIT_ASSERT( l.contains( 50 ));
296 CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
299 CPPUNIT_ASSERT( !l.contains( 10, lt<value_type>() ));
300 CPPUNIT_ASSERT( !l.find_with( i, lt<value_type>(), dummy_check_value() ));
302 CPPUNIT_ASSERT( !l.contains( 75 ));
303 CPPUNIT_ASSERT( !l.find( i, dummy_check_value() ));
305 CPPUNIT_ASSERT( !l.contains( 150 ));
306 CPPUNIT_ASSERT( !l.find( i, dummy_check_value() ));
309 // The list should not be empty
310 CPPUNIT_ASSERT( !l.empty() );
312 // and now the list is empty
313 CPPUNIT_ASSERT( l.empty() );
317 std::pair<bool, bool> updateResult;
319 updateResult = l.update( 100, update_functor() );
320 CPPUNIT_ASSERT( updateResult.first );
321 CPPUNIT_ASSERT( updateResult.second );
323 updateResult = l.update( 200, std::ref( f ) );
324 CPPUNIT_ASSERT( updateResult.first );
325 CPPUNIT_ASSERT( updateResult.second );
327 updateResult = l.update( 50, update_func );
328 CPPUNIT_ASSERT( updateResult.first );
329 CPPUNIT_ASSERT( updateResult.second );
333 CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
335 CPPUNIT_ASSERT( l.find( i, check_value(1033) ));
337 CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
339 // update existing key
340 updateResult = l.update( 200, update_func );
341 CPPUNIT_ASSERT( updateResult.first );
342 CPPUNIT_ASSERT( !updateResult.second );
344 CPPUNIT_ASSERT( l.find( i, check_value(1033) ));
346 updateResult = l.update( 50, update_functor() );
347 CPPUNIT_ASSERT( updateResult.first );
348 CPPUNIT_ASSERT( !updateResult.second );
350 CPPUNIT_ASSERT( l.find( i, check_value(1024) ));
353 // erase test (list: 50, 100, 200)
354 CPPUNIT_ASSERT( !l.empty() );
355 CPPUNIT_ASSERT( l.insert(160));
356 CPPUNIT_ASSERT( l.insert(250));
357 CPPUNIT_ASSERT( !l.empty() );
359 CPPUNIT_ASSERT( !l.erase( 150 ));
361 CPPUNIT_ASSERT( l.erase( 100 ));
362 CPPUNIT_ASSERT( !l.erase( 100 ));
364 CPPUNIT_ASSERT( l.erase_with( 200, lt<value_type>() ));
365 CPPUNIT_ASSERT( !l.erase_with( 200, lt<value_type>() ));
369 CPPUNIT_ASSERT( ef.nEraseCall == 0 );
370 CPPUNIT_ASSERT( l.erase_with( 160, lt<value_type>(), std::ref(ef) ));
371 CPPUNIT_ASSERT( ef.nEraseCall == 1 );
372 CPPUNIT_ASSERT( !l.erase_with( 160, lt<value_type>(), std::ref(ef) ));
373 CPPUNIT_ASSERT( ef.nEraseCall == 1 );
375 CPPUNIT_ASSERT( l.erase( 250, std::ref(ef) ));
376 CPPUNIT_ASSERT( ef.nEraseCall == 2 );
377 CPPUNIT_ASSERT( !l.erase( 250, std::ref(ef) ));
378 CPPUNIT_ASSERT( ef.nEraseCall == 2 );
381 CPPUNIT_ASSERT( l.erase( 50 ));
382 CPPUNIT_ASSERT( !l.erase( 50 ));
384 CPPUNIT_ASSERT( l.empty() );
388 CPPUNIT_ASSERT( l.empty() );
393 CPPUNIT_ASSERT( l.emplace( 501 ) );
394 CPPUNIT_ASSERT( l.emplace( 251, 152 ));
395 CPPUNIT_ASSERT( l.emplace( item( 1001 )) );
397 // insert failed - such key exists
398 CPPUNIT_ASSERT( !l.emplace( 501, 2 ) );
399 CPPUNIT_ASSERT( !l.emplace( 251, 10) );
402 CPPUNIT_ASSERT( l.find( i, check_exact_value(501*2) ));
404 CPPUNIT_ASSERT( l.find( i, check_exact_value(152) ));
406 CPPUNIT_ASSERT( l.find( i, check_exact_value(1001*2) ));
409 CPPUNIT_ASSERT( l.empty() );
415 for ( int i = 0; i < nCount; ++i )
416 CPPUNIT_ASSERT( l.insert( i ) );
419 typename OrdList::iterator it( l.begin() );
420 typename OrdList::const_iterator cit( l.cbegin() );
421 CPPUNIT_CHECK( it == cit );
422 CPPUNIT_CHECK( it != l.end() );
423 CPPUNIT_CHECK( it != l.cend() );
424 CPPUNIT_CHECK( cit != l.end() );
425 CPPUNIT_CHECK( cit != l.cend() );
427 CPPUNIT_CHECK( it != cit );
428 CPPUNIT_CHECK( it != l.end() );
429 CPPUNIT_CHECK( it != l.cend() );
430 CPPUNIT_CHECK( cit != l.end() );
431 CPPUNIT_CHECK( cit != l.cend() );
433 CPPUNIT_CHECK( it == cit );
434 CPPUNIT_CHECK( it != l.end() );
435 CPPUNIT_CHECK( it != l.cend() );
436 CPPUNIT_CHECK( cit != l.end() );
437 CPPUNIT_CHECK( cit != l.cend() );
441 for ( typename OrdList::iterator it = l.begin(), itEnd = l.end(); it != itEnd; ++it, ++i ) {
443 CPPUNIT_ASSERT( it->nKey == i );
446 // Check that we have visited all items
447 for ( int i = 0; i < nCount; ++i )
448 CPPUNIT_ASSERT( l.find( i, check_value(2) ));
451 CPPUNIT_ASSERT( l.empty() );
454 for ( int i = 0; i < nCount; ++i )
455 CPPUNIT_ASSERT( l.insert(i) );
458 const OrdList& rl = l;
459 for ( typename OrdList::const_iterator it = rl.begin(), itEnd = rl.end(); it != itEnd; ++it, ++i ) {
460 // it->nVal = i * 2 ; // not!
461 CPPUNIT_ASSERT( it->nKey == i );
464 // Check that we have visited all items
465 for ( int i = 0; i < nCount; ++i )
466 CPPUNIT_ASSERT( l.find_with( i, lt<value_type>(), check_value(2) ));
469 CPPUNIT_ASSERT( l.empty() );
473 template <class OrdList>
476 typedef typename OrdList::guarded_ptr guarded_ptr;
477 typedef typename OrdList::value_type value_type;
482 static int const nLimit = 20;
484 for ( int i = 0; i < nLimit; i++ )
486 shuffle( arr, arr + nLimit );
489 for ( int i = 0; i < nLimit; ++i )
493 for ( int i = 0; i < nLimit; ++i ) {
497 CPPUNIT_ASSERT( gp );
498 CPPUNIT_ASSERT( !gp.empty());
499 CPPUNIT_CHECK( gp->nKey == nKey );
500 CPPUNIT_CHECK( gp->nVal == nKey * 2 );
503 gp = l.extract( nKey );
504 CPPUNIT_ASSERT( gp );
505 CPPUNIT_ASSERT( !gp.empty());
506 CPPUNIT_CHECK( gp->nKey == nKey );
507 CPPUNIT_CHECK( gp->nVal == nKey*2 );
511 CPPUNIT_CHECK( !gp );
512 CPPUNIT_CHECK( gp.empty());
513 CPPUNIT_CHECK( !l.extract( nKey));
514 CPPUNIT_CHECK( gp.empty());
516 CPPUNIT_ASSERT( l.empty());
517 CPPUNIT_CHECK( !l.get(arr[0]));
518 CPPUNIT_CHECK( gp.empty());
519 CPPUNIT_CHECK( !l.extract( arr[0]));
520 CPPUNIT_CHECK( gp.empty());
523 // extract_with/get_with
524 for ( int i = 0; i < nLimit; ++i )
528 for ( int i = 0; i < nLimit; ++i ) {
530 other_item key( nKey );
532 gp = l.get_with( key, other_less() );
533 CPPUNIT_ASSERT( gp );
534 CPPUNIT_ASSERT( !gp.empty());
535 CPPUNIT_CHECK( gp->nKey == nKey );
536 CPPUNIT_CHECK( gp->nVal == nKey * 2 );
539 gp = l.extract_with( key, other_less() );
540 CPPUNIT_ASSERT( gp );
541 CPPUNIT_ASSERT( !gp.empty());
542 CPPUNIT_CHECK( gp->nKey == nKey );
543 CPPUNIT_CHECK( gp->nVal == nKey*2 );
546 gp = l.get_with( key, other_less() );
547 CPPUNIT_CHECK( !gp );
548 CPPUNIT_CHECK( gp.empty());
549 CPPUNIT_CHECK( !l.extract_with( key, other_less()));
550 CPPUNIT_CHECK( gp.empty());
552 CPPUNIT_ASSERT( l.empty());
553 CPPUNIT_CHECK( !l.get_with(other_item(arr[0]), other_less()));
554 CPPUNIT_CHECK( gp.empty());
555 CPPUNIT_CHECK( !l.extract_with( other_item(arr[0]), other_less()));
556 CPPUNIT_CHECK( gp.empty());
561 template <class OrdList>
567 static int const nLimit = 20;
569 typedef typename OrdList::rcu_lock rcu_lock;
570 typedef typename OrdList::value_type value_type;
571 typedef typename OrdList::gc rcu_type;
575 for (int i = 0; i < nLimit; ++i)
577 shuffle( a, a + nLimit );
580 for ( int i = 0; i < nLimit; ++i )
581 CPPUNIT_ASSERT( l.insert( a[i] ) );
583 typename OrdList::exempt_ptr ep;
585 for ( int i = 0; i < nLimit; ++i ) {
588 value_type * pGet = l.get( a[i] );
589 CPPUNIT_ASSERT( pGet != nullptr );
590 CPPUNIT_CHECK( pGet->nKey == a[i] );
591 CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
593 ep = l.extract( a[i] );
594 CPPUNIT_ASSERT( ep );
595 CPPUNIT_ASSERT( !ep.empty() );
596 CPPUNIT_CHECK( ep->nKey == a[i] );
597 CPPUNIT_CHECK( (*ep).nVal == a[i] * 2 );
602 CPPUNIT_CHECK( l.get( a[i] ) == nullptr );
603 CPPUNIT_CHECK( !l.extract( a[i] ));
606 CPPUNIT_ASSERT( l.empty() );
610 CPPUNIT_CHECK( l.get( a[0] ) == nullptr );
611 ep = l.extract( a[0] );
612 CPPUNIT_CHECK( !ep );
613 CPPUNIT_CHECK( ep.empty() );
616 // extract_with/get_with
617 for ( int i = 0; i < nLimit; ++i ) {
618 CPPUNIT_ASSERT( l.insert( a[i] ) );
621 for ( int i = 0; i < nLimit; ++i ) {
622 other_item itm( a[i] );
625 value_type * pGet = l.get_with( itm, other_less() );
626 CPPUNIT_ASSERT( pGet != nullptr );
627 CPPUNIT_CHECK( pGet->nKey == a[i] );
628 CPPUNIT_CHECK( pGet->nVal == a[i] * 2 );
630 ep = l.extract_with( itm, other_less() );
631 CPPUNIT_ASSERT( ep );
632 CPPUNIT_ASSERT( !ep.empty() );
633 CPPUNIT_CHECK( ep->nKey == a[i] );
634 CPPUNIT_CHECK( ep->nVal == a[i] * 2 );
639 CPPUNIT_CHECK( l.get_with( itm, other_less() ) == nullptr );
640 ep = l.extract_with( itm, other_less() );
641 CPPUNIT_CHECK( !ep );
642 CPPUNIT_CHECK( ep.empty() );
645 CPPUNIT_ASSERT( l.empty() );
649 CPPUNIT_CHECK( l.get_with( other_item( 0 ), other_less() ) == nullptr );
650 CPPUNIT_CHECK( !l.extract_with( other_item(0), other_less() ));
651 CPPUNIT_CHECK( ep.empty() );
656 template <class OrdList>
659 typedef OrdList list;
660 typedef typename list::value_type value_type;
661 typedef std::pair<typename list::iterator, bool> update_result;
663 typename list::iterator it;
666 CPPUNIT_ASSERT( l.empty() );
667 CPPUNIT_ASSERT( l.insert(50) != l.end() );
668 CPPUNIT_ASSERT( !l.empty() );
670 update_result eres = l.update( item(100, 33) );
671 CPPUNIT_ASSERT( eres.second );
672 CPPUNIT_ASSERT( eres.first != l.end() );
673 CPPUNIT_ASSERT( l.insert( item(150) ) != l.end() );
675 CPPUNIT_ASSERT( l.insert(100) == l.end() );
676 eres = l.update( item(50, 33) );
677 CPPUNIT_ASSERT( !eres.second );
678 CPPUNIT_ASSERT( eres.first->nVal == eres.first->nKey * 2 );
679 eres.first->nVal = 63;
681 it = l.contains( 33 );
682 CPPUNIT_ASSERT( it == l.end() );
684 it = l.contains( 50 );
685 CPPUNIT_ASSERT( it != l.end() );
686 CPPUNIT_ASSERT( it->nKey == 50 );
687 CPPUNIT_ASSERT( it->nVal == 63 );
689 it = l.contains( 100 );
690 CPPUNIT_ASSERT( it != l.end() );
691 CPPUNIT_ASSERT( it->nKey == 100 );
692 CPPUNIT_ASSERT( it->nVal == 33 );
694 it = l.contains( 150, lt<value_type>() );
695 CPPUNIT_ASSERT( it != l.end() );
696 CPPUNIT_ASSERT( it->nKey == 150 );
697 CPPUNIT_ASSERT( it->nVal == it->nKey * 2 );
699 CPPUNIT_ASSERT( !l.empty() );
701 CPPUNIT_ASSERT( l.empty() );
704 CPPUNIT_ASSERT( l.emplace( 501 ) != l.end());
705 CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
706 CPPUNIT_ASSERT( l.emplace( item( 1001 )) != l.end());
708 // insert failed - such key exists
709 CPPUNIT_ASSERT( l.emplace( 501, 2 ) == l.end());
710 CPPUNIT_ASSERT( l.emplace( 251, 10) == l.end());
712 it = l.contains( 501 );
713 CPPUNIT_ASSERT( it != l.end() );
714 CPPUNIT_ASSERT( it->nKey == 501 );
715 CPPUNIT_ASSERT( it->nVal == 501 * 2 );
717 it = l.contains( 251, lt<value_type>() );
718 CPPUNIT_ASSERT( it != l.end() );
719 CPPUNIT_ASSERT( it->nKey == 251 );
720 CPPUNIT_ASSERT( it->nVal == 152 );
722 it = l.contains( 1001 );
723 CPPUNIT_ASSERT( it != l.end() );
724 CPPUNIT_ASSERT( it->nKey == 1001 );
725 CPPUNIT_ASSERT( it->nVal == 1001 * 2 );
728 typename OrdList::iterator it( l.begin() );
729 typename OrdList::const_iterator cit( l.cbegin() );
730 CPPUNIT_CHECK( it == cit );
731 CPPUNIT_CHECK( it != l.end() );
732 CPPUNIT_CHECK( it != l.cend() );
733 CPPUNIT_CHECK( cit != l.end() );
734 CPPUNIT_CHECK( cit != l.cend() );
736 CPPUNIT_CHECK( it != cit );
737 CPPUNIT_CHECK( it != l.end() );
738 CPPUNIT_CHECK( it != l.cend() );
739 CPPUNIT_CHECK( cit != l.end() );
740 CPPUNIT_CHECK( cit != l.cend() );
742 CPPUNIT_CHECK( it == cit );
743 CPPUNIT_CHECK( it != l.end() );
744 CPPUNIT_CHECK( it != l.cend() );
745 CPPUNIT_CHECK( cit != l.end() );
746 CPPUNIT_CHECK( cit != l.cend() );
751 CPPUNIT_ASSERT( l.empty() );
754 template <class UnordList>
755 void nogc_unord_test()
757 typedef UnordList list;
758 typedef typename list::value_type value_type;
759 typedef std::pair<typename list::iterator, bool> update_result;
761 typename list::iterator it;
764 CPPUNIT_ASSERT( l.empty() );
765 CPPUNIT_ASSERT( l.insert(50) != l.end() );
766 CPPUNIT_ASSERT( !l.empty() );
768 update_result eres = l.update( item(100, 33) );
769 CPPUNIT_ASSERT( eres.second );
770 CPPUNIT_ASSERT( eres.first != l.end() );
771 CPPUNIT_ASSERT( l.insert( item(150) ) != l.end() );
773 CPPUNIT_ASSERT( l.insert(100) == l.end() );
774 eres = l.update( item(50, 33) );
775 CPPUNIT_ASSERT( !eres.second );
776 CPPUNIT_ASSERT( eres.first->nVal == eres.first->nKey * 2 );
777 eres.first->nVal = 63;
779 it = l.contains( 33 );
780 CPPUNIT_ASSERT( it == l.end() );
782 it = l.contains( 50 );
783 CPPUNIT_ASSERT( it != l.end() );
784 CPPUNIT_ASSERT( it->nKey == 50 );
785 CPPUNIT_ASSERT( it->nVal == 63 );
787 it = l.contains( 100 );
788 CPPUNIT_ASSERT( it != l.end() );
789 CPPUNIT_ASSERT( it->nKey == 100 );
790 CPPUNIT_ASSERT( it->nVal == 33 );
792 it = l.contains( 150, equal_to<value_type>() );
793 CPPUNIT_ASSERT( it != l.end() );
794 CPPUNIT_ASSERT( it->nKey == 150 );
795 CPPUNIT_ASSERT( it->nVal == it->nKey * 2 );
797 CPPUNIT_ASSERT( !l.empty() );
799 CPPUNIT_ASSERT( l.empty() );
802 CPPUNIT_ASSERT( l.emplace( 501 ) != l.end());
803 CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end());
804 CPPUNIT_ASSERT( l.emplace( item( 1001 )) != l.end());
806 // insert failed - such key exists
807 CPPUNIT_ASSERT( l.emplace( 501, 2 ) == l.end());
808 CPPUNIT_ASSERT( l.emplace( 251, 10) == l.end());
810 it = l.contains( 501 );
811 CPPUNIT_ASSERT( it != l.end() );
812 CPPUNIT_ASSERT( it->nKey == 501 );
813 CPPUNIT_ASSERT( it->nVal == 501 * 2 );
815 it = l.contains( 1001 );
816 CPPUNIT_ASSERT( it != l.end() );
817 CPPUNIT_ASSERT( it->nKey == 1001 );
818 CPPUNIT_ASSERT( it->nVal == 1001 * 2 );
821 typename UnordList::iterator it( l.begin() );
822 typename UnordList::const_iterator cit( l.cbegin() );
823 CPPUNIT_CHECK( it == cit );
824 CPPUNIT_CHECK( it != l.end() );
825 CPPUNIT_CHECK( it != l.cend() );
826 CPPUNIT_CHECK( cit != l.end() );
827 CPPUNIT_CHECK( cit != l.cend() );
829 CPPUNIT_CHECK( it != cit );
830 CPPUNIT_CHECK( it != l.end() );
831 CPPUNIT_CHECK( it != l.cend() );
832 CPPUNIT_CHECK( cit != l.end() );
833 CPPUNIT_CHECK( cit != l.cend() );
835 CPPUNIT_CHECK( it == cit );
836 CPPUNIT_CHECK( it != l.end() );
837 CPPUNIT_CHECK( it != l.cend() );
838 CPPUNIT_CHECK( cit != l.end() );
839 CPPUNIT_CHECK( cit != l.cend() );
844 CPPUNIT_ASSERT( l.empty() );
859 void RCU_GPI_cmpmix();
864 void RCU_GPB_cmpmix();
869 void RCU_GPT_cmpmix();
874 void RCU_SHB_cmpmix();
879 void RCU_SHT_cmpmix();
887 void NOGC_cmp_unord();
888 void NOGC_less_unord();
889 void NOGC_equal_to_unord();
890 void NOGC_cmpmix_unord();
891 void NOGC_equal_to_mix_unord();
892 void NOGC_ic_unord();
895 CPPUNIT_TEST_SUITE(LazyListTestHeader)
897 CPPUNIT_TEST(HP_less)
898 CPPUNIT_TEST(HP_cmpmix)
901 CPPUNIT_TEST(DHP_cmp)
902 CPPUNIT_TEST(DHP_less)
903 CPPUNIT_TEST(DHP_cmpmix)
906 CPPUNIT_TEST(RCU_GPI_cmp)
907 CPPUNIT_TEST(RCU_GPI_less)
908 CPPUNIT_TEST(RCU_GPI_cmpmix)
909 CPPUNIT_TEST(RCU_GPI_ic)
911 CPPUNIT_TEST(RCU_GPB_cmp)
912 CPPUNIT_TEST(RCU_GPB_less)
913 CPPUNIT_TEST(RCU_GPB_cmpmix)
914 CPPUNIT_TEST(RCU_GPB_ic)
916 CPPUNIT_TEST(RCU_GPT_cmp)
917 CPPUNIT_TEST(RCU_GPT_less)
918 CPPUNIT_TEST(RCU_GPT_cmpmix)
919 CPPUNIT_TEST(RCU_GPT_ic)
921 CPPUNIT_TEST(RCU_SHB_cmp)
922 CPPUNIT_TEST(RCU_SHB_less)
923 CPPUNIT_TEST(RCU_SHB_cmpmix)
924 CPPUNIT_TEST(RCU_SHB_ic)
926 CPPUNIT_TEST(RCU_SHT_cmp)
927 CPPUNIT_TEST(RCU_SHT_less)
928 CPPUNIT_TEST(RCU_SHT_cmpmix)
929 CPPUNIT_TEST(RCU_SHT_ic)
931 CPPUNIT_TEST(NOGC_cmp)
932 CPPUNIT_TEST(NOGC_less)
933 CPPUNIT_TEST(NOGC_cmpmix)
934 CPPUNIT_TEST(NOGC_ic)
936 CPPUNIT_TEST(NOGC_cmp_unord)
937 CPPUNIT_TEST(NOGC_less_unord)
938 CPPUNIT_TEST(NOGC_equal_to_unord)
939 CPPUNIT_TEST(NOGC_cmpmix_unord)
940 CPPUNIT_TEST(NOGC_equal_to_mix_unord)
941 CPPUNIT_TEST(NOGC_ic_unord)
943 CPPUNIT_TEST_SUITE_END()
946 } // namespace ordlist
948 #endif // #ifndef CDSTEST_HDR_LAZY_H