Fix bug in queue tests
authorkhizmax <libcds.dev@gmail.com>
Mon, 20 Oct 2014 06:34:16 +0000 (10:34 +0400)
committerkhizmax <libcds.dev@gmail.com>
Mon, 20 Oct 2014 06:34:16 +0000 (10:34 +0400)
.gitignore
tests/test-hdr/queue/hdr_queue.h
tests/test-hdr/queue/hdr_tsigas_cycle_queue.cpp

index 5f11934ae386c8139eef970bbc1d8de64405a00c..846d10ffcd22b45467924cb3b8f7ba2b448cdd5f 100644 (file)
@@ -9,3 +9,4 @@
 /tests/data/dictionary.txt
 /bin
 obj
+/projects/Win/vc12/*.user
index 35cfa0c3c1e675ef9bdc83a1de75c5d74f416e54..dcbabc1fb8588ae4da481782fc7d07a2e85ae150 100644 (file)
@@ -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<int>(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<it>(nCapacity) ) );
+            CPPUNIT_ASSERT( !q.push( static_cast<it>(nCapacity) ) );
         }
 
         template <class Queue>
@@ -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<it>(nCapacity); } ) );
             int n = -1;
             CPPUNIT_CHECK( q.pop( n ) );
             CPPUNIT_CHECK( n == 0 );
-            CPPUNIT_ASSERT( q.push( nCapacity ) );
+            CPPUNIT_ASSERT( q.push( static_cast<it>(nCapacity) ) );
             CPPUNIT_CHECK( q.size() == nCapacity );
-            CPPUNIT_ASSERT( !q.push( nCapacity ) );
+            CPPUNIT_ASSERT( !q.push( static_cast<it>(nCapacity) ) );
             CPPUNIT_CHECK( q.size() == nCapacity );
         }
 
index ce9bfaba697afc69209377510f3dfa1d40a8ecbb..7730eb391b6991838d0c31e661f6728b8b2e544c 100644 (file)
@@ -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;