X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2Funit%2Fpqueue%2Ffcpqueue_vector.cpp;h=95f213726f3907174a142a2c5557b29dfa133322;hb=6912d51a86c80e0a830a788de0581f524576916c;hp=6de4855a4bb5f703317af82cfc7e938c40131f22;hpb=7448008aa977fe42a83738fbbc63ce11d8ab86f9;p=libcds.git diff --git a/test/unit/pqueue/fcpqueue_vector.cpp b/test/unit/pqueue/fcpqueue_vector.cpp index 6de4855a..95f21372 100644 --- a/test/unit/pqueue/fcpqueue_vector.cpp +++ b/test/unit/pqueue/fcpqueue_vector.cpp @@ -1,7 +1,7 @@ /* This file is a part of libcds - Concurrent Data Structures library - (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016 + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017 Source code repo: http://github.com/khizmax/libcds/ Download: http://sourceforge.net/projects/libcds/files/ @@ -40,6 +40,50 @@ namespace cds_test { test( pq ); } + TEST_F( FCPQueue, vector_empty_wait_strategy ) + { + struct pqueue_traits : public cds::container::fcpqueue::traits + { + typedef cds::container::fcpqueue::stat<> stat; + typedef cds::algo::flat_combining::wait_strategy::empty wait_strategy; + }; + + typedef cds::container::FCPriorityQueue< + value_type + , std::priority_queue< + value_type + , std::vector + , less + > + , pqueue_traits + > pqueue_type; + + pqueue_type pq; + test( pq ); + } + + TEST_F( FCPQueue, vector_multi_mutex_multi_condvar ) + { + struct pqueue_traits : public cds::container::fcpqueue::traits + { + typedef cds::container::fcpqueue::stat<> stat; + typedef cds::algo::flat_combining::wait_strategy::multi_mutex_multi_condvar<> wait_strategy; + }; + + typedef cds::container::FCPriorityQueue< + value_type + , std::priority_queue< + value_type + , std::vector + , less + > + , pqueue_traits + > pqueue_type; + + pqueue_type pq; + test( pq ); + } + TEST_F( FCPQueue, vector_stat ) { struct pqueue_traits : public cds::container::fcpqueue::traits @@ -61,6 +105,28 @@ namespace cds_test { test( pq ); } + TEST_F( FCPQueue, vector_stat_single_mutex_multi_condvar ) + { + struct pqueue_traits : public cds::container::fcpqueue::traits + { + typedef cds::container::fcpqueue::stat<> stat; + typedef cds::algo::flat_combining::wait_strategy::single_mutex_multi_condvar<42> wait_strategy; + }; + + typedef cds::container::FCPriorityQueue< + value_type + , std::priority_queue< + value_type + , std::vector + , less + > + , pqueue_traits + > pqueue_type; + + pqueue_type pq; + test( pq ); + } + TEST_F( FCPQueue, vector_mutex ) { typedef cds::container::FCPriorityQueue< @@ -75,4 +141,19 @@ namespace cds_test { test( pq ); } + TEST_F( FCPQueue, vector_single_mutex_single_condvar ) + { + typedef cds::container::FCPriorityQueue< + value_type + ,std::priority_queue< value_type > + ,cds::container::fcpqueue::make_traits< + cds::opt::lock_type< std::mutex > + , cds::opt::wait_strategy< cds::algo::flat_combining::wait_strategy::single_mutex_single_condvar<1000>> + >::type + > pqueue_type; + + pqueue_type pq; + test( pq ); + } + } // namespace cds_test