Refactored Map_InsDel_Item_int MT-test
authorkhizmax <libcds.dev@gmail.com>
Mon, 7 Sep 2015 19:54:52 +0000 (22:54 +0300)
committerkhizmax <libcds.dev@gmail.com>
Mon, 7 Sep 2015 19:54:52 +0000 (22:54 +0300)
18 files changed:
projects/Win/vc12/unit-map-insdel-item.vcxproj
projects/Win/vc12/unit-map-insdel-item.vcxproj.filters
projects/source.unit.map.mk
tests/data/test-debug.conf
tests/data/test-express.conf
tests/data/test.conf
tests/unit/map2/CMakeLists.txt
tests/unit/map2/map_insdel_item_int.cpp
tests/unit/map2/map_insdel_item_int.h
tests/unit/map2/map_insdel_item_int_bronsonavltree.cpp
tests/unit/map2/map_insdel_item_int_cuckoo.cpp
tests/unit/map2/map_insdel_item_int_ellentree.cpp
tests/unit/map2/map_insdel_item_int_michael.cpp
tests/unit/map2/map_insdel_item_int_multilevelhashmap.cpp [new file with mode: 0644]
tests/unit/map2/map_insdel_item_int_refinable.cpp [deleted file]
tests/unit/map2/map_insdel_item_int_skip.cpp
tests/unit/map2/map_insdel_item_int_split.cpp
tests/unit/map2/map_insdel_item_int_striped.cpp

index dca2f9eb3fc4ec263fc0e107bf8784c0ed3495fe..3b511b94f483b0d4d594e53d165bac1fa319253c 100644 (file)
@@ -48,7 +48,7 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_int_cuckoo.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_int_ellentree.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_int_michael.cpp" />\r
-    <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_int_refinable.cpp" />\r
+    <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_int_multilevelhashmap.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_int_skip.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_int_split.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_int_striped.cpp" />\r
index 29dc3c71098a9b8f673ab295dd1096cca0f01402..6c28496df5a460decc23f9ab9826e33ebc10fee5 100644 (file)
@@ -24,9 +24,6 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_int_michael.cpp">\r
       <Filter>map_insdel_item_int</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_int_refinable.cpp">\r
-      <Filter>map_insdel_item_int</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_int_skip.cpp">\r
       <Filter>map_insdel_item_int</Filter>\r
     </ClCompile>\r
@@ -63,6 +60,9 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_string_striped.cpp">\r
       <Filter>map_insdel_item_string</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_int_multilevelhashmap.cpp">\r
+      <Filter>map_insdel_item_int</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\..\..\tests\unit\map2\map_insdel_item_int.h">\r
index f6cde97209e4fa6e00b9bfbc212cd6657cb40e45..15c35b5dc4ed2b563edb933cff25cdb06aa34a96 100644 (file)
@@ -50,14 +50,14 @@ CDSUNIT_MAP_SOURCES := \
     tests/unit/map2/map_insdel_int_striped.cpp \
     tests/unit/map2/map_insdel_int_std.cpp \
     tests/unit/map2/map_insdel_item_int.cpp \
+    tests/unit/map2/map_insdel_item_int_bronsonavltree.cpp \
+    tests/unit/map2/map_insdel_item_int_cuckoo.cpp \
+    tests/unit/map2/map_insdel_item_int_ellentree.cpp \
     tests/unit/map2/map_insdel_item_int_michael.cpp \
-    tests/unit/map2/map_insdel_item_int_split.cpp \
+    tests/unit/map2/map_insdel_item_int_multilevelhashmap.cpp \
     tests/unit/map2/map_insdel_item_int_skip.cpp \
-    tests/unit/map2/map_insdel_item_int_ellentree.cpp \
-    tests/unit/map2/map_insdel_item_int_bronsonavltree.cpp \
+    tests/unit/map2/map_insdel_item_int_split.cpp \
     tests/unit/map2/map_insdel_item_int_striped.cpp \
-    tests/unit/map2/map_insdel_item_int_refinable.cpp \
-    tests/unit/map2/map_insdel_item_int_cuckoo.cpp \
     tests/unit/map2/map_insdel_item_string.cpp \
     tests/unit/map2/map_insdel_item_string_bronsonavltree.cpp \
     tests/unit/map2/map_insdel_item_string_cuckoo.cpp \
