From: khizmax Date: Fri, 29 Jul 2016 08:03:25 +0000 (+0300) Subject: improved pqueue_pop test X-Git-Tag: v2.2.0~174 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2183a0f053f90333a439f54ad61a4a2d1166e050;p=libcds.git improved pqueue_pop test --- diff --git a/test/stress/pqueue/pop.cpp b/test/stress/pqueue/pop.cpp index acb2fb57..8127b0b9 100644 --- a/test/stress/pqueue/pop.cpp +++ b/test/stress/pqueue/pop.cpp @@ -123,9 +123,13 @@ namespace { arr.push_back( i ); shuffle( arr.begin(), arr.end() ); + size_t nPushError = 0; typedef typename PQueue::value_type value_type; - for ( auto it = arr.begin(); it != arr.end(); ++it ) - q.push( value_type( *it )); + for ( auto it = arr.begin(); it != arr.end(); ++it ) { + if ( !q.push( value_type( *it ) )) + ++nPushError; + } + s_nQueueSize -= nPushError; } // pop @@ -163,8 +167,8 @@ namespace { << std::make_pair( "error_priority_violation", nTotalError ); EXPECT_EQ( nTotalPopped, s_nQueueSize ); - EXPECT_EQ( nTotalError, 0 ); - EXPECT_EQ( nTotalErrorEq, 0 ); + EXPECT_EQ( nTotalError, 0 ) << "priority violations"; + EXPECT_EQ( nTotalErrorEq, 0 ) << "double key"; } propout() << q.statistics();