/*
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/
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
{
size_t nNo;
- value_type()
- : nNo( 0 )
+ value_type()
+ : nNo( 0 )
{}
- value_type( size_t n )
- : nNo( n )
+ value_type( size_t n )
+ : nNo( n )
{}
};
};
public:
- static void SetUpTestCase()\r
- {\r
- cds_test::config const& cfg = get_config( "queue_push" );\r
-\r
+ static void SetUpTestCase()
+ {
+ cds_test::config const& cfg = get_config( "queue_push" );
+
s_nThreadCount = cfg.get_size_t( "ThreadCount", s_nThreadCount );
s_nQueueSize = cfg.get_size_t( "QueueSize", s_nQueueSize );
- if ( s_nThreadCount == 0 )
+ if ( s_nThreadCount == 0u )
s_nThreadCount = 1;
- if ( s_nQueueSize == 0 )
+ if ( s_nQueueSize == 0u )
s_nQueueSize = 1000;
- }\r
-\r
- //static void TearDownTestCase();\r
+ }
+
+ //static void TearDownTestCase();
protected:
template <class Queue>
for ( size_t i = 0; i < pool.size(); ++i ) {
Producer<Queue>& thread = static_cast<Producer<Queue>&>(pool.get( i ));
- EXPECT_EQ( thread.m_nPushError, 0 ) << " producer thread " << i;
+ EXPECT_EQ( thread.m_nPushError, 0u ) << " producer thread " << i;
}
- EXPECT_TRUE( !q.empty() );
+ EXPECT_TRUE( !q.empty());
std::unique_ptr< uint8_t[] > arr( new uint8_t[s_nQueueSize] );
memset( arr.get(), 0, sizeof(arr[0]) * s_nQueueSize );
CDSSTRESS_StdQueue( queue_push )
#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_TsigasQueue( queue_push )
CDSSTRESS_VyukovQueue( queue_push )
#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 )
+#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,
- ::testing::ValuesIn( segmented_queue_push::get_test_parameters()));
+ ::testing::ValuesIn( segmented_queue_push::get_test_parameters()), get_test_parameter_name );
+#else
+ INSTANTIATE_TEST_CASE_P( SQ,
+ segmented_queue_push,
+ ::testing::ValuesIn( segmented_queue_push::get_test_parameters()));
+#endif
+
} // namespace