Refactored Map_InsDelFind MT-test
authorkhizmax <libcds.dev@gmail.com>
Mon, 7 Sep 2015 19:10:42 +0000 (22:10 +0300)
committerkhizmax <libcds.dev@gmail.com>
Mon, 7 Sep 2015 19:10:42 +0000 (22:10 +0300)
19 files changed:
cds/container/impl/michael_kvlist.h
projects/Win/vc12/unit-map-insdelfind.vcxproj
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_insdelfind.cpp
tests/unit/map2/map_insdelfind.h
tests/unit/map2/map_insdelfind_bronsonavltree.cpp
tests/unit/map2/map_insdelfind_cuckoo.cpp
tests/unit/map2/map_insdelfind_ellentree.cpp
tests/unit/map2/map_insdelfind_michael.cpp
tests/unit/map2/map_insdelfind_multilevelhashmap.cpp [new file with mode: 0644]
tests/unit/map2/map_insdelfind_refinable.cpp [deleted file]
tests/unit/map2/map_insdelfind_skip.cpp
tests/unit/map2/map_insdelfind_split.cpp
tests/unit/map2/map_insdelfind_std.cpp
tests/unit/map2/map_insdelfind_striped.cpp

index 229453ab6cb2a9ca5bafbeaf8e36873a8e35a4c5..dc7d4bbeb11dcb567cfd949b44e991a6ca93a720 100644 (file)
@@ -783,7 +783,7 @@ namespace cds { namespace container {
             scoped_node_ptr pNode( alloc_node( key ));
 
             std::pair<bool, bool> ret = base_class::update_at( refHead, *pNode,
-                [&f]( bool bNew, node_type& node, node_type& ){ f( bNew, node.m_Data ); }, 
+                [&f]( bool bNew, node_type& node, node_type& ){ f( bNew, node.m_Data ); },
                 bAllowInsert );
             if ( ret.first && ret.second )
                 pNode.release();
index 954e93f8a231a5cd47601af9890b1f7db173a3c9..37503239d0e1aa8e15f6ae82c0a72992e0bb9ef6 100644 (file)
@@ -48,7 +48,7 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdelfind_cuckoo.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdelfind_ellentree.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdelfind_michael.cpp" />\r
-    <ClCompile Include="..\..\..\tests\unit\map2\map_insdelfind_refinable.cpp" />\r
+    <ClCompile Include="..\..\..\tests\unit\map2\map_insdelfind_multilevelhashmap.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdelfind_skip.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdelfind_split.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdelfind_std.cpp" />\r
index 42551afba9840d116c5255418532d7e94165a1e9..f6cde97209e4fa6e00b9bfbc212cd6657cb40e45 100644 (file)
@@ -77,14 +77,14 @@ CDSUNIT_MAP_SOURCES := \
     tests/unit/map2/map_insdel_string_striped.cpp \
     tests/unit/map2/map_insdel_string_std.cpp \
     tests/unit/map2/map_insdelfind.cpp \
+    tests/unit/map2/map_insdelfind_bronsonavltree.cpp \
+    tests/unit/map2/map_insdelfind_cuckoo.cpp \
+    tests/unit/map2/map_insdelfind_ellentree.cpp \
     tests/unit/map2/map_insdelfind_michael.cpp \
-    tests/unit/map2/map_insdelfind_split.cpp \
+    tests/unit/map2/map_insdelfind_multilevelhashmap.cpp \
     tests/unit/map2/map_insdelfind_skip.cpp \
-    tests/unit/map2/map_insdelfind_ellentree.cpp \
-    tests/unit/map2/map_insdelfind_bronsonavltree.cpp \
+    tests/unit/map2/map_insdelfind_split.cpp \
     tests/unit/map2/map_insdelfind_striped.cpp \
-    tests/unit/map2/map_insdelfind_refinable.cpp \
-    tests/unit/map2/map_insdelfind_cuckoo.cpp \
     tests/unit/map2/map_insdelfind_std.cpp \
     tests/unit/map2/map_delodd.cpp \
     tests/unit/map2/map_delodd_michael.cpp \
index 7c6b8109b7e407ac8e49e997961084cadb393692..9ca66223f704582e1709a10f7ce0ef5716ba5e6b 100644 (file)
@@ -234,6 +234,14 @@ InsertPercentage=5
 DeletePercentage=5\r
 Duration=7\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_DelOdd]\r
 MapSize=50000\r
index a256c734f4b1ebf3369201effe95c3903b6612ef..4acc48427fb29716b53feaada4c7568e07b52c80 100644 (file)
@@ -232,6 +232,14 @@ InsertPercentage=5
 DeletePercentage=5\r
 Duration=15\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_DelOdd]\r
 MapSize=500000\r
