Merge branch 'flat_combinig_add_stress_and_unint_tests' of https://github.com/mgalimu...
[libcds.git] / test / stress / set / delodd / set_delodd.cpp
index 09c44fed2ca494d9802efceaf66a9d53ebc6d36f..04c5199e079b4e00c3bb544cc9ae6eea8aec2ed1 100644 (file)
@@ -1,11 +1,11 @@
 /*
     This file is a part of libcds - Concurrent Data Structures library
 
-    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
 
     Source code repo: http://github.com/khizmax/libcds/
     Download: http://sourceforge.net/projects/libcds/files/
-    
+
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions are met:
 
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
     CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
 #include "set_delodd.h"
 
 namespace set {
-    
+
     size_t  Set_DelOdd::s_nSetSize = 1000000;
     size_t  Set_DelOdd::s_nInsThreadCount = 4;
     size_t  Set_DelOdd::s_nDelThreadCount = 4;
     size_t  Set_DelOdd::s_nExtractThreadCount = 4;
+    size_t  Set_DelOdd::s_nFindThreadCount = 2;
     size_t  Set_DelOdd::s_nMaxLoadFactor = 8;
+    size_t  Set_DelOdd::s_nInsertPassCount = 100;
 
     size_t  Set_DelOdd::s_nCuckooInitialSize = 1024;
     size_t  Set_DelOdd::s_nCuckooProbesetSize = 16;
@@ -63,11 +65,16 @@ namespace set {
 
         s_nDelThreadCount = cfg.get_size_t( "DelThreadCount", s_nDelThreadCount );
         s_nExtractThreadCount = cfg.get_size_t( "ExtractThreadCount", s_nExtractThreadCount );
+        s_nFindThreadCount = cfg.get_size_t( "FindThreadCount", s_nFindThreadCount );
 
         s_nMaxLoadFactor = cfg.get_size_t( "MaxLoadFactor", s_nMaxLoadFactor );
         if ( s_nMaxLoadFactor == 0 )
             s_nMaxLoadFactor = 1;
 
+        s_nInsertPassCount = cfg.get_size_t( "PassCount", s_nInsertPassCount );
+        if ( s_nInsertPassCount == 0 )
+            s_nInsertPassCount = 100;
+
         s_nCuckooInitialSize = cfg.get_size_t( "CuckooInitialSize", s_nCuckooInitialSize );
         if ( s_nCuckooInitialSize < 256 )
             s_nCuckooInitialSize = 256;
@@ -89,7 +96,7 @@ namespace set {
         m_arrData.resize( s_nSetSize );
         for ( size_t i = 0; i < s_nSetSize; ++i )
             m_arrData[i] = i;
-        shuffle( m_arrData.begin(), m_arrData.end() );
+        shuffle( m_arrData.begin(), m_arrData.end());
     }
 
     void Set_DelOdd::TearDownTestCase()
@@ -112,5 +119,5 @@ namespace set {
         return lf;
     }
 
-    INSTANTIATE_TEST_CASE_P( a, Set_DelOdd_LF, ::testing::ValuesIn( Set_DelOdd_LF::get_load_factors() ) );
+    INSTANTIATE_TEST_CASE_P( a, Set_DelOdd_LF, ::testing::ValuesIn( Set_DelOdd_LF::get_load_factors()));
 } // namespace set