/*
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/
size_t nNo;
size_t nThread;
- value_type()
+ value_type()
: nNo( 0 )
- , nThread( 0 )
+ , nThread( 0 )
{}
- value_type( size_t n )
+ value_type( size_t n )
: nNo( n )
- , nThread( 0 )
+ , nThread( 0 )
{}
};
value_type v;
v.nThread = id();
for ( v.nNo = m_nStartItem; v.nNo < m_nEndItem; ++v.nNo ) {
- if ( !m_stack.push( v ) )
+ if ( !m_stack.push( v ))
++m_nPushError;
}
}
};
protected:
- static void SetUpTestCase()\r
- {\r
- cds_test::config const& cfg = get_config("Stack_Push");\r
-\r
+ static void SetUpTestCase()
+ {
+ cds_test::config const& cfg = get_config("Stack_Push");
+
s_nThreadCount = cfg.get_size_t( "ThreadCount", s_nThreadCount );
s_nStackSize = cfg.get_size_t( "StackSize", s_nStackSize );
s_nEliminationSize = cfg.get_size_t( "EliminationSize", s_nEliminationSize );
if ( s_nThreadCount == 0 )
s_nThreadCount = 1;
- }\r
-\r
- //static void TearDownTestCase();\r
+ }
+
+ //static void TearDownTestCase();
template <typename Stack>
void test( Stack& stack )
void test_elimination( Stack& stack )
{
test( stack );
- check_elimination_stat( stack.statistics() );
+ check_elimination_stat( stack.statistics());
}
void check_elimination_stat( cds::container::treiber_stack::empty_stat const& )
void check_elimination_stat( cds::container::treiber_stack::stat<> const& s )
{
- EXPECT_EQ( s.m_PushCount.get(), s.m_PopCount.get() );
+ EXPECT_EQ( s.m_PushCount.get(), s.m_PopCount.get());
}
template <class Stack>
for ( size_t i = 0; i < pool.size(); ++i ) {
Producer<Stack>& producer = static_cast<Producer<Stack>&>( pool.get( i ));
- EXPECT_EQ( producer.m_nPushError, 0 ) << "Producer=" << i;
+ EXPECT_EQ( producer.m_nPushError, 0u ) << "Producer=" << i;
aThread[producer.id()] = producer.m_nEndItem - 1;
}
EXPECT_FALSE( testStack.empty());
size_t nError = 0;
for ( size_t i = 0; i < nTotalItems; ++i ) {
EXPECT_EQ( arr[i], 1 ) << "i=" << i;
- if ( ++nError > 10 )
+ if ( ++nError > 10 ) {
ASSERT_EQ( arr[i], 1 );
+ }
}
}
};
CDSSTRESS_EliminationStack( stack_push )
CDSSTRESS_FCStack( stack_push )
CDSSTRESS_FCDeque( stack_push )
- CDSSTRESS_StdStack( stack_push )
} // namespace