Uses different pass count for different parallel queue test cases
[libcds.git] / test / stress / queue / push_pop.cpp
index b449ccb..f696bc1 100644 (file)
@@ -40,6 +40,11 @@ namespace {
     static size_t s_nConsumerThreadCount = 4;
     static size_t s_nProducerThreadCount = 4;
     static size_t s_nQueueSize = 4000000;
+    static size_t s_nMSQueueSize = 4000000;
+    static size_t s_nMoirQueueSize = 4000000;
+    static size_t s_nBasketQueueSize = 4000000;
+    static size_t s_nOptimisticQueueSize = 4000000;
+    static size_t s_nRWQueueSize = 4000000;
     static size_t s_nSegmentedQueueSize = 400000;
     static size_t s_nVyukovQueueSize = 40000;
     static size_t s_nHeavyValueSize = 100;
@@ -327,6 +332,13 @@ namespace {
             s_nConsumerThreadCount = cfg.get_size_t( "ConsumerCount", s_nConsumerThreadCount );
             s_nProducerThreadCount = cfg.get_size_t( "ProducerCount", s_nProducerThreadCount );
             s_nQueueSize = cfg.get_size_t( "QueueSize", s_nQueueSize );
+
+            s_nMSQueueSize = cfg.get_size_t( "MSQueueSize", s_nMSQueueSize );
+            s_nMoirQueueSize = cfg.get_size_t( "MoirQueueSize", s_nMoirQueueSize );
+            s_nBasketQueueSize = cfg.get_size_t( "BasketQueueSize", s_nBasketQueueSize );
+            s_nOptimisticQueueSize = cfg.get_size_t( "OptimisticQueueSize", s_nOptimisticQueueSize );
+            s_nRWQueueSize = cfg.get_size_t( "RWQueueSize", s_nRWQueueSize );
+
             s_nVyukovQueueSize = cfg.get_size_t( "VyukovQueueSize", s_nVyukovQueueSize );
             s_nSegmentedQueueSize = cfg.get_size_t( "SegmentedQueueSize", s_nSegmentedQueueSize );
             s_nHeavyValueSize = cfg.get_size_t( "HeavyValueSize", s_nHeavyValueSize );
@@ -349,10 +361,60 @@ namespace {
     using fc_with_heavy_value = queue_push_pop< fc_test::heavy_value<36000> >;
     using simple_queue_push_pop = queue_push_pop<>;
 
+#undef CDSSTRESS_Queue_F
+#define CDSSTRESS_Queue_F( test_fixture, type_name ) \
+    TEST_F( test_fixture, type_name ) \
+    { \
+        typedef queue::Types< value_type >::type_name queue_type; \
+        queue_type queue; \
+        s_nQueueSize = s_nMSQueueSize; \
+        test( queue ); \
+    }
+
     CDSSTRESS_MSQueue( simple_queue_push_pop )
+
+#undef CDSSTRESS_Queue_F
+#define CDSSTRESS_Queue_F( test_fixture, type_name ) \
+    TEST_F( test_fixture, type_name ) \
+    { \
+        typedef queue::Types< value_type >::type_name queue_type; \
+        queue_type queue; \
+        s_nQueueSize = s_nMoirQueueSize; \
+        test( queue ); \
+    }
     CDSSTRESS_MoirQueue( simple_queue_push_pop )
+
+#undef CDSSTRESS_Queue_F
+#define CDSSTRESS_Queue_F( test_fixture, type_name ) \
+    TEST_F( test_fixture, type_name ) \
+    { \
+        typedef queue::Types< value_type >::type_name queue_type; \
+        queue_type queue; \
+        s_nQueueSize = s_nBasketQueueSize; \
+        test( queue ); \
+    }
     CDSSTRESS_BasketQueue( simple_queue_push_pop )
+
+#undef CDSSTRESS_Queue_F
+#define CDSSTRESS_Queue_F( test_fixture, type_name ) \
+    TEST_F( test_fixture, type_name ) \
+    { \
+        typedef queue::Types< value_type >::type_name queue_type; \
+        queue_type queue; \
+        s_nQueueSize = s_nOptimisticQueueSize; \
+        test( queue ); \
+    }
     CDSSTRESS_OptimsticQueue( simple_queue_push_pop )
+
+#undef CDSSTRESS_Queue_F
+#define CDSSTRESS_Queue_F( test_fixture, type_name ) \
+    TEST_F( test_fixture, type_name ) \
+    { \
+        typedef queue::Types< value_type >::type_name queue_type; \
+        queue_type queue; \
+        s_nQueueSize = s_nRWQueueSize; \
+        test( queue ); \
+    }
     CDSSTRESS_RWQueue( simple_queue_push_pop )
 
 #undef CDSSTRESS_Queue_F
@@ -369,9 +431,6 @@ namespace {
 
     //CDSSTRESS_VyukovQueue( simple_queue_push_pop )
 
-#undef CDSSTRESS_Queue_F
-
-
     // ********************************************************************
     // SegmentedQueue test
 
@@ -417,6 +476,7 @@ namespace {
         }
     };
 
+#undef CDSSTRESS_Queue_F
 #define CDSSTRESS_Queue_F( test_fixture, type_name ) \
     TEST_P( test_fixture, type_name ) \
     { \