MultiLevelHashSet test, bugfixing
[libcds.git] / tests / unit / set2 / set_delodd.cpp
index ca0333310932795f589e5cdd925a8fcaf9b51834..db2406126f87fb118272fcb25ec7f50c51f73615 100644 (file)
@@ -5,13 +5,6 @@
 namespace set2 {
     CPPUNIT_TEST_SUITE_REGISTRATION( Set_DelOdd );
 
-    size_t Set_DelOdd::c_nSetSize = 1000000;
-    size_t Set_DelOdd::c_nInsThreadCount;
-    size_t Set_DelOdd::c_nDelThreadCount;
-    size_t Set_DelOdd::c_nExtractThreadCount;
-    size_t Set_DelOdd::c_nMaxLoadFactor;
-    bool   Set_DelOdd::c_bPrintGCState;
-
     void Set_DelOdd::setUpParams( const CppUnitMini::TestCfg& cfg )
     {
         c_nSetSize = cfg.getSizeT("MapSize", c_nSetSize );
@@ -21,29 +14,23 @@ namespace set2 {
         c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor);
         c_bPrintGCState = cfg.getBool("PrintGCStateFlag", true );
 
+        c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize );
+        c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize );
+        c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold );
+
+        c_nMultiLevelSet_HeadBits = cfg.getSizeT("MultiLevelMapHeadBits", c_nMultiLevelSet_HeadBits);
+        c_nMultiLevelSet_ArrayBits = cfg.getSizeT("MultiLevelMapArrayBits", c_nMultiLevelSet_ArrayBits);
+
         if ( c_nInsThreadCount == 0 )
-            c_nInsThreadCount = cds::OS::topology::processor_count();
+            c_nInsThreadCount = std::thread::hardware_concurrency();
         if ( c_nDelThreadCount == 0 && c_nExtractThreadCount == 0 ) {
-            c_nExtractThreadCount = cds::OS::topology::processor_count() / 2;
-            c_nDelThreadCount = cds::OS::topology::processor_count() - c_nExtractThreadCount;
+            c_nExtractThreadCount = std::thread::hardware_concurrency() / 2;
+            c_nDelThreadCount = std::thread::hardware_concurrency() - c_nExtractThreadCount;
         }
 
         m_arrData.resize( c_nSetSize );
         for ( size_t i = 0; i < c_nSetSize; ++i )
             m_arrData[i] = i;
-        std::random_shuffle( m_arrData.begin(), m_arrData.end() );
-    }
-
-    void Set_DelOdd::myRun(const char *in_name, bool invert /*= false*/)
-    {
-        setUpParams( m_Cfg.get( "Map_DelOdd" ));
-
-        run_MichaelSet(in_name, invert);
-        run_SplitList(in_name, invert);
-        run_SkipListSet(in_name, invert);
-        run_EllenBinTreeSet(in_name, invert);
-        run_CuckooSet(in_name, invert);
-
-        endTestCase();
+        shuffle( m_arrData.begin(), m_arrData.end() );
     }
 } // namespace set2