Refactors sequential misc test cases
[libcds.git] / test / stress / sequential / sequential-misc / rigtorp_mpmc_driver.cpp
index 2d46103..0066f90 100644 (file)
@@ -25,7 +25,8 @@ protected:
   }
 
   void test() {
-    rigtorp::MPMCQueue<size_t> q(s_nRigtorpMPMCQueueCapacity);
+    std::unique_ptr<rigtorp::MPMCQueue<size_t>> q(
+        new rigtorp::MPMCQueue<size_t>(s_nRigtorpMPMCQueueCapacity));
     size_t nNo = 0;
     size_t pop_sum = 0;
 
@@ -33,13 +34,13 @@ protected:
       size_t curr_push_count = std::min(s_nRigtorpMPMCQueuePassCount - nNo,
                                         s_nRigtorpMPMCQueueEnqueueStride);
       for (size_t i = 0; i < curr_push_count; i++) {
-        q.push(nNo);
+        q->push(nNo);
         ++nNo;
       }
 
       for (size_t i = 0; i < curr_push_count; i++) {
         size_t res;
-        q.pop(res);
+        q->pop(res);
         pop_sum += res;
       }
     }