From 2183a0f053f90333a439f54ad61a4a2d1166e050 Mon Sep 17 00:00:00 2001 From: khizmax Date: Fri, 29 Jul 2016 11:03:25 +0300 Subject: [PATCH] improved pqueue_pop test --- test/stress/pqueue/pop.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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(); -- 2.34.1