/*
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/
}
else {
++m_nPopEmpty;
- if ( s_nProducerCount.load( atomics::memory_order_acquire ) == 0 && m_Queue.empty() )
+ if ( s_nProducerCount.load( atomics::memory_order_acquire ) == 0 && m_Queue.empty())
break;
}
}
void analyze( Queue& testQueue, size_t /*nLeftOffset*/, size_t nRightOffset )
{
typedef Consumer<Queue> Reader;
- typedef Producer<Queue> Writer;
typedef typename Reader::const_data_iterator ReaderIterator;
size_t nPostTestPops = 0;
- while ( testQueue.pop() )
+ while ( testQueue.pop())
++nPostTestPops;
size_t nTotalPops = 0;
size_t nQueueSize = s_nThreadPushCount * s_nWriterThreadCount;
EXPECT_EQ( nTotalPops + nPostTestPops, nQueueSize );
- EXPECT_TRUE( testQueue.empty() );
+ EXPECT_TRUE( testQueue.empty());
// Test that all items have been popped
// Test FIFO order
for ( it = arrReaders[nReader]->m_WriterData[nWriter].begin(); it != itEnd; ++it )
arrData.push_back( *it );
}
- std::sort( arrData.begin(), arrData.end() );
+ std::sort( arrData.begin(), arrData.end());
for ( size_t i=1; i < arrData.size(); ++i ) {
if ( arrData[i-1] + 1 != arrData[i] ) {
EXPECT_EQ( arrData[i-1] + 1, arrData[i] ) << "Writer " << nWriter << ": [" << (i-1) << "]=" << arrData[i-1]
}
}
- EXPECT_EQ( arrData[0], 0 ) << "Writer " << nWriter;
+ EXPECT_EQ( arrData[0], 0u ) << "Writer " << nWriter;
EXPECT_EQ( arrData[arrData.size() - 1], s_nThreadPushCount - 1 ) << "Writer " << nWriter;
}
}
test( q, arrValue, 0, 0 ); \
}
- CDSSTRESS_QUEUE_F( TsigasCycleQueue_dyn )
- CDSSTRESS_QUEUE_F( TsigasCycleQueue_dyn_ic )
CDSSTRESS_QUEUE_F( VyukovMPMCCycleQueue_dyn )
CDSSTRESS_QUEUE_F( VyukovMPMCCycleQueue_dyn_ic )
#undef CDSSTRESS_QUEUE_F
//CDSSTRESS_QUEUE_F( SegmentedQueue_DHP_mutex_padding )
CDSSTRESS_QUEUE_F( SegmentedQueue_DHP_mutex_stat )
+
+#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,
intrusive_segmented_queue_push_pop,
- ::testing::ValuesIn( intrusive_segmented_queue_push_pop::get_test_parameters() ) );
+ ::testing::ValuesIn( intrusive_segmented_queue_push_pop::get_test_parameters()), get_test_parameter_name );
+#else
+ INSTANTIATE_TEST_CASE_P( SQ,
+ intrusive_segmented_queue_push_pop,
+ ::testing::ValuesIn( intrusive_segmented_queue_push_pop::get_test_parameters()) );
+#endif
+
} // namespace