Uses different pass count for different parallel queue test cases
[libcds.git] / test / stress / sequential / sequential_stack.cpp
index 48287ef..b3598e3 100644 (file)
@@ -40,15 +40,16 @@ namespace {
 #define CDSSTRESS_SequentialTreiberStack_F(test_fixture, type_name)            \
   TEST_F(test_fixture, type_name) {                                            \
     typedef stack::Types<value_type>::type_name stack_type;                    \
 #define CDSSTRESS_SequentialTreiberStack_F(test_fixture, type_name)            \
   TEST_F(test_fixture, type_name) {                                            \
     typedef stack::Types<value_type>::type_name stack_type;                    \
-    stack_type stack;                                                          \
-    test(stack);                                                               \
+    std::unique_ptr<stack_type> stack(new stack_type());                       \
+    test(*stack);                                                              \
   }
 
 #define CDSSTRESS_SequentialEliminationStack_F(test_fixture, type_name)        \
   TEST_F(test_fixture, type_name) {                                            \
     typedef stack::Types<value_type>::type_name stack_type;                    \
   }
 
 #define CDSSTRESS_SequentialEliminationStack_F(test_fixture, type_name)        \
   TEST_F(test_fixture, type_name) {                                            \
     typedef stack::Types<value_type>::type_name stack_type;                    \
-    stack_type stack(s_nSequentialEliminationSize);                            \
-    test(stack);                                                               \
+    std::unique_ptr<stack_type> stack(                                         \
+        new stack_type(s_nSequentialEliminationSize));                         \
+    test(*stack);                                                              \
   }
 
 #define CDSSTRESS_SequentialTreiberStack(test_fixture)                         \
   }
 
 #define CDSSTRESS_SequentialTreiberStack(test_fixture)                         \
@@ -81,7 +82,8 @@ protected:
     GetConfig(SequentialEliminationSize);
   }
 
     GetConfig(SequentialEliminationSize);
   }
 
-  template <typename Stack> void test(Stack &stack) {
+  template <typename Stack>
+  void test(Stack &stack) {
     size_t push_error_cnt = 0;
     size_t pop_sum = 0;
     value_type v;
     size_t push_error_cnt = 0;
     size_t pop_sum = 0;
     value_type v;
@@ -109,7 +111,7 @@ protected:
   }
 };
 
   }
 };
 
-CDSSTRESS_SequentialTreiberStack(sequential_stack)
-    CDSSTRESS_SequentialEliminationStack(sequential_stack)
+CDSSTRESS_SequentialTreiberStack(sequential_stack);
+CDSSTRESS_SequentialEliminationStack(sequential_stack);
 
 } // namespace
 
 } // namespace