index b9d2b2e984044e297de2393a76eb403b528f18af..66e994a1c6e2dba2f0aa26239a784c1e709f734c 100644 (file)
@@ -227,6 +227,15 @@ InsertPercentage=5
 DeletePercentage=5\r
 Duration=15\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
 \r
 [Map_DelOdd]\r
 MapSize=1000000\r
index 423a6d0d120ebe1f799be1788cb8290a65a951b3..02b476d9899d5ae438cd422d143b45b9c4d3934f 100644 (file)
@@ -78,14 +78,14 @@ set(CDSUNIT_MAP_SOURCES
     map_insdel_string_striped.cpp
     map_insdel_string_std.cpp
     map_insdelfind.cpp
+    map_insdelfind_bronsonavltree.cpp
+    map_insdelfind_cuckoo.cpp
+    map_insdelfind_ellentree.cpp
     map_insdelfind_michael.cpp
-    map_insdelfind_split.cpp
+    map_insdelfind_multilevelhashmap.cpp
     map_insdelfind_skip.cpp
-    map_insdelfind_ellentree.cpp
-    map_insdelfind_bronsonavltree.cpp
+    map_insdelfind_split.cpp
     map_insdelfind_striped.cpp
-    map_insdelfind_refinable.cpp
-    map_insdelfind_cuckoo.cpp
     map_insdelfind_std.cpp
     map_delodd.cpp
     map_delodd_michael.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
index cf88b9c6ca2ca8ad2472e962aa6df07dd1c577e9..e382ad2869a44a9945812bb3060bbe8d4a508b68 100644 (file)
@@ -6,20 +6,27 @@
 
 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_InsDelFind: public CppUnitMini::TestCase
     {
-        static size_t  c_nInitialMapSize;   // initial map size
-        static size_t  c_nThreadCount;      // thread count
-        static size_t  c_nMaxLoadFactor;    // maximum load factor
-        static unsigned int c_nInsertPercentage;
-        static unsigned int c_nDeletePercentage;
-        static unsigned int c_nDuration;    // test duration, seconds
-        static bool    c_bPrintGCState;
+    public:
+        size_t  c_nMapSize = 500000;          // initial map size
+        size_t  c_nThreadCount = 8;      // thread count
+        size_t  c_nMaxLoadFactor = 8;    // maximum load factor
+        unsigned int c_nInsertPercentage = 5;
+        unsigned int c_nDeletePercentage = 5;
+        unsigned int c_nDuration = 30;    // test duration, seconds
+        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_nLoadFactor = 2;  // current load factor
 
     public:
         enum actions
@@ -36,10 +43,10 @@ namespace map2 {
         typedef size_t  key_type;
         typedef size_t  value_type;
 
-        template <class MAP>
+        template <class Map>
         class WorkThread: public CppUnitMini::TestThread
         {
-            MAP&     m_Map;
+            Map&     m_Map;
 
             virtual WorkThread *    clone()
             {
@@ -54,7 +61,7 @@ namespace map2 {
             size_t  m_nFindFailed;
 
         public:
-            WorkThread( CppUnitMini::ThreadPool& pool, MAP& rMap )
+            WorkThread( CppUnitMini::ThreadPool& pool, Map& rMap )
                 : CppUnitMini::TestThread( pool )
                 , m_Map( rMap )
             {}
@@ -71,9 +78,29 @@ namespace map2 {
             virtual void init() { cds::threading::Manager::attachThread()   ; }
             virtual void fini() { cds::threading::Manager::detachThread()   ; }
 
+            typedef std::pair< key_type const, value_type > map_value_type;
+
+            struct update_functor {
+                template <typename Q>
+                void operator()( bool /*bNew*/, map_value_type& /*cur*/, Q const& /*val*/ )
+                {}
+
+                // MultiLevelHashMap
+                void operator()( map_value_type& /*cur*/, map_value_type * /*old*/)
+                {}
+
+                // MichaelMap
+                void operator()( bool /*bNew*/, map_value_type& /*cur*/ )
+                {}
+
+                // BronsonAVLTreeMap
+                void operator()( bool /*bNew*/, key_type /*key*/, value_type& /*val*/ )
+                {}
+            };
+
             virtual void test()
             {
-                MAP& rMap = m_Map;
+                Map& rMap = m_Map;
 
                 m_nInsertSuccess =
                     m_nInsertFailed =
@@ -84,7 +111,7 @@ namespace map2 {
 
                 actions * pAct = getTest().m_arrShuffle;
                 unsigned int i = 0;
-                size_t const nNormalize = size_t(-1) / (c_nInitialMapSize * 2);
+                size_t const nNormalize = size_t(-1) / (getTest().c_nMapSize * 2);
 
                 size_t nRand = 0;
                 while ( !time_elapsed() ) {
@@ -92,16 +119,24 @@ namespace map2 {
                     size_t n = nRand / nNormalize;
                     switch ( pAct[i] ) {
                     case do_find:
-                        if ( rMap.find( n ))
+                        if ( rMap.contains( n ))
                             ++m_nFindSuccess;
                         else
                             ++m_nFindFailed;
                         break;
                     case do_insert:
-                        if ( rMap.insert( n, n ))
-                            ++m_nInsertSuccess;
-                        else
-                            ++m_nInsertFailed;
+                        if ( n % 2 ) {
+                            if ( rMap.insert( n, n ))
+                                ++m_nInsertSuccess;
+                            else
+                                ++m_nInsertFailed;
+                        }
+                        else {
+                            if ( rMap.update(n, update_functor(), true ).first )
+                                ++m_nInsertSuccess;
+                            else
+                                ++m_nInsertFailed;
+                        }
                         break;
                     case do_delete:
                         if ( rMap.erase( n ))
@@ -118,23 +153,23 @@ namespace map2 {
         };
 
     protected:
-        template <class MAP>
-        void do_test( MAP& testMap )
+        template <class Map>
+        void do_test( Map& testMap )
         {
-            typedef WorkThread<MAP> work_thread;
+            typedef WorkThread<Map> work_thread;
             cds::OS::Timer    timer;
 
             // fill map - only odd number
             {
                 std::vector<size_t> arr;
-                arr.reserve( c_nInitialMapSize );
-                for ( size_t i = 0; i < c_nInitialMapSize; ++i )
+                arr.reserve( c_nMapSize );
+                for ( size_t i = 0; i < c_nMapSize; ++i )
                     arr.push_back( i * 2 + 1);
                 shuffle( arr.begin(), arr.end() );
-                for ( size_t i = 0; i < c_nInitialMapSize; ++i )
+                for ( size_t i = 0; i < c_nMapSize; ++i )
                     testMap.insert( arr[i], arr[i] );
             }
-            CPPUNIT_MSG( "   Insert " << c_nInitialMapSize << " items time (single-threaded)=" << timer.duration() );
+            CPPUNIT_MSG( "   Insert " << c_nMapSize << " items time (single-threaded)=" << timer.duration() );
 
             timer.reset();
             CppUnitMini::ThreadPool pool( *this );
@@ -186,65 +221,58 @@ namespace map2 {
             additional_cleanup( testMap );
         }
 
-        template <class MAP>
-        void test()
+        template <class Map>
+        void run_test()
         {
             CPPUNIT_MSG( "Thread count=" << c_nThreadCount
-                << " initial map size=" << c_nInitialMapSize
+                << " initial map size=" << c_nMapSize
                 << " insert=" << c_nInsertPercentage << '%'
                 << " delete=" << c_nDeletePercentage << '%'
                 << " duration=" << c_nDuration << "s"
                 );
 
-            for ( size_t nLoadFactor = 1; nLoadFactor <= c_nMaxLoadFactor; nLoadFactor *= 2 ) {
-                CPPUNIT_MSG( "Load factor=" << nLoadFactor );
-                MAP  testMap( c_nInitialMapSize, nLoadFactor );
+            if ( Map::c_bLoadFactorDepended ) {
+                for ( c_nLoadFactor = 1; c_nLoadFactor <= c_nMaxLoadFactor; c_nLoadFactor *= 2 ) {
+                    CPPUNIT_MSG( "Load factor=" << c_nLoadFactor );
+                    Map  testMap( *this );
+                    do_test( testMap );
+                    if ( c_bPrintGCState )
+                        print_gc_state();
+                }
+            }
+            else {
+                Map testMap( *this );
                 do_test( testMap );
                 if ( c_bPrintGCState )
                     print_gc_state();
             }
-
-        }
-
-        template <class MAP>
-        void test_nolf()
-        {
-            CPPUNIT_MSG( "Thread count=" << c_nThreadCount
-                << " initial map size=" << c_nInitialMapSize
-                << " insert=" << c_nInsertPercentage << '%'
-                << " delete=" << c_nDeletePercentage << '%'
-                << " duration=" << c_nDuration << "s"
-                );
-
-            MAP testMap;
-            do_test( 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_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_SkipListMap(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);
-        void run_StdMap(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
+
+        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
+        CPPUNIT_TEST_SUITE_END();
     };
 } // namespace map2
index 30f63afa28dffbc6128a464b8b95189e0d1f72bb..1fbd7fa22e437840000e4a424155ed1f64c3cbfa 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdelfind.h"
 #include "map2/map_type_bronson_avltree.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_BronsonAVLTreeMap( cc::bronson_avltree::implementation_tag, Map_InsDelFind)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDelFind::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDelFind, run_BronsonAVLTreeMap )
-        CDSUNIT_TEST_BronsonAVLTreeMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_BronsonAVLTreeMap
 } // namespace map2
index de5d5a1e91177f0d1e353b5cfcdbecee8abe1eb8..b85edaece84ddadc6f93fea32f9c0712755e7422 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdelfind.h"
 #include "map2/map_type_cuckoo.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_CuckooMap(cds::intrusive::cuckoo::implementation_tag, Map_InsDelFind)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDelFind::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDelFind, run_CuckooMap )
-        CDSUNIT_TEST_CuckooMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_CuckooMap
 } // namespace map2
index 43dc8109922c546add94539e8f7a6a49426888f2..4bc50106865dd0e77c94b8ec1f402c013b6ecd58 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdelfind.h"
 #include "map2/map_type_ellen_bintree.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_EllenBinTreeMap( cc::ellen_bintree::implementation_tag, Map_InsDelFind)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDelFind::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDelFind, run_EllenBinTreeMap )
-        CDSUNIT_TEST_EllenBinTreeMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_EllenBinTreeMap
 } // namespace map2
index 45b2589423076b499807b29e6098d74b54c53c7a..89f10646ef152e237c05e0e5855454f7b083cd76 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdelfind.h"
 #include "map2/map_type_michael.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_MichaelMap( cc::michael_map::implementation_tag, Map_InsDelFind )
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDelFind::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDelFind, run_MichaelMap )
-        CDSUNIT_TEST_MichaelMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_MichaelMap
 } // namespace map2
diff --git a/tests/unit/map2/map_insdelfind_multilevelhashmap.cpp b/tests/unit/map2/map_insdelfind_multilevelhashmap.cpp
new file mode 100644 (file)
index 0000000..3799b1c
--- /dev/null
@@ -0,0 +1,12 @@
+//$$CDS-header$$
+
+#include "map2/map_insdelfind.h"
+#include "map2/map_type_multilevel_hashmap.h"
+
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDelFind::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_insdelfind_refinable.cpp b/tests/unit/map2/map_insdelfind_refinable.cpp
deleted file mode 100644 (file)
index e6c1ae9..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-//$$CDS-header$$
-
-#include "map2/map_insdelfind.h"
-#include "map2/map_type_striped.h"
-
-namespace map2 {
-    CDSUNIT_DEFINE_RefinableMap(cc::striped_set::implementation_tag, Map_InsDelFind)
-
-    CPPUNIT_TEST_SUITE_PART( Map_InsDelFind, run_RefinableMap )
-        CDSUNIT_TEST_RefinableMap
-    CPPUNIT_TEST_SUITE_END_PART()
-} // namespace map2
index d407482e12d66acda4b39a109761d2da3d1dc628..00c9ca8bf8b6eed87ccc3adb7fbc47fcb7192d28 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdelfind.h"
 #include "map2/map_type_skip_list.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_SkipListMap( cc::skip_list::implementation_tag, Map_InsDelFind)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDelFind::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDelFind, run_SkipListMap )
-        CDSUNIT_TEST_SkipListMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_SkipListMap
 } // namespace map2
index f96c8839c5bee4d15237887d769dc8087a4a3534..70c7ab7483d942c326ad38c3b5ded92e86cd8e74 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdelfind.h"
 #include "map2/map_type_split_list.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_SplitList( cc::split_list::implementation_tag, Map_InsDelFind )
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDelFind::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDelFind, run_SplitList )
-        CDSUNIT_TEST_SplitList
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_SplitList
 } // namespace map2
index 4607f3c4384e1f6abbfd6215bbe5041f2e13353e..784fa3d95e0b4341db1186fa41445a83d562d6d2 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdelfind.h"
 #include "map2/map_type_std.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_StdMap( map2::std_implementation_tag, Map_InsDelFind)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDelFind::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDelFind, run_StdMap )
-        CDSUNIT_TEST_StdMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_StdMap
 } // namespace map2
index db8d2658c5092977924e00c311167690538c80f5..af2ee10d089b5242d875633bac5a08bb824332b8 100644 (file)
@@ -3,10 +3,11 @@
 #include "map2/map_insdelfind.h"
 #include "map2/map_type_striped.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_StripedMap(cc::striped_set::implementation_tag, Map_InsDelFind)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDelFind::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDelFind, run_StripedMap )
-        CDSUNIT_TEST_StripedMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_StripedMap
+    CDSUNIT_DECLARE_RefinableMap
 } // namespace map2