Fixed map-minmax stress test for HP
authorkhizmax <libcds.dev@gmail.com>
Tue, 7 Feb 2017 18:26:39 +0000 (21:26 +0300)
committerkhizmax <libcds.dev@gmail.com>
Tue, 7 Feb 2017 18:26:39 +0000 (21:26 +0300)
test/stress/map/minmax/map_minmax.cpp
test/stress/map/minmax/map_minmax.h

index 1d2a7fc..fd7f672 100644 (file)
@@ -37,8 +37,8 @@ namespace map {
     size_t  Map_MinMax::s_nExtractThreadCount = 4;
     size_t  Map_MinMax::s_nPassCount = 1000;
 
-    //size_t Map_MinMax::s_nFeldmanMap_HeadBits = 8;
-    //size_t Map_MinMax::s_nFeldmanMap_ArrayBits = 8;
+    size_t Map_MinMax::s_nFeldmanMap_HeadBits = 8;
+    size_t Map_MinMax::s_nFeldmanMap_ArrayBits = 8;
 
     void Map_MinMax::SetUpTestCase()
     {
@@ -60,13 +60,13 @@ namespace map {
         if ( s_nPassCount == 0 )
             s_nPassCount = 100;
 
-        //s_nFeldmanMap_HeadBits = cfg.get_size_t( "FeldmanMapHeadBits", s_nFeldmanMap_HeadBits );
-        //if ( s_nFeldmanMap_HeadBits == 0 )
-        //    s_nFeldmanMap_HeadBits = 4;
+        s_nFeldmanMap_HeadBits = cfg.get_size_t( "FeldmanMapHeadBits", s_nFeldmanMap_HeadBits );
+        if ( s_nFeldmanMap_HeadBits == 0 )
+            s_nFeldmanMap_HeadBits = 4;
 
-        //s_nFeldmanMap_ArrayBits = cfg.get_size_t( "FeldmanMapArrayBits", s_nFeldmanMap_ArrayBits );
-        //if ( s_nFeldmanMap_ArrayBits == 0 )
-        //    s_nFeldmanMap_ArrayBits = 4;
+        s_nFeldmanMap_ArrayBits = cfg.get_size_t( "FeldmanMapArrayBits", s_nFeldmanMap_ArrayBits );
+        if ( s_nFeldmanMap_ArrayBits == 0 )
+            s_nFeldmanMap_ArrayBits = 4;
     }
 
 } // namespace map
index 2703a05..61bb8a1 100644 (file)
@@ -41,8 +41,8 @@ namespace map {
         static size_t s_nMapSize;             // max map size
         static size_t s_nPassCount;
 
-        //static size_t s_nFeldmanMap_HeadBits;
-        //static size_t s_nFeldmanMap_ArrayBits;
+        static size_t s_nFeldmanMap_HeadBits;
+        static size_t s_nFeldmanMap_ArrayBits;
 
         static size_t  s_nLoadFactor;  // current load factor
 
@@ -194,6 +194,22 @@ namespace map {
                         ++m_nDeleteMaxFailed;
 
                 } while ( fixture.m_nInsThreadCount.load( atomics::memory_order_acquire ) != 0 );
+
+                gp = rMap.extract_min();
+                if ( gp ) {
+                    if ( gp->first == keyMin )
+                        ++m_nDeleteMin;
+                }
+                else
+                    ++m_nDeleteMinFailed;
+
+                gp = rMap.extract_max();
+                if ( gp ) {
+                    if ( gp->first == keyMax )
+                        ++m_nDeleteMax;
+                }
+                else
+                    ++m_nDeleteMaxFailed;
             }
         };