/*
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/
{
cds_test::thread_pool& pool = get_pool();
- typedef Consumer<Queue> Consumer;
- typedef Producer<Queue> Producer;
+ typedef Consumer<Queue> consumer_type;
+ typedef Producer<Queue> producer_type;
size_t nPostTestPops = 0;
{
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<Consumer&>( thr );
+ consumer_type& consumer = static_cast<consumer_type&>( thr );
nTotalPops += consumer.m_nPopped;
nPopFalse += consumer.m_nPopEmpty;
arrConsumer.push_back( &consumer );
else {
assert( thr.type() == producer_thread );
- Producer& producer = static_cast<Producer&>( thr );
+ producer_type& producer = static_cast<producer_type&>( thr );
nPushFailed += producer.m_nPushFailed;
EXPECT_EQ( producer.m_nPushFailed, 0u ) << "producer_thread_no " << i;
}
//static void TearDownTestCase();
};
- using value_for_fc_with_heavy_value = queue_push_pop< fc_test::HeavyValue<36000> >;
- using old_queue_push_pop = queue_push_pop<>;
+ using fc_with_heavy_value = queue_push_pop< fc_test::heavy_value<36000> >;
+ using simple_queue_push_pop = queue_push_pop<>;
- CDSSTRESS_MSQueue( old_queue_push_pop )
- CDSSTRESS_MoirQueue( old_queue_push_pop )
- CDSSTRESS_BasketQueue( old_queue_push_pop )
- CDSSTRESS_OptimsticQueue( old_queue_push_pop )
- CDSSTRESS_FCQueue( old_queue_push_pop )
- CDSSTRESS_FCDeque( old_queue_push_pop )
- CDSSTRESS_FCDeque_HeavyValue( value_for_fc_with_heavy_value )
- CDSSTRESS_RWQueue( old_queue_push_pop )
- CDSSTRESS_StdQueue( old_queue_push_pop )
+ CDSSTRESS_MSQueue( simple_queue_push_pop )
+ 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, level ) \
+#define CDSSTRESS_Queue_F( test_fixture, type_name ) \
TEST_F( test_fixture, type_name ) \
{ \
- if ( !check_detail_level( level )) return; \
typedef queue::Types< value_type >::type_name queue_type; \
queue_type queue( s_nQueueSize ); \
test( queue ); \
}
- CDSSTRESS_VyukovQueue( old_queue_push_pop )
+ CDSSTRESS_VyukovQueue( simple_queue_push_pop )
#undef CDSSTRESS_Queue_F
}
};
-#define CDSSTRESS_Queue_F( test_fixture, type_name, level ) \
+#define CDSSTRESS_Queue_F( test_fixture, type_name ) \
TEST_P( test_fixture, type_name ) \
{ \
- if ( !check_detail_level( level )) return; \
typedef typename queue::Types<value_type>::type_name queue_type; \
test< queue_type >(); \
}
CDSSTRESS_SegmentedQueue( segmented_queue_push_pop )
+#ifdef CDSTEST_GTEST_INSTANTIATE_TEST_CASE_P_HAS_4TH_ARG
+ static std::string get_test_parameter_name( testing::TestParamInfo<size_t> const& p )
+ {
+ return std::to_string( p.param );
+ }
+ INSTANTIATE_TEST_CASE_P( SQ,
+ segmented_queue_push_pop,
+ ::testing::ValuesIn( segmented_queue_push_pop::get_test_parameters()), get_test_parameter_name );
+#else
INSTANTIATE_TEST_CASE_P( SQ,
segmented_queue_push_pop,
::testing::ValuesIn( segmented_queue_push_pop::get_test_parameters()));
+#endif
} // namespace