added fc_heavy_value tests to stress-queue test
authorMarsel Galimullin <mfgalimullin@yandex.ru>
Thu, 1 Sep 2016 21:10:22 +0000 (00:10 +0300)
committerMarsel Galimullin <mfgalimullin@yandex.ru>
Mon, 5 Dec 2016 20:02:42 +0000 (23:02 +0300)
test/include/cds_test/fc_hevy_value.h [new file with mode: 0644]
test/stress/queue/push_pop.cpp
test/stress/queue/queue_type.h
test/unit/queue/fcqueue.cpp

diff --git a/test/include/cds_test/fc_hevy_value.h b/test/include/cds_test/fc_hevy_value.h
new file mode 100644 (file)
index 0000000..71693f7
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * fc_hevy_value.h
+ *
+ *  Created on: 31 авг. 2016 г.
+ *      Author: marsel
+ */
+
+#ifndef SOURCE_DIRECTORY__TEST_INCLUDE_CDS_TEST_FC_HEAVY_VALUE_H_
+#define SOURCE_DIRECTORY__TEST_INCLUDE_CDS_TEST_FC_HEAVY_VALUE_H_
+
+#include <math.h>
+#include <vector>
+
+namespace{
+       template<int DefaultSize = 10000>
+       struct HeavyValue {
+               static std::vector<int> pop_buff;
+               int value;
+               size_t buffer_size;
+
+               size_t nNo;
+               size_t nWriterNo;
+
+               explicit HeavyValue(int new_value = 0, size_t new_bufer_size = DefaultSize)
+               : value(new_value),
+                 buffer_size(new_bufer_size),
+                 nNo(0),
+                 nWriterNo(0)
+
+               {
+                       if( buffer_size != pop_buff.size() ){
+                               pop_buff.resize(buffer_size);
+                       }
+               };
+               HeavyValue(const HeavyValue &other)
+                       : value(other.value),
+                         buffer_size(other.buffer_size)
+               {
+                       working(other);
+               }
+               void operator=(const int& new_value)
+               {
+                       value = new_value;
+               }
+               bool operator==(const int new_value) const
+               {
+                       return value == new_value;
+               }
+               void working(const HeavyValue &other) {
+                       for (size_t i = 0; i < buffer_size; ++i)
+                               pop_buff[i] =  static_cast<int>(std::sqrt(other.pop_buff[i]));
+               }
+       };
+
+       template<int DefaultSize>
+       std::vector<int> HeavyValue< DefaultSize >::pop_buff = {};
+}
+#endif /* SOURCE_DIRECTORY__TEST_INCLUDE_CDS_TEST_FC_HEVY_VALUE_H_ */
index 6db97a6..0f2b979 100644 (file)
@@ -42,16 +42,19 @@ namespace {
 
     static std::atomic<size_t> s_nProducerDone( 0 );
 
+    struct old_value
+       {
+       size_t nNo;
+               size_t nWriterNo;
+       };
+
+    template<class Value = old_value>
     class queue_push_pop: public cds_test::stress_fixture
     {
     protected:
-        struct value_type
-        {
-            size_t      nNo;
-            size_t      nWriterNo;
-        };
+               using value_type = Value;
 
-        enum {
+           enum {
             producer_thread,
             consumer_thread
         };
@@ -318,14 +321,18 @@ namespace {
         //static void TearDownTestCase();
     };
 
-    CDSSTRESS_MSQueue( queue_push_pop )
-    CDSSTRESS_MoirQueue( queue_push_pop )
-    CDSSTRESS_BasketQueue( queue_push_pop )
-    CDSSTRESS_OptimsticQueue( queue_push_pop )
-    CDSSTRESS_FCQueue( queue_push_pop )
-    CDSSTRESS_FCDeque( queue_push_pop )
-    CDSSTRESS_RWQueue( queue_push_pop )
-    CDSSTRESS_StdQueue( queue_push_pop )
+    using value_for_fc_with_heavy_value = queue_push_pop< HeavyValue<10> >;
+    using old_queue_push_pop = queue_push_pop<>;
+
+//    CDSSTRESS_MSQueue( old_queue_push_pop )
+//    CDSSTRESS_MoirQueue( old_queue_push_pop )
+//    CDSSTRESS_BasketQueue( old_queue_push_pop )
+//    CDSSTRESS_OptimsticQueue( old_queue_push_pop )
+//    CDSSTRESS_FCQueue( old_queue_push_pop )
+       CDSSTRESS_FCDeque_HeavyValue( value_for_fc_with_heavy_value )
+//    CDSSTRESS_FCDeque( old_queue_push_pop )
+//    CDSSTRESS_RWQueue( old_queue_push_pop )
+//    CDSSTRESS_StdQueue( old_queue_push_pop )
 
 #undef CDSSTRESS_Queue_F
 #define CDSSTRESS_Queue_F( test_fixture, type_name, level ) \
@@ -337,7 +344,7 @@ namespace {
         test( queue ); \
     }
 
-    CDSSTRESS_VyukovQueue( queue_push_pop )
+    CDSSTRESS_VyukovQueue( old_queue_push_pop )
 
 #undef CDSSTRESS_Queue_F
 
@@ -346,10 +353,10 @@ namespace {
     // SegmentedQueue test
 
     class segmented_queue_push_pop
-        : public queue_push_pop
+        : public queue_push_pop<>
         , public ::testing::WithParamInterface< size_t >
     {
-        typedef queue_push_pop base_class;
+        typedef queue_push_pop<> base_class;
 
     protected:
 
index a545378..0ccc1a7 100644 (file)
@@ -52,6 +52,8 @@
 
 #include <cds_test/stress_test.h>
 #include <cds_test/stat_flat_combining_out.h>
+#include <cds_test/fc_hevy_value.h>
+
 #include "print_stat.h"
 
 namespace queue {
@@ -127,6 +129,56 @@ namespace queue {
 
     } // namespace details
 
+namespace fc_details{
+// FCDeque
+        struct traits_FCDeque_stat:
+            public cds::container::fcdeque::make_traits<
+                cds::opt::stat< cds::container::fcdeque::stat<> >
+            >::type
+        {};
+        struct traits_FCDeque_elimination:
+            public cds::container::fcdeque::make_traits<
+                cds::opt::enable_elimination< true >
+            >::type
+        {};
+        struct traits_FCDeque_elimination_stat:
+            public cds::container::fcdeque::make_traits<
+                cds::opt::stat< cds::container::fcdeque::stat<> >,
+                cds::opt::enable_elimination< true >
+            >::type
+        {};
+        struct traits_FCDeque_mutex:
+            public cds::container::fcdeque::make_traits<
+                cds::opt::lock_type< std::mutex >
+            >::type
+        {};
+
+        struct traits_FCDeque_wait_ss: cds::container::fcdeque::traits
+        {
+            typedef cds::algo::flat_combining::wait_strategy::single_mutex_single_condvar<> wait_strategy;
+        };
+        struct traits_FCDeque_wait_ss_stat: traits_FCDeque_wait_ss
+        {
+            typedef cds::container::fcdeque::stat<> stat;
+        };
+        struct traits_FCDeque_wait_sm: cds::container::fcdeque::traits
+        {
+            typedef cds::algo::flat_combining::wait_strategy::single_mutex_multi_condvar<> wait_strategy;
+        };
+        struct traits_FCDeque_wait_sm_stat: traits_FCDeque_wait_sm
+        {
+            typedef cds::container::fcdeque::stat<> stat;
+        };
+        struct traits_FCDeque_wait_mm: cds::container::fcdeque::traits
+        {
+            typedef cds::algo::flat_combining::wait_strategy::multi_mutex_multi_condvar<> wait_strategy;
+        };
+        struct traits_FCDeque_wait_mm_stat: traits_FCDeque_wait_mm
+        {
+            typedef cds::container::fcdeque::stat<> stat;
+        };
+
+}
     template <typename Value>
     struct Types {
 
@@ -400,87 +452,40 @@ namespace queue {
         typedef cds::container::FCQueue< Value, std::queue<Value, std::list<Value> >, traits_FCQueue_elimination_stat > FCQueue_list_elimination_stat;
 
 
-   // FCDeque
-        struct traits_FCDeque_stat:
-            public cds::container::fcdeque::make_traits<
-                cds::opt::stat< cds::container::fcdeque::stat<> >
-            >::type
-        {};
-        struct traits_FCDeque_elimination:
-            public cds::container::fcdeque::make_traits<
-                cds::opt::enable_elimination< true >
-            >::type
-        {};
-        struct traits_FCDeque_elimination_stat:
-            public cds::container::fcdeque::make_traits<
-                cds::opt::stat< cds::container::fcdeque::stat<> >,
-                cds::opt::enable_elimination< true >
-            >::type
-        {};
-        struct traits_FCDeque_mutex:
-            public cds::container::fcdeque::make_traits<
-                cds::opt::lock_type< std::mutex >
-            >::type
-        {};
-
-        struct traits_FCDeque_wait_ss: cds::container::fcdeque::traits
-        {
-            typedef cds::algo::flat_combining::wait_strategy::single_mutex_single_condvar<> wait_strategy;
-        };
-        struct traits_FCDeque_wait_ss_stat: traits_FCDeque_wait_ss
-        {
-            typedef cds::container::fcdeque::stat<> stat;
-        };
-        struct traits_FCDeque_wait_sm: cds::container::fcdeque::traits
-        {
-            typedef cds::algo::flat_combining::wait_strategy::single_mutex_multi_condvar<> wait_strategy;
-        };
-        struct traits_FCDeque_wait_sm_stat: traits_FCDeque_wait_sm
-        {
-            typedef cds::container::fcdeque::stat<> stat;
-        };
-        struct traits_FCDeque_wait_mm: cds::container::fcdeque::traits
-        {
-            typedef cds::algo::flat_combining::wait_strategy::multi_mutex_multi_condvar<> wait_strategy;
-        };
-        struct traits_FCDeque_wait_mm_stat: traits_FCDeque_wait_mm
-        {
-            typedef cds::container::fcdeque::stat<> stat;
-        };
 
         typedef details::FCDequeL< Value > FCDequeL_default;
-        typedef details::FCDequeL< Value, traits_FCDeque_mutex > FCDequeL_mutex;
-        typedef details::FCDequeL< Value, traits_FCDeque_stat > FCDequeL_stat;
-        typedef details::FCDequeL< Value, traits_FCDeque_wait_ss > FCDequeL_wait_ss;
-        typedef details::FCDequeL< Value, traits_FCDeque_wait_ss_stat > FCDequeL_wait_ss_stat;
-        typedef details::FCDequeL< Value, traits_FCDeque_wait_sm > FCDequeL_wait_sm;
-        typedef details::FCDequeL< Value, traits_FCDeque_wait_sm_stat > FCDequeL_wait_sm_stat;
-        typedef details::FCDequeL< Value, traits_FCDeque_wait_mm > FCDequeL_wait_mm;
-        typedef details::FCDequeL< Value, traits_FCDeque_wait_mm_stat > FCDequeL_wait_mm_stat;
-        typedef details::FCDequeL< Value, traits_FCDeque_elimination > FCDequeL_elimination;
-        typedef details::FCDequeL< Value, traits_FCDeque_elimination_stat > FCDequeL_elimination_stat;
+        typedef details::FCDequeL< Value, fc_details::traits_FCDeque_mutex > FCDequeL_mutex;
+        typedef details::FCDequeL< Value, fc_details::traits_FCDeque_stat > FCDequeL_stat;
+        typedef details::FCDequeL< Value, fc_details::traits_FCDeque_wait_ss > FCDequeL_wait_ss;
+        typedef details::FCDequeL< Value, fc_details::traits_FCDeque_wait_ss_stat > FCDequeL_wait_ss_stat;
+        typedef details::FCDequeL< Value, fc_details::traits_FCDeque_wait_sm > FCDequeL_wait_sm;
+        typedef details::FCDequeL< Value, fc_details::traits_FCDeque_wait_sm_stat > FCDequeL_wait_sm_stat;
+        typedef details::FCDequeL< Value, fc_details::traits_FCDeque_wait_mm > FCDequeL_wait_mm;
+        typedef details::FCDequeL< Value, fc_details::traits_FCDeque_wait_mm_stat > FCDequeL_wait_mm_stat;
+        typedef details::FCDequeL< Value, fc_details::traits_FCDeque_elimination > FCDequeL_elimination;
+        typedef details::FCDequeL< Value, fc_details::traits_FCDeque_elimination_stat > FCDequeL_elimination_stat;
 
         typedef details::FCDequeL< Value, cds::container::fcdeque::traits, boost::container::deque<Value> > FCDequeL_boost;
-        typedef details::FCDequeL< Value, traits_FCDeque_stat, boost::container::deque<Value> > FCDequeL_boost_stat;
-        typedef details::FCDequeL< Value, traits_FCDeque_elimination, boost::container::deque<Value> > FCDequeL_boost_elimination;
-        typedef details::FCDequeL< Value, traits_FCDeque_elimination_stat, boost::container::deque<Value> > FCDequeL_boost_elimination_stat;
+        typedef details::FCDequeL< Value, fc_details::traits_FCDeque_stat, boost::container::deque<Value> > FCDequeL_boost_stat;
+        typedef details::FCDequeL< Value, fc_details::traits_FCDeque_elimination, boost::container::deque<Value> > FCDequeL_boost_elimination;
+        typedef details::FCDequeL< Value, fc_details::traits_FCDeque_elimination_stat, boost::container::deque<Value> > FCDequeL_boost_elimination_stat;
 
         typedef details::FCDequeR< Value > FCDequeR_default;
-        typedef details::FCDequeR< Value, traits_FCDeque_mutex > FCDequeR_mutex;
-        typedef details::FCDequeR< Value, traits_FCDeque_stat > FCDequeR_stat;
-        typedef details::FCDequeR< Value, traits_FCDeque_wait_ss > FCDequeR_wait_ss;
-        typedef details::FCDequeR< Value, traits_FCDeque_wait_ss_stat > FCDequeR_wait_ss_stat;
-        typedef details::FCDequeR< Value, traits_FCDeque_wait_sm > FCDequeR_wait_sm;
-        typedef details::FCDequeR< Value, traits_FCDeque_wait_sm_stat > FCDequeR_wait_sm_stat;
-        typedef details::FCDequeR< Value, traits_FCDeque_wait_mm > FCDequeR_wait_mm;
-        typedef details::FCDequeR< Value, traits_FCDeque_wait_mm_stat > FCDequeR_wait_mm_stat;
-        typedef details::FCDequeR< Value, traits_FCDeque_elimination > FCDequeR_elimination;
-        typedef details::FCDequeR< Value, traits_FCDeque_elimination_stat > FCDequeR_elimination_stat;
+        typedef details::FCDequeR< Value, fc_details::traits_FCDeque_mutex > FCDequeR_mutex;
+        typedef details::FCDequeR< Value, fc_details::traits_FCDeque_stat > FCDequeR_stat;
+        typedef details::FCDequeR< Value, fc_details::traits_FCDeque_wait_ss > FCDequeR_wait_ss;
+        typedef details::FCDequeR< Value, fc_details::traits_FCDeque_wait_ss_stat > FCDequeR_wait_ss_stat;
+        typedef details::FCDequeR< Value, fc_details::traits_FCDeque_wait_sm > FCDequeR_wait_sm;
+        typedef details::FCDequeR< Value, fc_details::traits_FCDeque_wait_sm_stat > FCDequeR_wait_sm_stat;
+        typedef details::FCDequeR< Value, fc_details::traits_FCDeque_wait_mm > FCDequeR_wait_mm;
+        typedef details::FCDequeR< Value, fc_details::traits_FCDeque_wait_mm_stat > FCDequeR_wait_mm_stat;
+        typedef details::FCDequeR< Value, fc_details::traits_FCDeque_elimination > FCDequeR_elimination;
+        typedef details::FCDequeR< Value, fc_details::traits_FCDeque_elimination_stat > FCDequeR_elimination_stat;
 
         typedef details::FCDequeR< Value, cds::container::fcdeque::traits, boost::container::deque<Value> > FCDequeR_boost;
-        typedef details::FCDequeR< Value, traits_FCDeque_stat, boost::container::deque<Value> > FCDequeR_boost_stat;
-        typedef details::FCDequeR< Value, traits_FCDeque_elimination, boost::container::deque<Value> > FCDequeR_boost_elimination;
-        typedef details::FCDequeR< Value, traits_FCDeque_elimination_stat, boost::container::deque<Value> > FCDequeR_boost_elimination_stat;
+        typedef details::FCDequeR< Value, fc_details::traits_FCDeque_stat, boost::container::deque<Value> > FCDequeR_boost_stat;
+        typedef details::FCDequeR< Value, fc_details::traits_FCDeque_elimination, boost::container::deque<Value> > FCDequeR_boost_elimination;
+        typedef details::FCDequeR< Value, fc_details::traits_FCDeque_elimination_stat, boost::container::deque<Value> > FCDequeR_boost_elimination_stat;
 
         // STL
         typedef StdQueue_deque<Value>               StdQueue_deque_Spinlock;
@@ -537,6 +542,43 @@ namespace queue {
         typedef cds::container::SegmentedQueue< cds::gc::DHP, Value, traits_SegmentedQueue_mutex_padding >  SegmentedQueue_DHP_mutex_padding;
         typedef cds::container::SegmentedQueue< cds::gc::DHP, Value, traits_SegmentedQueue_mutex_stat >  SegmentedQueue_DHP_mutex_stat;
     };
+
+    template <typename Value>
+    struct TypesFCHeavyValue {
+       typedef details::FCDequeL< Value > FCDequeL_HeavyValue_default;
+               typedef details::FCDequeL< Value, fc_details::traits_FCDeque_mutex > FCDequeL_HeavyValue_mutex;
+               typedef details::FCDequeL< Value, fc_details::traits_FCDeque_stat > FCDequeL_HeavyValue_stat;
+               typedef details::FCDequeL< Value, fc_details::traits_FCDeque_wait_ss > FCDequeL_HeavyValue_wait_ss;
+               typedef details::FCDequeL< Value, fc_details::traits_FCDeque_wait_ss_stat > FCDequeL_HeavyValue_wait_ss_stat;
+               typedef details::FCDequeL< Value, fc_details::traits_FCDeque_wait_sm > FCDequeL_HeavyValue_wait_sm;
+               typedef details::FCDequeL< Value, fc_details::traits_FCDeque_wait_sm_stat > FCDequeL_HeavyValue_wait_sm_stat;
+               typedef details::FCDequeL< Value, fc_details::traits_FCDeque_wait_mm > FCDequeL_HeavyValue_wait_mm;
+               typedef details::FCDequeL< Value, fc_details::traits_FCDeque_wait_mm_stat > FCDequeL_HeavyValue_wait_mm_stat;
+               typedef details::FCDequeL< Value, fc_details::traits_FCDeque_elimination > FCDequeL_HeavyValue_elimination;
+               typedef details::FCDequeL< Value, fc_details::traits_FCDeque_elimination_stat > FCDequeL_HeavyValue_elimination_stat;
+
+               typedef details::FCDequeL< Value, cds::container::fcdeque::traits, boost::container::deque<Value> > FCDequeL_HeavyValue_boost;
+               typedef details::FCDequeL< Value, fc_details::traits_FCDeque_stat, boost::container::deque<Value> > FCDequeL_HeavyValue_boost_stat;
+               typedef details::FCDequeL< Value, fc_details::traits_FCDeque_elimination, boost::container::deque<Value> > FCDequeL_HeavyValue_boost_elimination;
+               typedef details::FCDequeL< Value, fc_details::traits_FCDeque_elimination_stat, boost::container::deque<Value> > FCDequeL_HeavyValue_boost_elimination_stat;
+
+               typedef details::FCDequeR< Value > FCDequeR_HeavyValue_default;
+               typedef details::FCDequeR< Value, fc_details::traits_FCDeque_mutex > FCDequeR_HeavyValue_mutex;
+               typedef details::FCDequeR< Value, fc_details::traits_FCDeque_stat > FCDequeR_HeavyValue_stat;
+               typedef details::FCDequeR< Value, fc_details::traits_FCDeque_wait_ss > FCDequeR_HeavyValue_wait_ss;
+               typedef details::FCDequeR< Value, fc_details::traits_FCDeque_wait_ss_stat > FCDequeR_HeavyValue_wait_ss_stat;
+               typedef details::FCDequeR< Value, fc_details::traits_FCDeque_wait_sm > FCDequeR_HeavyValue_wait_sm;
+               typedef details::FCDequeR< Value, fc_details::traits_FCDeque_wait_sm_stat > FCDequeR_HeavyValue_wait_sm_stat;
+               typedef details::FCDequeR< Value, fc_details::traits_FCDeque_wait_mm > FCDequeR_HeavyValue_wait_mm;
+               typedef details::FCDequeR< Value, fc_details::traits_FCDeque_wait_mm_stat > FCDequeR_HeavyValue_wait_mm_stat;
+               typedef details::FCDequeR< Value, fc_details::traits_FCDeque_elimination > FCDequeR_HeavyValue_elimination;
+               typedef details::FCDequeR< Value, fc_details::traits_FCDeque_elimination_stat > FCDequeR_HeavyValue_elimination_stat;
+
+               typedef details::FCDequeR< Value, cds::container::fcdeque::traits, boost::container::deque<Value> > FCDequeR_HeavyValue_boost;
+               typedef details::FCDequeR< Value, fc_details::traits_FCDeque_stat, boost::container::deque<Value> > FCDequeR_HeavyValue_boost_stat;
+               typedef details::FCDequeR< Value, fc_details::traits_FCDeque_elimination, boost::container::deque<Value> > FCDequeR_HeavyValue_boost_elimination;
+               typedef details::FCDequeR< Value, fc_details::traits_FCDeque_elimination_stat, boost::container::deque<Value> > FCDequeR_HeavyValue_boost_elimination_stat;
+    };
 }
 
 
@@ -592,6 +634,15 @@ namespace cds_test {
         test( queue ); \
     }
 
+#define CDSSTRESS_FCQueue_F( test_fixture, type_name, level ) \
+    TEST_F( test_fixture, type_name ) \
+    { \
+        if ( !check_detail_level( level )) return; \
+        typedef queue::TypesFCHeavyValue< value_type >::type_name queue_type; \
+        queue_type queue; \
+        test( queue ); \
+    }
+
 #define CDSSTRESS_MSQueue( test_fixture ) \
     CDSSTRESS_Queue_F( test_fixture, MSQueue_HP,                0 ) \
     CDSSTRESS_Queue_F( test_fixture, MSQueue_HP_michaelAlloc,   0 ) \
@@ -694,6 +745,38 @@ namespace cds_test {
     CDSSTRESS_Queue_F( test_fixture, FCDequeR_boost_elimination,    1 ) \
     CDSSTRESS_Queue_F( test_fixture, FCDequeR_boost_elimination_stat, 1 )
 
+#define CDSSTRESS_FCDeque_HeavyValue( test_fixture ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeL_HeavyValue_default,              1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeL_HeavyValue_mutex,                1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeL_HeavyValue_stat,                 1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeL_HeavyValue_wait_ss,              1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeL_HeavyValue_wait_ss_stat,         1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeL_HeavyValue_wait_sm,              1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeL_HeavyValue_wait_sm_stat,         1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeL_HeavyValue_wait_mm,              1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeL_HeavyValue_wait_mm_stat,         1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeL_HeavyValue_elimination,          1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeL_HeavyValue_elimination_stat,     1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeL_HeavyValue_boost,                1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeL_HeavyValue_boost_stat,           1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeL_HeavyValue_boost_elimination,    1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeL_HeavyValue_boost_elimination_stat, 1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeR_HeavyValue_default,              1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeR_HeavyValue_mutex,                1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeR_HeavyValue_stat,                 1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeR_HeavyValue_wait_ss,              1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeR_HeavyValue_wait_ss_stat,         1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeR_HeavyValue_wait_sm,              1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeR_HeavyValue_wait_sm_stat,         1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeR_HeavyValue_wait_mm,              1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeR_HeavyValue_wait_mm_stat,         1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeR_HeavyValue_elimination,          1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeR_HeavyValue_elimination_stat,     1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeR_HeavyValue_boost,                1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeR_HeavyValue_boost_stat,           1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeR_HeavyValue_boost_elimination,    1 ) \
+    CDSSTRESS_FCQueue_F( test_fixture, FCDequeR_HeavyValue_boost_elimination_stat, 1 )
+
 #define CDSSTRESS_RWQueue( test_fixture ) \
     CDSSTRESS_Queue_F( test_fixture, RWQueue_Spin,      0 ) \
     CDSSTRESS_Queue_F( test_fixture, RWQueue_Spin_ic,   1 ) \
index 03e7e50..bf5ca37 100644 (file)
 
 #include <gtest/gtest.h>
 #include <cds/container/fcqueue.h>
+#include <test/include/cds_test/fc_hevy_value.h>
 
 #include <list>
-#include <math.h>
-#include <vector>
 
 namespace {
 
-       template<int DefaultSize = 10000>
-       struct HeavyValue {
-               static std::vector<int> pop_buff;
-               int value;
-               size_t buffer_size;
-
-               explicit HeavyValue(int new_value = 0, size_t new_bufer_size = DefaultSize)
-               : value(new_value),
-                 buffer_size(new_bufer_size)
-
-               {
-                       if( buffer_size != pop_buff.size() ){
-                               pop_buff.resize(buffer_size);
-                       }
-               };
-               HeavyValue(const HeavyValue &other)
-                       : value(other.value),
-                         buffer_size(other.buffer_size)
-               {
-                       working(other);
-               }
-               void operator=(const int& new_value)
-               {
-                       value = new_value;
-               }
-               bool operator==(const int new_value) const
-               {
-                       return value == new_value;
-               }
-               void working(const HeavyValue &other) {
-                       for (size_t i = 0; i < buffer_size; ++i)
-                               pop_buff[i] =  static_cast<int>(std::sqrt(other.pop_buff[i]));
-               }
-       };
-
-       template<int DefaultSize>
-       std::vector<int> HeavyValue< DefaultSize >::pop_buff = {};
-
     class FCQueue: public ::testing::Test
     {
     protected: