X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=blobdiff_plain;f=test%2Fstress%2Fqueue%2Fpush_pop.cpp;h=b12a19982c3dfab794fe55c27e620344890ee6dc;hp=14b027652054931e3b7a0aadb45964f045103b7b;hb=ec53bf39af3914a93bd1f53fa8657d5f87583d01;hpb=8abb8f5e76bd8d723aff8078934ee30e59fa117a diff --git a/test/stress/queue/push_pop.cpp b/test/stress/queue/push_pop.cpp index 14b02765..b12a1998 100644 --- a/test/stress/queue/push_pop.cpp +++ b/test/stress/queue/push_pop.cpp @@ -40,6 +40,7 @@ namespace { static size_t s_nConsumerThreadCount = 4; static size_t s_nProducerThreadCount = 4; static size_t s_nQueueSize = 4000000; + static size_t s_nVyukovQueueSize = 40000; static size_t s_nHeavyValueSize = 100; static std::atomic s_nProducerDone( 0 ); @@ -200,8 +201,8 @@ namespace { { cds_test::thread_pool& pool = get_pool(); - typedef Consumer Consumer; - typedef Producer Producer; + typedef Consumer consumer_type; + typedef Producer producer_type; size_t nPostTestPops = 0; { @@ -215,12 +216,12 @@ namespace { size_t nPoppedItems = 0; size_t nPushFailed = 0; - std::vector< Consumer * > arrConsumer; + std::vector< consumer_type * > arrConsumer; for ( size_t i = 0; i < pool.size(); ++i ) { cds_test::thread& thr = pool.get(i); if ( thr.type() == consumer_thread ) { - Consumer& consumer = static_cast( thr ); + consumer_type& consumer = static_cast( thr ); nTotalPops += consumer.m_nPopped; nPopFalse += consumer.m_nPopEmpty; arrConsumer.push_back( &consumer ); @@ -235,7 +236,7 @@ namespace { else { assert( thr.type() == producer_thread ); - Producer& producer = static_cast( thr ); + producer_type& producer = static_cast( thr ); nPushFailed += producer.m_nPushFailed; EXPECT_EQ( producer.m_nPushFailed, 0u ) << "producer_thread_no " << i; } @@ -325,6 +326,7 @@ namespace { s_nConsumerThreadCount = cfg.get_size_t( "ConsumerCount", s_nConsumerThreadCount ); s_nProducerThreadCount = cfg.get_size_t( "ProducerCount", s_nProducerThreadCount ); s_nQueueSize = cfg.get_size_t( "QueueSize", s_nQueueSize ); + s_nVyukovQueueSize = cfg.get_size_t( "VyukovQueueSize", s_nVyukovQueueSize ); s_nHeavyValueSize = cfg.get_size_t( "HeavyValueSize", s_nHeavyValueSize ); if ( s_nConsumerThreadCount == 0u ) @@ -349,19 +351,18 @@ namespace { CDSSTRESS_MoirQueue( simple_queue_push_pop ) CDSSTRESS_BasketQueue( simple_queue_push_pop ) CDSSTRESS_OptimsticQueue( simple_queue_push_pop ) - CDSSTRESS_FCQueue( simple_queue_push_pop ) - CDSSTRESS_FCDeque( simple_queue_push_pop ) - CDSSTRESS_FCDeque_HeavyValue( fc_with_heavy_value ) CDSSTRESS_RWQueue( simple_queue_push_pop ) - CDSSTRESS_StdQueue( simple_queue_push_pop ) #undef CDSSTRESS_Queue_F #define CDSSTRESS_Queue_F( test_fixture, type_name ) \ TEST_F( test_fixture, type_name ) \ { \ + size_t old_queue_size = s_nQueueSize; \ + s_nQueueSize = s_nVyukovQueueSize; \ typedef queue::Types< value_type >::type_name queue_type; \ queue_type queue( s_nQueueSize ); \ test( queue ); \ + s_nQueueSize = old_queue_size; \ } CDSSTRESS_VyukovQueue( simple_queue_push_pop ) @@ -434,7 +435,7 @@ namespace { #else INSTANTIATE_TEST_CASE_P( SQ, segmented_queue_push_pop, - ::testing::ValuesIn( segmented_queue_push_pop::get_test_parameters()) ); + ::testing::ValuesIn( segmented_queue_push_pop::get_test_parameters())); #endif } // namespace