Migrated set-insDelFind stress test to gtest framework
[libcds.git] / tests / unit / map2 / map_insdelfind.h
index e382ad2869a44a9945812bb3060bbe8d4a508b68..208d8cbdc398b9606f0ca7fc644e598124440579 100644 (file)
@@ -1,4 +1,32 @@
-//$$CDS-header$$
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    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:
+
+    * Redistributions of source code must retain the above copyright notice, this
+      list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    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.     
+*/
 
 #include "map2/map_type.h"
 #include "cppunit/thread.h"
@@ -23,8 +51,8 @@ namespace map2 {
         size_t c_nCuckooProbesetSize = 16; // CuckooMap probeset size (only for list-based probeset)
         size_t c_nCuckooProbesetThreshold = 0; // CUckooMap probeset threshold (o - use default)
 
-        size_t c_nMultiLevelMap_HeadBits = 10;
-        size_t c_nMultiLevelMap_ArrayBits = 4;
+        size_t c_nFeldmanMap_HeadBits = 10;
+        size_t c_nFeldmanMap_ArrayBits = 4;
 
         size_t  c_nLoadFactor = 2;  // current load factor
 
@@ -39,7 +67,6 @@ namespace map2 {
         actions m_arrShuffle[c_nShuffleSize];
 
     protected:
-        typedef CppUnitMini::TestCase Base;
         typedef size_t  key_type;
         typedef size_t  value_type;
 
@@ -85,7 +112,7 @@ namespace map2 {
                 void operator()( bool /*bNew*/, map_value_type& /*cur*/, Q const& /*val*/ )
                 {}
 
-                // MultiLevelHashMap
+                // FeldmanHashMap
                 void operator()( map_value_type& /*cur*/, map_value_type * /*old*/)
                 {}
 
@@ -214,7 +241,7 @@ namespace map2 {
             timer.reset();
             testMap.clear();
             CPPUNIT_MSG( "   Duration=" << timer.duration() );
-            CPPUNIT_ASSERT_EX( testMap.empty(), ((long long) testMap.size()) );
+            CPPUNIT_CHECK_EX( testMap.empty(), "size=" << ((long long) testMap.size()) );
 
             additional_check( testMap );
             print_stat( testMap );
@@ -256,19 +283,21 @@ namespace map2 {
         CDSUNIT_DECLARE_SkipListMap
         CDSUNIT_DECLARE_EllenBinTreeMap
         CDSUNIT_DECLARE_BronsonAVLTreeMap
-        CDSUNIT_DECLARE_MultiLevelHashMap
+        CDSUNIT_DECLARE_FeldmanHashMap_fixed
+        CDSUNIT_DECLARE_FeldmanHashMap_city
         CDSUNIT_DECLARE_StripedMap
         CDSUNIT_DECLARE_RefinableMap
         CDSUNIT_DECLARE_CuckooMap
         CDSUNIT_DECLARE_StdMap
 
-        CPPUNIT_TEST_SUITE(Map_InsDel_int)
+        CPPUNIT_TEST_SUITE_(Map_InsDelFind, "map_insdelfind")
             CDSUNIT_TEST_MichaelMap
             CDSUNIT_TEST_SplitList
             CDSUNIT_TEST_SkipListMap
             CDSUNIT_TEST_EllenBinTreeMap
             CDSUNIT_TEST_BronsonAVLTreeMap
-            CDSUNIT_TEST_MultiLevelHashMap
+            CDSUNIT_TEST_FeldmanHashMap_fixed
+            CDSUNIT_TEST_FeldmanHashMap_city
             CDSUNIT_TEST_CuckooMap
             CDSUNIT_TEST_StripedMap
             CDSUNIT_TEST_RefinableMap