Refactors sequential misc test cases
[libcds.git] / test / stress / sequential / sequential-misc / deque_driver.cpp
index 4fc584d..a17484e 100644 (file)
@@ -18,7 +18,6 @@ static size_t s_nDequeMainPassCount = 100000000;
 
 class ChaseLevDequeTest : public cds_test::stress_fixture {
 protected:
-  static Deque *deque;
   static atomic_int terminate_stealer;
   static ullong *sums;
   static ullong *succ_counts;
@@ -31,42 +30,6 @@ protected:
     GetConfig(DequeStealerThreadCount);
     GetConfig(DequeMainPassCount);
   }
-
-  static void StealerThread(int index) {
-    while (!terminate_stealer.load(memory_order_relaxed)) {
-      int res = deque->steal();
-      if (res != EMPTY && res != ABORT) {
-        sums[index] += res;
-        succ_counts[index]++;
-      }
-    }
-  }
-
-  static void MainThread(int index, int push_percentage) {
-    for (ullong i = 0; i < s_nDequeMainPassCount; i++) {
-      if ((::rand() % 100) < push_percentage) {
-        int item = ::rand() % 100;
-        deque->push(item);
-        push_sum += item;
-        push_count++;
-      } else {
-        int res = deque->take();
-        if (res != EMPTY) {
-          sums[index] += res;
-          succ_counts[index]++;
-        }
-      }
-    }
-    while (true) {
-      int res = deque->take();
-      if (res != EMPTY) {
-        sums[index] += res;
-        succ_counts[index]++;
-      } else {
-        break;
-      }
-    }
-  }
 };
 
 atomic_int ChaseLevDequeTest::terminate_stealer;
@@ -74,7 +37,6 @@ ullong *ChaseLevDequeTest::sums;
 ullong *ChaseLevDequeTest::succ_counts;
 ullong ChaseLevDequeTest::push_count;
 ullong ChaseLevDequeTest::push_sum;
-Deque *ChaseLevDequeTest::deque;
 
 TEST_F(ChaseLevDequeTest, ChaseLevDeque_push_take) {
   std::unique_ptr<Deque> deque(new Deque());