index 9ca66223f704582e1709a10f7ce0ef5716ba5e6b..96a984334ed236c6cc13098702659672cda9bf48 100644 (file)
@@ -187,6 +187,14 @@ GoalItem=5000
 AttemptCount=1000\r
 MaxLoadFactor=4\r
 PrintGCStateFlag=1\r
+# *** Cuckoo map properties\r
+CuckooInitialSize=256\r
+CuckooProbesetSize=8\r
+# 0 - use default\r
+CuckooProbesetThreshold=0 \r
+# *** MultiLevelHashMap properties\r
+MultiLevelMapHeadBits=8\r
+MultiLevelMapArrayBits=4\r
 \r
 [Map_InsDel_string]\r
 InsertThreadCount=4\r
index 4acc48427fb29716b53feaada4c7568e07b52c80..58547eadbb3cf5148e83fe758250326f1cdbe450 100644 (file)
@@ -185,6 +185,14 @@ GoalItem=50000
 AttemptCount=100\r
 MaxLoadFactor=4\r
 PrintGCStateFlag=1\r
+# *** Cuckoo map properties\r
+CuckooInitialSize=1024\r
+CuckooProbesetSize=16\r
+# 0 - use default\r
+CuckooProbesetThreshold=0 \r
+# *** MultiLevelHashMap properties\r
+MultiLevelMapHeadBits=8\r
+MultiLevelMapArrayBits=4\r
 \r
 [Map_InsDel_string]\r
 InsertThreadCount=4\r
index 66e994a1c6e2dba2f0aa26239a784c1e709f734c..1a0bccbbcca0560ac620a17d2ed247c3a16ccf83 100644 (file)
@@ -180,6 +180,14 @@ GoalItem=500000
 AttemptCount=10000\r
 MaxLoadFactor=4\r
 PrintGCStateFlag=1\r
+# *** Cuckoo map properties\r
+CuckooInitialSize=1024\r
+CuckooProbesetSize=16\r
+# 0 - use default\r
+CuckooProbesetThreshold=0 \r
+# *** MultiLevelHashMap properties\r
+MultiLevelMapHeadBits=10\r
+MultiLevelMapArrayBits=4\r
 \r
 [Map_InsDel_string]\r
 InsertThreadCount=4\r
index 02b476d9899d5ae438cd422d143b45b9c4d3934f..d449b989a9266345c655e18bd974534f5ab71127 100644 (file)
@@ -51,14 +51,14 @@ set(CDSUNIT_MAP_SOURCES
     map_insdel_int_striped.cpp
     map_insdel_int_std.cpp
     map_insdel_item_int.cpp
+    map_insdel_item_int_bronsonavltree.cpp
+    map_insdel_item_int_cuckoo.cpp
+    map_insdel_item_int_ellentree.cpp
     map_insdel_item_int_michael.cpp
-    map_insdel_item_int_split.cpp
+    map_insdel_item_int_multilevelhashmap.cpp
     map_insdel_item_int_skip.cpp
-    map_insdel_item_int_ellentree.cpp
-    map_insdel_item_int_bronsonavltree.cpp
+    map_insdel_item_int_split.cpp
     map_insdel_item_int_striped.cpp
-    map_insdel_item_int_refinable.cpp
-    map_insdel_item_int_cuckoo.cpp
     map_insdel_item_string.cpp
     map_insdel_item_string_michael.cpp
     map_insdel_item_string_split.cpp
index cfb7d8c2b014d1b8962f87363876d0badbbf038b..12e938054c9d870d9996bac4dc0ccf8239ee4c67 100644 (file)
@@ -5,36 +5,23 @@
 namespace map2 {
     CPPUNIT_TEST_SUITE_REGISTRATION( Map_InsDel_Item_int );
 
-    size_t Map_InsDel_Item_int::c_nMapSize = 1000000    ;  // map size
-    size_t Map_InsDel_Item_int::c_nThreadCount = 4      ;  // thread count
-    size_t Map_InsDel_Item_int::c_nGoalItem = Map_InsDel_Item_int::c_nMapSize / 2;
-    size_t Map_InsDel_Item_int::c_nAttemptCount = 100000       ;   // count of SUCCESS insert/delete for each thread
-    size_t Map_InsDel_Item_int::c_nMaxLoadFactor = 8    ;  // maximum load factor
-    bool   Map_InsDel_Item_int::c_bPrintGCState = true;
-
     void Map_InsDel_Item_int::setUpParams( const CppUnitMini::TestCfg& cfg )
     {
         c_nThreadCount = cfg.getSizeT("ThreadCount", c_nThreadCount );
         c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize );
-        c_nGoalItem = cfg.getSizeT("GoalItem", c_nGoalItem );
+        c_nGoalItem = cfg.getSizeT("GoalItem", c_nMapSize / 2 );
         c_nAttemptCount = cfg.getSizeT("AttemptCount", c_nAttemptCount );
         c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor );
         c_bPrintGCState = cfg.getBool("PrintGCStateFlag", true );
-    }
 
