X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=blobdiff_plain;f=test%2Funit%2Fintrusive-set%2Fintrusive_michael_lazy_dhp.cpp;h=5931528a0cd2bc97ad6b16467c4c2867e33ec56e;hp=4b2a2ce1ccd8c7ee62d1c37a97f79121a09cd16f;hb=a8ecd3a68632d52c668ef28d37f9289e9b02e46b;hpb=4cfc2b411754b8a33010c95776bf97e70ee89b95 diff --git a/test/unit/intrusive-set/intrusive_michael_lazy_dhp.cpp b/test/unit/intrusive-set/intrusive_michael_lazy_dhp.cpp index 4b2a2ce1..5931528a 100644 --- a/test/unit/intrusive-set/intrusive_michael_lazy_dhp.cpp +++ b/test/unit/intrusive-set/intrusive_michael_lazy_dhp.cpp @@ -158,6 +158,49 @@ namespace { test( s ); } + TEST_F( IntrusiveMichaelLazySet_DHP, base_stat ) + { + struct list_traits: public ci::lazy_list::traits + { + typedef ci::lazy_list::base_hook< ci::opt::gc> hook; + typedef base_class::less less; + typedef mock_disposer disposer; + typedef ci::lazy_list::stat<> stat; + }; + typedef ci::LazyList< gc_type, base_item_type, list_traits > bucket_type; + + struct set_traits: public ci::michael_set::traits + { + typedef hash_int hash; + typedef simple_item_counter item_counter; + }; + typedef ci::MichaelHashSet< gc_type, bucket_type, set_traits > set_type; + + set_type s( kSize, 2 ); + test( s ); + } + + TEST_F( IntrusiveMichaelLazySet_DHP, base_wrapped_stat ) + { + struct list_traits: public ci::lazy_list::traits + { + typedef ci::lazy_list::base_hook< ci::opt::gc> hook; + typedef base_class::less less; + typedef mock_disposer disposer; + typedef ci::lazy_list::wrapped_stat<> stat; + }; + typedef ci::LazyList< gc_type, base_item_type, list_traits > bucket_type; + + struct set_traits: public ci::michael_set::traits + { + typedef hash_int hash; + typedef simple_item_counter item_counter; + }; + typedef ci::MichaelHashSet< gc_type, bucket_type, set_traits > set_type; + + set_type s( kSize, 2 ); + test( s ); + } TEST_F( IntrusiveMichaelLazySet_DHP, member_cmp ) { @@ -251,4 +294,48 @@ namespace { test( s ); } + TEST_F( IntrusiveMichaelLazySet_DHP, member_stat ) + { + struct list_traits: public ci::lazy_list::traits + { + typedef ci::lazy_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc> hook; + typedef cmp compare; + typedef mock_disposer disposer; + typedef ci::lazy_list::stat<> stat; + }; + typedef ci::LazyList< gc_type, member_item_type, list_traits > bucket_type; + + struct set_traits: public ci::michael_set::traits + { + typedef hash_int hash; + typedef simple_item_counter item_counter; + }; + typedef ci::MichaelHashSet< gc_type, bucket_type, set_traits > set_type; + + set_type s( kSize, 2 ); + test( s ); + } + + TEST_F( IntrusiveMichaelLazySet_DHP, member_wrapped_stat ) + { + struct list_traits: public ci::lazy_list::traits + { + typedef ci::lazy_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc> hook; + typedef cmp compare; + typedef mock_disposer disposer; + typedef ci::lazy_list::wrapped_stat<> stat; + }; + typedef ci::LazyList< gc_type, member_item_type, list_traits > bucket_type; + + struct set_traits: public ci::michael_set::traits + { + typedef hash_int hash; + typedef simple_item_counter item_counter; + }; + typedef ci::MichaelHashSet< gc_type, bucket_type, set_traits > set_type; + + set_type s( kSize, 2 ); + test( s ); + } + } // namespace