Trims down unnecessary queue test casese
[libcds.git] / test / stress / queue / push.cpp
index fc205b93f2461dc2e89184a9ca7a1b416d98a506..57bb3697d8a30b441232de19a1eedc91c2244c8d 100644 (file)
@@ -1,11 +1,11 @@
 /*
     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/
-    
+
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions are met:
 
@@ -25,7 +25,7 @@
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
     CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
 #include "queue_type.h"
@@ -43,12 +43,12 @@ namespace {
         {
             size_t      nNo;
 
-            value_type() 
-                : nNo( 0 ) 
+            value_type()
+                : nNo( 0 )
             {}
 
-            value_type( size_t n ) 
-                : nNo( n ) 
+            value_type( size_t n )
+                : nNo( n )
             {}
         };
 
@@ -95,20 +95,20 @@ namespace {
         };
 
     public:
-        static void SetUpTestCase()\r
-        {\r
-            cds_test::config const& cfg = get_config( "queue_push" );\r
-\r
+        static void SetUpTestCase()
+        {
+            cds_test::config const& cfg = get_config( "queue_push" );
+
             s_nThreadCount = cfg.get_size_t( "ThreadCount", s_nThreadCount );
             s_nQueueSize = cfg.get_size_t( "QueueSize", s_nQueueSize );
 
-            if ( s_nThreadCount == 0 )
+            if ( s_nThreadCount == 0u )
                 s_nThreadCount = 1;
-            if ( s_nQueueSize == 0 )
+            if ( s_nQueueSize == 0u )
                 s_nQueueSize = 1000;
-        }\r
-\r
-        //static void TearDownTestCase();\r
+        }
+
+        //static void TearDownTestCase();
 
     protected:
         template <class Queue>
@@ -148,9 +148,9 @@ namespace {
 
             for ( size_t i = 0; i < pool.size(); ++i ) {
                 Producer<Queue>& thread = static_cast<Producer<Queue>&>(pool.get( i ));
-                EXPECT_EQ( thread.m_nPushError, 0 ) << " producer thread " << i;
+                EXPECT_EQ( thread.m_nPushError, 0u ) << " producer thread " << i;
             }
-            EXPECT_TRUE( !q.empty() );
+            EXPECT_TRUE( !q.empty());
 
             std::unique_ptr< uint8_t[] > arr( new uint8_t[s_nQueueSize] );
             memset( arr.get(), 0, sizeof(arr[0]) * s_nQueueSize );
@@ -173,10 +173,7 @@ namespace {
     CDSSTRESS_MoirQueue( queue_push )
     CDSSTRESS_BasketQueue( queue_push )
     CDSSTRESS_OptimsticQueue( queue_push )
-    CDSSTRESS_FCQueue( queue_push )
-    CDSSTRESS_FCDeque( queue_push )
     CDSSTRESS_RWQueue( queue_push )
-    CDSSTRESS_StdQueue( queue_push )
 
 #undef CDSSTRESS_Queue_F
 #define CDSSTRESS_Queue_F( test_fixture, type_name ) \
@@ -187,7 +184,6 @@ namespace {
         test( queue ); \
     }
 
-    CDSSTRESS_TsigasQueue( queue_push )
     CDSSTRESS_VyukovQueue( queue_push )
 
 #undef CDSSTRESS_Queue_F
@@ -245,8 +241,19 @@ namespace {
 
     CDSSTRESS_SegmentedQueue( segmented_queue_push )
 
+#ifdef CDSTEST_GTEST_INSTANTIATE_TEST_CASE_P_HAS_4TH_ARG
+    static std::string get_test_parameter_name( testing::TestParamInfo<size_t> const& p )
+    {
+        return std::to_string( p.param );
+    }
     INSTANTIATE_TEST_CASE_P( SQ,
         segmented_queue_push,
-        ::testing::ValuesIn( segmented_queue_push::get_test_parameters()));
+        ::testing::ValuesIn( segmented_queue_push::get_test_parameters()), get_test_parameter_name );
+#else
+        INSTANTIATE_TEST_CASE_P( SQ,
+            segmented_queue_push,
+            ::testing::ValuesIn( segmented_queue_push::get_test_parameters()));
+#endif
+
 
 } // namespace