-    void Map_InsDel_Item_int::myRun(const char *in_name, bool invert /*= false*/)
-    {
-        setUpParams( m_Cfg.get( "Map_InsDel_Item_int" ));
+        c_nCuckooInitialSize = cfg.getSizeT("CuckooInitialSize", c_nCuckooInitialSize);
+        c_nCuckooProbesetSize = cfg.getSizeT("CuckooProbesetSize", c_nCuckooProbesetSize);
+        c_nCuckooProbesetThreshold = cfg.getSizeT("CuckooProbesetThreshold", c_nCuckooProbesetThreshold);
 
-        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);
+        c_nMultiLevelMap_HeadBits = cfg.getSizeT("MultiLevelMapHeadBits", c_nMultiLevelMap_HeadBits);
+        c_nMultiLevelMap_ArrayBits = cfg.getSizeT("MultiLevelMapArrayBits", c_nMultiLevelMap_ArrayBits);
 
-        endTestCase();
+        if ( c_nThreadCount == 0 )
+            c_nThreadCount = std::thread::hardware_concurrency() * 2;
     }
 } // namespace map2
index 298b970bd3e2defb511f755c083cfd088018315e..a18bdca914137f7c175199554579860a54894001 100644 (file)
@@ -7,35 +7,43 @@
 
 namespace map2 {
 
-#   define TEST_MAP(IMPL, C, X)         void C::X() { test<map_type<IMPL, key_type, value_type>::X >(); }
-#   define TEST_MAP_NOLF(IMPL, C, X)    void C::X() { test_nolf<map_type<IMPL, key_type, value_type>::X >(); }
-#   define TEST_MAP_EXTRACT(IMPL, C, X)  TEST_MAP(IMPL, C, X)
-#   define TEST_MAP_NOLF_EXTRACT(IMPL, C, X) TEST_MAP_NOLF(IMPL, C, X)
+#define TEST_CASE(TAG, X)  void X();
 
     class Map_InsDel_Item_int: public CppUnitMini::TestCase
     {
-        static size_t  c_nMapSize;        // map size
-        static size_t  c_nThreadCount;    // thread count
-        static size_t  c_nGoalItem;
-        static size_t  c_nAttemptCount;   // count of SUCCESS insert/delete for each thread
-        static size_t  c_nMaxLoadFactor;  // maximum load factor
-        static bool    c_bPrintGCState;
+    public:
+        size_t  c_nMapSize = 1000000;        // map size
+        size_t  c_nThreadCount = 4;    // thread count
+        size_t  c_nAttemptCount = 100000;   // count of SUCCESS insert/delete for each thread
+        size_t  c_nMaxLoadFactor = 8;  // maximum load factor
+        bool    c_bPrintGCState = true;
 
+        size_t c_nCuckooInitialSize = 1024;// initial size for CuckooMap
+        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_nGoalItem;
+        size_t  c_nLoadFactor = 2;  // current load factor
+
+    private:
         typedef CppUnitMini::TestCase Base;
         typedef size_t  key_type;
         typedef size_t  value_type;
 
-        template <class MAP>
+        template <class Map>
         class Inserter: public CppUnitMini::TestThread
         {
-            MAP&     m_Map;
+            Map&     m_Map;
 
             virtual Inserter *    clone()
             {
                 return new Inserter( *this );
             }
 
-            struct ensure_func
+            struct update_func
             {
                 void operator()( bool bNew, std::pair<key_type const, value_type>& item )
                 {
@@ -55,6 +63,13 @@ namespace map2 {
                     if ( bNew )
                         val = key;
                 }
+
+                // for MultiLevelHashMap
+                void operator()( std::pair<key_type const, value_type>& item, std::pair<key_type const, value_type> * pOld )
+                {
+                    if ( !pOld )
+                        item.second = item.first;
+                }
             };
 
         public:
@@ -62,7 +77,7 @@ namespace map2 {
             size_t  m_nInsertFailed;
 
         public:
-            Inserter( CppUnitMini::ThreadPool& pool, MAP& rMap )
+            Inserter( CppUnitMini::ThreadPool& pool, Map& rMap )
                 : CppUnitMini::TestThread( pool )
                 , m_Map( rMap )
             {}
@@ -81,13 +96,15 @@ namespace map2 {
 
             virtual void test()
             {
-                MAP& rMap = m_Map;
+                Map& rMap = m_Map;
 
                 m_nInsertSuccess =
                     m_nInsertFailed = 0;
 
-                size_t nGoalItem = c_nGoalItem;
-                for ( size_t nAttempt = 0; nAttempt < c_nAttemptCount; ) {
+                size_t nGoalItem = getTest().c_nGoalItem;
+                size_t const nAttemptCount = getTest().c_nAttemptCount;
+
+                for ( size_t nAttempt = 0; nAttempt < nAttemptCount; ) {
                     if ( nAttempt % 2  == 0 ) {
                         if ( rMap.insert( nGoalItem, nGoalItem )) {
                             ++m_nInsertSuccess;
@@ -97,8 +114,8 @@ namespace map2 {
                             ++m_nInsertFailed;
                     }
                     else {
-                        std::pair<bool, bool> ensureResult = rMap.ensure( nGoalItem, ensure_func() );
-                        if ( ensureResult.second ) {
+                        std::pair<bool, bool> updateResult = rMap.update( nGoalItem, update_func(), true );
+                        if ( updateResult.second ) {
                             ++m_nInsertSuccess;
                             ++nAttempt;
                         }
@@ -109,10 +126,10 @@ namespace map2 {
             }
         };
 
-        template <class MAP>
+        template <class Map>
         class Deleter: public CppUnitMini::TestThread
         {
-            MAP&     m_Map;
+            Map&     m_Map;
 
             virtual Deleter *    clone()
             {
@@ -123,7 +140,7 @@ namespace map2 {
             size_t  m_nDeleteFailed;
 
         public:
-            Deleter( CppUnitMini::ThreadPool& pool, MAP& rMap )
+            Deleter( CppUnitMini::ThreadPool& pool, Map& rMap )
                 : CppUnitMini::TestThread( pool )
                 , m_Map( rMap )
             {}
@@ -142,13 +159,14 @@ namespace map2 {
 
             virtual void test()
             {
-                MAP& rMap = m_Map;
+                Map& rMap = m_Map;
 
                 m_nDeleteSuccess =
                     m_nDeleteFailed = 0;
 
-                size_t nGoalItem = c_nGoalItem;
-                for ( size_t nAttempt = 0; nAttempt < c_nAttemptCount; ) {
+                size_t nGoalItem = getTest().c_nGoalItem;
+                size_t const nAttemptCount = getTest().c_nAttemptCount;
+                for ( size_t nAttempt = 0; nAttempt < nAttemptCount; ) {
                     if ( rMap.erase( nGoalItem )) {
                         ++m_nDeleteSuccess;
                         ++nAttempt;
@@ -161,11 +179,11 @@ namespace map2 {
 
     protected:
 
-        template <class MAP>
-        void do_test( MAP& testMap )
+        template <class Map>
+        void do_test( Map& testMap )
         {
-            typedef Inserter<MAP>       InserterThread;
-            typedef Deleter<MAP>        DeleterThread;
+            typedef Inserter<Map>       InserterThread;
+            typedef Deleter<Map>        DeleterThread;
             cds::OS::Timer    timer;
 
             // Fill the map
@@ -210,7 +228,7 @@ namespace map2 {
             }
             CPPUNIT_CHECK( nInsertSuccess == nDeleteSuccess );
             size_t nGoalItem = c_nGoalItem;
-            CPPUNIT_CHECK( testMap.find( nGoalItem ));
+            CPPUNIT_CHECK( testMap.contains( nGoalItem ));
 
 
             CPPUNIT_MSG( "    Totals: Ins fail=" << nInsertFailed << " Del fail=" << nDeleteFailed );
@@ -219,7 +237,7 @@ namespace map2 {
             CPPUNIT_MSG( "    Check if the map contains all items" );
             timer.reset();
             for ( size_t i = 0; i < c_nMapSize; ++i ) {
-                CPPUNIT_CHECK_EX( testMap.find( i ), "key " << i );
+                CPPUNIT_CHECK_EX( testMap.contains( i ), "key " << i );
             }
             CPPUNIT_MSG( "    Duration=" << timer.duration() );
 
@@ -231,49 +249,51 @@ namespace map2 {
             additional_cleanup( testMap );
         }
 
-        template <class MAP>
-        void test()
+        template <class Map>
+        void run_test()
         {
-            for ( size_t nLoadFactor = 1; nLoadFactor <= c_nMaxLoadFactor; nLoadFactor *= 2 ) {
-                CPPUNIT_MSG( "Load factor=" << nLoadFactor );
-                MAP testMap( c_nMapSize, nLoadFactor );
-                do_test( testMap );
+            if ( Map::c_bLoadFactorDepended ) {
+                for ( size_t nLoadFactor = 1; nLoadFactor <= c_nMaxLoadFactor; nLoadFactor *= 2 ) {
+                    CPPUNIT_MSG( "Load factor=" << nLoadFactor );
+                    Map testMap( *this );
+                    do_test( testMap );
+                    if ( c_bPrintGCState )
+                        print_gc_state();
+                }
+            }
+            else {
+                Map testMap( *this );
+                do_test<Map>( testMap );
                 if ( c_bPrintGCState )
                     print_gc_state();
             }
         }
 
-        template <class MAP>
-        void test_nolf()
-        {
-            MAP testMap;
-            do_test<MAP>( testMap );
-            if ( c_bPrintGCState )
-                print_gc_state();
-        }
-
         void setUpParams( const CppUnitMini::TestCfg& cfg );
 
-        void run_MichaelMap(const char *in_name, bool invert = false);
-        void run_SplitList(const char *in_name, bool invert = false);
-        void run_SkipListMap(const char *in_name, bool invert = false);
-        void run_StripedMap(const char *in_name, bool invert = false);
-        void run_RefinableMap(const char *in_name, bool invert = false);
-        void run_CuckooMap(const char *in_name, bool invert = false);
-        void run_EllenBinTreeMap(const char *in_name, bool invert = false);
-        void run_BronsonAVLTreeMap(const char *in_name, bool invert = false);
-
-        virtual void myRun(const char *in_name, bool invert = false);
-
 #   include "map2/map_defs.h"
         CDSUNIT_DECLARE_MichaelMap
         CDSUNIT_DECLARE_SplitList
         CDSUNIT_DECLARE_SkipListMap
         CDSUNIT_DECLARE_EllenBinTreeMap
         CDSUNIT_DECLARE_BronsonAVLTreeMap
+        CDSUNIT_DECLARE_MultiLevelHashMap
         CDSUNIT_DECLARE_StripedMap
         CDSUNIT_DECLARE_RefinableMap
         CDSUNIT_DECLARE_CuckooMap
-        //CDSUNIT_DECLARE_StdMap    // very slow!
+        // CDSUNIT_DECLARE_StdMap // very slow!!
+
+        CPPUNIT_TEST_SUITE(Map_InsDel_int)
+            CDSUNIT_TEST_MichaelMap
+            CDSUNIT_TEST_SplitList
+            CDSUNIT_TEST_SkipListMap
+            CDSUNIT_TEST_EllenBinTreeMap
+            CDSUNIT_TEST_BronsonAVLTreeMap
+            CDSUNIT_TEST_MultiLevelHashMap
+            CDSUNIT_TEST_CuckooMap
+            CDSUNIT_TEST_StripedMap
+            CDSUNIT_TEST_RefinableMap
+            // CDSUNIT_TEST_StdMap // very slow!!
+        CPPUNIT_TEST_SUITE_END();
     };
 } // namespace map2
index 2146deeb5b961d583a78560e81f14670a58d0b32..e97a11946d5f46a628284579ebfe959b92ebc024 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_item_int.h"
 #include "map2/map_type_bronson_avltree.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_BronsonAVLTreeMap( cc::bronson_avltree::implementation_tag, Map_InsDel_Item_int)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_int::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_int, run_BronsonAVLTreeMap )
-        CDSUNIT_TEST_BronsonAVLTreeMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_BronsonAVLTreeMap
 } // namespace map2
index a0dd6d6ac66080db009602bd76f6540d3cde7d7f..7319540ca30a03b842b0f3be72634bff7e7eb1c3 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_item_int.h"
 #include "map2/map_type_cuckoo.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_CuckooMap(cds::intrusive::cuckoo::implementation_tag, Map_InsDel_Item_int)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_int::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_int, run_CuckooMap )
-        CDSUNIT_TEST_CuckooMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_CuckooMap
 } // namespace map2
index 6790ec190aa0f611e202fb1f55d9c531aa891937..32165898a7697a79294d8d95d098ec6361d501f9 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_item_int.h"
 #include "map2/map_type_ellen_bintree.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_EllenBinTreeMap( cc::ellen_bintree::implementation_tag, Map_InsDel_Item_int)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_int::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_int, run_EllenBinTreeMap )
-        CDSUNIT_TEST_EllenBinTreeMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_EllenBinTreeMap
 } // namespace map2
index 487af6b25c8b17e43f61c14d10d2b27e975dea03..e8ff030ab0fc5ced862117ed678ecc91f7b256c2 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_item_int.h"
 #include "map2/map_type_michael.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_MichaelMap( cc::michael_map::implementation_tag, Map_InsDel_Item_int )
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_int::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_int, run_MichaelMap )
-        CDSUNIT_TEST_MichaelMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_MichaelMap
 } // namespace map2
diff --git a/tests/unit/map2/map_insdel_item_int_multilevelhashmap.cpp b/tests/unit/map2/map_insdel_item_int_multilevelhashmap.cpp
new file mode 100644 (file)
index 0000000..1e1f1a4
--- /dev/null
@@ -0,0 +1,12 @@
+//$$CDS-header$$
+
+#include "map2/map_insdel_item_int.h"
+#include "map2/map_type_multilevel_hashmap.h"
+
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_int::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
+
+namespace map2 {
+    CDSUNIT_DECLARE_MultiLevelHashMap
+} // namespace map2
diff --git a/tests/unit/map2/map_insdel_item_int_refinable.cpp b/tests/unit/map2/map_insdel_item_int_refinable.cpp
deleted file mode 100644 (file)
index d05b6af..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-//$$CDS-header$$
-
-#include "map2/map_insdel_item_int.h"
-#include "map2/map_type_striped.h"
-
-namespace map2 {
-    CDSUNIT_DEFINE_RefinableMap(cc::striped_set::implementation_tag, Map_InsDel_Item_int)
-
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_int, run_RefinableMap )
-        CDSUNIT_TEST_RefinableMap
-    CPPUNIT_TEST_SUITE_END_PART()
-} // namespace map2
index 0a9dd2444f290d830268bf3b6322191a5fc2c546..2710582ee3411ba89776fb2890836f8367fdcfe6 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_item_int.h"
 #include "map2/map_type_skip_list.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_SkipListMap( cc::skip_list::implementation_tag, Map_InsDel_Item_int)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_int::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_int, run_SkipListMap )
-        CDSUNIT_TEST_SkipListMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_SkipListMap
 } // namespace map2
index 40c48aea99f9e6fd6f5c16cbc1f33f1a2c0df30a..8915a7734ddfe146722556bae9e31b6a437b0a3e 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_item_int.h"
 #include "map2/map_type_split_list.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_SplitList( cc::split_list::implementation_tag, Map_InsDel_Item_int )
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_int::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_int, run_SplitList )
-        CDSUNIT_TEST_SplitList
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_SplitList
 } // namespace map2
index e59cc31491a94ff242333696d62e170936e57f48..0940422e005101f2e8c7621d4a786fc90701d66e 100644 (file)
@@ -3,10 +3,11 @@
 #include "map2/map_insdel_item_int.h"
 #include "map2/map_type_striped.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_StripedMap(cc::striped_set::implementation_tag, Map_InsDel_Item_int)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_int::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_int, run_StripedMap )
-        CDSUNIT_TEST_StripedMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_StripedMap
+    CDSUNIT_DECLARE_RefinableMap
 } // namespace map2