Refactored Map_InsDelFind MT-test
[libcds.git] / tests / unit / map2 / map_insdelfind.cpp
index 08f8a32de2ba673144099e0b4c33997cc11834c2..9f343de754183b80e5550a97b5258db901c5835d 100644 (file)
@@ -6,17 +6,9 @@
 namespace map2 {
     CPPUNIT_TEST_SUITE_REGISTRATION( Map_InsDelFind );
 
-    size_t  Map_InsDelFind::c_nInitialMapSize = 500000;
-    size_t  Map_InsDelFind::c_nThreadCount = 8;
-    size_t  Map_InsDelFind::c_nMaxLoadFactor = 8;
-    unsigned int Map_InsDelFind::c_nInsertPercentage = 5;
-    unsigned int Map_InsDelFind::c_nDeletePercentage = 5;
-    unsigned int Map_InsDelFind::c_nDuration = 30;
-    bool    Map_InsDelFind::c_bPrintGCState = true;
-
     void Map_InsDelFind::setUpParams( const CppUnitMini::TestCfg& cfg )
     {
-        c_nInitialMapSize = cfg.getSizeT("InitialMapSize", c_nInitialMapSize );
+        c_nMapSize = cfg.getSizeT("InitialMapSize", c_nMapSize );
         c_nThreadCount = cfg.getSizeT("ThreadCount", c_nThreadCount );
         c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor );
         c_nInsertPercentage = cfg.getUInt("InsertPercentage", c_nInsertPercentage );
@@ -24,8 +16,15 @@ namespace map2 {
         c_nDuration = cfg.getUInt("Duration", c_nDuration );
         c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState );
 
+        c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize);
+        c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize);
+        c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold);
+
+        c_nMultiLevelMap_HeadBits = cfg.getSizeT("MultiLevelMapHeadBits", c_nMultiLevelMap_HeadBits);
+        c_nMultiLevelMap_ArrayBits = cfg.getSizeT("MultiLevelMapArrayBits", c_nMultiLevelMap_ArrayBits);
+
         if ( c_nThreadCount == 0 )
-            c_nThreadCount = cds::OS::topology::processor_count() * 2;
+            c_nThreadCount = std::thread::hardware_concurrency() * 2;
 
         CPPUNIT_ASSERT( c_nInsertPercentage + c_nDeletePercentage <= 100 );
 
@@ -40,21 +39,4 @@ namespace map2 {
         std::fill( pFirst, pLast, do_find );
         shuffle( m_arrShuffle, pLast );
     }
-
-    void Map_InsDelFind::myRun(const char *in_name, bool invert /*= false*/)
-    {
-        setUpParams( m_Cfg.get( "Map_InsDelFind" ));
-
-        run_MichaelMap(in_name, invert);
-        run_SplitList(in_name, invert);
-        run_SkipListMap(in_name, invert);
-        run_EllenBinTreeMap(in_name, invert);
-        run_BronsonAVLTreeMap(in_name, invert);
-        run_StripedMap(in_name, invert);
-        run_RefinableMap(in_name, invert);
-        run_CuckooMap(in_name, invert);
-        run_StdMap(in_name, invert);
-
-        endTestCase();
-    }
 } // namespace map2