From 73545431527bb09e136b7719f908f50ceb6fc9e7 Mon Sep 17 00:00:00 2001 From: khizmax Date: Mon, 20 Oct 2014 10:34:16 +0400 Subject: [PATCH] Fix bug in queue tests --- .gitignore | 1 + tests/test-hdr/queue/hdr_queue.h | 12 ++++++------ tests/test-hdr/queue/hdr_tsigas_cycle_queue.cpp | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 5f11934a..846d10ff 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /tests/data/dictionary.txt /bin obj +/projects/Win/vc12/*.user diff --git a/tests/test-hdr/queue/hdr_queue.h b/tests/test-hdr/queue/hdr_queue.h index 35cfa0c3..dcbabc1f 100644 --- a/tests/test-hdr/queue/hdr_queue.h +++ b/tests/test-hdr/queue/hdr_queue.h @@ -213,12 +213,12 @@ namespace queue { } // The queue is full CPPUNIT_CHECK( !q.empty() ); - CPPUNIT_ASSERT( !q.push_with( [nCapacity]( int& itm ) { itm = nCapacity; } ) ); + CPPUNIT_ASSERT( !q.push_with( [nCapacity]( int& itm ) { itm = static_cast(nCapacity); } ) ); int n = -1; CPPUNIT_CHECK( q.pop(n) ); CPPUNIT_CHECK( n == 0 ); - CPPUNIT_ASSERT( q.push( nCapacity ) ); - CPPUNIT_ASSERT( !q.push( nCapacity ) ); + CPPUNIT_ASSERT( q.push( static_cast(nCapacity) ) ); + CPPUNIT_ASSERT( !q.push( static_cast(nCapacity) ) ); } template @@ -236,13 +236,13 @@ namespace queue { // The queue is full CPPUNIT_CHECK( !q.empty() ); CPPUNIT_CHECK( q.size() == nCapacity ); - CPPUNIT_ASSERT( !q.push_with( [nCapacity]( int& itm ) { itm = nCapacity; } ) ); + CPPUNIT_ASSERT( !q.push_with( [nCapacity]( int& itm ) { itm = static_cast(nCapacity); } ) ); int n = -1; CPPUNIT_CHECK( q.pop( n ) ); CPPUNIT_CHECK( n == 0 ); - CPPUNIT_ASSERT( q.push( nCapacity ) ); + CPPUNIT_ASSERT( q.push( static_cast(nCapacity) ) ); CPPUNIT_CHECK( q.size() == nCapacity ); - CPPUNIT_ASSERT( !q.push( nCapacity ) ); + CPPUNIT_ASSERT( !q.push( static_cast(nCapacity) ) ); CPPUNIT_CHECK( q.size() == nCapacity ); } diff --git a/tests/test-hdr/queue/hdr_tsigas_cycle_queue.cpp b/tests/test-hdr/queue/hdr_tsigas_cycle_queue.cpp index ce9bfaba..7730eb39 100644 --- a/tests/test-hdr/queue/hdr_tsigas_cycle_queue.cpp +++ b/tests/test-hdr/queue/hdr_tsigas_cycle_queue.cpp @@ -21,6 +21,7 @@ namespace queue { { struct queue_traits : public cds::container::tsigas_queue::traits { + typedef cds::opt::v::static_buffer< int, 1024 > buffer; typedef cds::atomicity::item_counter item_counter; }; typedef cds::container::TsigasCycleQueue< int, queue_traits > queue_type; -- 2.34.1