Refactored Map_InsDel_string MT-test
authorkhizmax <libcds.dev@gmail.com>
Sat, 5 Sep 2015 15:57:42 +0000 (18:57 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sat, 5 Sep 2015 15:57:42 +0000 (18:57 +0300)
20 files changed:
projects/Win/vc12/unit-map-insdel.vcxproj
projects/Win/vc12/unit-map-insdel.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_int.h
tests/unit/map2/map_insdel_string.cpp
tests/unit/map2/map_insdel_string.h
tests/unit/map2/map_insdel_string_bronsonavltree.cpp
tests/unit/map2/map_insdel_string_cuckoo.cpp
tests/unit/map2/map_insdel_string_ellentree.cpp
tests/unit/map2/map_insdel_string_michael.cpp
tests/unit/map2/map_insdel_string_multilevelhashmap.cpp [new file with mode: 0644]
tests/unit/map2/map_insdel_string_refinable.cpp [deleted file]
tests/unit/map2/map_insdel_string_skip.cpp
tests/unit/map2/map_insdel_string_split.cpp
tests/unit/map2/map_insdel_string_std.cpp
tests/unit/map2/map_insdel_string_striped.cpp

index fd0ee80b5edd9947651457d5f25ffe01da37bcf8..11d74752d672fa34a1faf32290c3a76344258755 100644 (file)
@@ -67,7 +67,7 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_string_cuckoo.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_string_ellentree.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_string_michael.cpp" />\r
-    <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_string_refinable.cpp" />\r
+    <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_string_multilevelhashmap.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_string_skip.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_string_split.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_string_std.cpp" />\r
index c22d583e44310aae9eba9f24133007f2bb9e1723..0818ac7adf028fd25aa2c420aa1da23005521582 100644 (file)
@@ -64,9 +64,6 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_string_michael.cpp">\r
       <Filter>map_insdel_string</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_string_refinable.cpp">\r
-      <Filter>map_insdel_string</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_string_skip.cpp">\r
       <Filter>map_insdel_string</Filter>\r
     </ClCompile>\r
@@ -88,6 +85,9 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_func_multilevelhashmap.cpp">\r
       <Filter>map_insdel_func</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_string_multilevelhashmap.cpp">\r
+      <Filter>map_insdel_string</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Filter Include="map_insdel_func">\r
index 2264a10a1876dde1a2dd0253abae48741dd9cc97..93749f10fca6aed3a4da5983f00b7db3509ec701 100644 (file)
@@ -59,23 +59,22 @@ CDSUNIT_MAP_SOURCES := \
     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 \
+    tests/unit/map2/map_insdel_item_string_ellentree.cpp \
     tests/unit/map2/map_insdel_item_string_michael.cpp \
-    tests/unit/map2/map_insdel_item_string_split.cpp \
     tests/unit/map2/map_insdel_item_string_skip.cpp \
-    tests/unit/map2/map_insdel_item_string_ellentree.cpp \
-    tests/unit/map2/map_insdel_item_string_bronsonavltree.cpp \
+    tests/unit/map2/map_insdel_item_string_split.cpp \
     tests/unit/map2/map_insdel_item_string_striped.cpp \
     tests/unit/map2/map_insdel_item_string_refinable.cpp \
-    tests/unit/map2/map_insdel_item_string_cuckoo.cpp \
     tests/unit/map2/map_insdel_string.cpp \
+    tests/unit/map2/map_insdel_string_bronsonavltree.cpp \
+    tests/unit/map2/map_insdel_string_cuckoo.cpp \
+    tests/unit/map2/map_insdel_string_ellentree.cpp \
     tests/unit/map2/map_insdel_string_michael.cpp \
-    tests/unit/map2/map_insdel_string_split.cpp \
     tests/unit/map2/map_insdel_string_skip.cpp \
-    tests/unit/map2/map_insdel_string_ellentree.cpp \
-    tests/unit/map2/map_insdel_string_bronsonavltree.cpp \
+    tests/unit/map2/map_insdel_string_split.cpp \
     tests/unit/map2/map_insdel_string_striped.cpp \
-    tests/unit/map2/map_insdel_string_refinable.cpp \
-    tests/unit/map2/map_insdel_string_cuckoo.cpp \
     tests/unit/map2/map_insdel_string_std.cpp \
     tests/unit/map2/map_insdelfind.cpp \
     tests/unit/map2/map_insdelfind_michael.cpp \
index 304feb9da430e53a504dcbab0812fdb78621526d..d9a924f93f1503917511975b2b1dcd5d884cf37b 100644 (file)
@@ -179,6 +179,14 @@ ThreadPassCount=8
 MapSize=10000\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_Item_string]\r
 ThreadCount=4\r
index 929420ce602de48bdfed13ffdecd385d00f4623b..27e8f23211cd66471d3f00ca4bf79e21e11f7849 100644 (file)
@@ -177,6 +177,14 @@ ThreadPassCount=2
 MapSize=100000\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_Item_string]\r
 ThreadCount=8\r
index d5be15c38ec3004dfd3de3c6658257c499b5d412..e270395179e8f890dd945ba3ba9ac2c94455b517 100644 (file)
@@ -172,6 +172,14 @@ ThreadPassCount=2
 MapSize=500000\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_Item_string]\r
 ThreadCount=8\r
index 95fc4fb58ae0c57564f7031af3ce522bc5710129..9819477477171dd3fa0d7321d7b0fe47cfdd9655 100644 (file)
@@ -69,14 +69,13 @@ set(CDSUNIT_MAP_SOURCES
     map_insdel_item_string_refinable.cpp
     map_insdel_item_string_cuckoo.cpp
     map_insdel_string.cpp
+    map_insdel_string_bronsonavltree.cpp
+    map_insdel_string_cuckoo.cpp
+    map_insdel_string_ellentree.cpp
     map_insdel_string_michael.cpp
-    map_insdel_string_split.cpp
     map_insdel_string_skip.cpp
-    map_insdel_string_ellentree.cpp
-    map_insdel_string_bronsonavltree.cpp
+    map_insdel_string_split.cpp
     map_insdel_string_striped.cpp
-    map_insdel_string_refinable.cpp
-    map_insdel_string_cuckoo.cpp
     map_insdel_string_std.cpp
     map_insdelfind.cpp
     map_insdelfind_michael.cpp
index c6130a051f147c44f0eb13de1b0c0f8856a5391d..a47738fd61eccbe8d7c7860092b224bf672e50c6 100644 (file)
@@ -270,6 +270,5 @@ namespace map2 {
             CDSUNIT_TEST_RefinableMap
             CDSUNIT_TEST_StdMap
         CPPUNIT_TEST_SUITE_END();
-
     };
 } // namespace map2
index bcfd00c0cec8e437b2ea68f32647f77d32d01906..e52c8276097551501db043acaa79e07e2fdbd841 100644 (file)
@@ -5,13 +5,6 @@
 namespace map2 {
     CPPUNIT_TEST_SUITE_REGISTRATION( Map_InsDel_string );
 
-    size_t Map_InsDel_string::c_nMapSize = 1000000;
-    size_t Map_InsDel_string::c_nInsertThreadCount = 4;
-    size_t Map_InsDel_string::c_nDeleteThreadCount = 4;
-    size_t Map_InsDel_string::c_nThreadPassCount = 4;
-    size_t Map_InsDel_string::c_nMaxLoadFactor = 8;
-    bool   Map_InsDel_string::c_bPrintGCState = true;
-
     void Map_InsDel_string::setUpParams( const CppUnitMini::TestCfg& cfg )
     {
         c_nInsertThreadCount = cfg.getSizeT("InsertThreadCount", c_nInsertThreadCount );
@@ -20,22 +13,17 @@ namespace map2 {
         c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize );
         c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor );
         c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState );
-    }
 
-    void Map_InsDel_string::myRun(const char *in_name, bool invert /*= false*/)
-    {
-        setUpParams( m_Cfg.get( "Map_InsDel_string" ));
+        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);
-        run_StdMap(in_name, invert);
+        c_nMultiLevelMap_HeadBits = cfg.getSizeT("MultiLevelMapHeadBits", c_nMultiLevelMap_HeadBits);
+        c_nMultiLevelMap_ArrayBits = cfg.getSizeT("MultiLevelMapArrayBits", c_nMultiLevelMap_ArrayBits);
 
-        endTestCase();
+        if ( c_nInsertThreadCount == 0 )
+            c_nInsertThreadCount = std::thread::hardware_concurrency();
+        if ( c_nDeleteThreadCount == 0 )
+            c_nDeleteThreadCount = std::thread::hardware_concurrency();
     }
 } // namespace map2
index d7b5096c8f96f87060784955c329d43c04f255d6..b56eaf191109d739281f7e5aab9e7cea0995a50f 100644 (file)
@@ -7,30 +7,44 @@
 
 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();
+
+//#   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)
 
     class Map_InsDel_string: public CppUnitMini::TestCase
     {
-        static size_t  c_nMapSize;            // map size
-        static size_t  c_nInsertThreadCount;  // count of insertion thread
-        static size_t  c_nDeleteThreadCount;  // count of deletion thread
-        static size_t  c_nThreadPassCount;    // pass count 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_nInsertThreadCount = 4;  // count of insertion thread
+        size_t  c_nDeleteThreadCount = 4;  // count of deletion thread
+        size_t  c_nThreadPassCount = 4;    // pass count for each thread
+        size_t  c_nMaxLoadFactor = 8;      // maximum load factor
+
+        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;
 
+        bool    c_bPrintGCState = true;
+
+        size_t  c_nLoadFactor;  // current load factor
+
+    private:
         typedef CppUnitMini::TestCase Base;
         typedef std::string key_type;
         typedef size_t      value_type;
 
         const std::vector<std::string> *  m_parrString;
 
-        template <class MAP>
+        template <class Map>
         class Inserter: public CppUnitMini::TestThread
         {
-            MAP&     m_Map;
+            Map&     m_Map;
 
             virtual Inserter *    clone()
             {
@@ -41,7 +55,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 )
             {}
@@ -60,17 +74,19 @@ namespace map2 {
 
             virtual void test()
             {
-                MAP& rMap = m_Map;
+                Map& rMap = m_Map;
 
                 m_nInsertSuccess =
                     m_nInsertFailed = 0;
 
                 const std::vector<std::string>& arrString = *getTest().m_parrString;
                 size_t nArrSize = arrString.size();
+                size_t const nMapSize = getTest().c_nMapSize;
+                size_t const nPassCount = getTest().c_nThreadPassCount;
 
                 if ( m_nThreadNo & 1 ) {
-                    for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
-                        for ( size_t nItem = 0; nItem < c_nMapSize; ++nItem ) {
+                    for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) {
+                        for ( size_t nItem = 0; nItem < nMapSize; ++nItem ) {
                             if ( rMap.insert( arrString[nItem % nArrSize], nItem * 8 ) )
                                 ++m_nInsertSuccess;
                             else
@@ -79,8 +95,8 @@ namespace map2 {
                     }
                 }
                 else {
-                    for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
-                        for ( size_t nItem = c_nMapSize; nItem > 0; --nItem ) {
+                    for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) {
+                        for ( size_t nItem = nMapSize; nItem > 0; --nItem ) {
                             if ( rMap.insert( arrString[nItem % nArrSize], nItem * 8 ) )
                                 ++m_nInsertSuccess;
                             else
@@ -91,10 +107,10 @@ namespace map2 {
             }
         };
 
-        template <class MAP>
+        template <class Map>
         class Deleter: public CppUnitMini::TestThread
         {
-            MAP&     m_Map;
+            Map&     m_Map;
 
             virtual Deleter *    clone()
             {
@@ -105,7 +121,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 )
             {}
@@ -124,17 +140,19 @@ namespace map2 {
 
             virtual void test()
             {
-                MAP& rMap = m_Map;
+                Map& rMap = m_Map;
 
                 m_nDeleteSuccess =
                     m_nDeleteFailed = 0;
 
                 const std::vector<std::string>& arrString = *getTest().m_parrString;
                 size_t nArrSize = arrString.size();
+                size_t const nMapSize = getTest().c_nMapSize;
+                size_t const nPassCount = getTest().c_nThreadPassCount;
 
                 if ( m_nThreadNo & 1 ) {
-                    for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
-                        for ( size_t nItem = 0; nItem < c_nMapSize; ++nItem ) {
+                    for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) {
+                        for ( size_t nItem = 0; nItem < nMapSize; ++nItem ) {
                             if ( rMap.erase( arrString[nItem % nArrSize] ) )
                                 ++m_nDeleteSuccess;
                             else
@@ -143,8 +161,8 @@ namespace map2 {
                     }
                 }
                 else {
-                    for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
-                        for ( size_t nItem = c_nMapSize; nItem > 0; --nItem ) {
+                    for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) {
+                        for ( size_t nItem = nMapSize; nItem > 0; --nItem ) {
                             if ( rMap.erase( arrString[nItem % nArrSize] ) )
                                 ++m_nDeleteSuccess;
                             else
@@ -157,11 +175,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;
 
             CppUnitMini::ThreadPool pool( *this );
@@ -208,8 +226,8 @@ namespace map2 {
             additional_cleanup( testMap );
         }
 
-        template <class MAP>
-        void test()
+        template <class Map>
+        void run_test()
         {
             m_parrString = &CppUnitMini::TestCase::getTestStrings();
 
@@ -219,56 +237,48 @@ namespace map2 {
                 << " map size=" << c_nMapSize
                 );
 
-            for ( size_t nLoadFactor = 1; nLoadFactor <= c_nMaxLoadFactor; nLoadFactor *= 2 ) {
-                CPPUNIT_MSG( "Load factor=" << nLoadFactor );
-                MAP  testMap( c_nMapSize, nLoadFactor );
+            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( testMap );
                 if ( c_bPrintGCState )
                     print_gc_state();
             }
         }
 
-        template <class MAP>
-        void test_nolf()
-        {
-            m_parrString = &CppUnitMini::TestCase::getTestStrings();
-
-            CPPUNIT_MSG( "Thread count: insert=" << c_nInsertThreadCount
-                << " delete=" << c_nDeleteThreadCount
-                << " pass count=" << c_nThreadPassCount
-                << " map size=" << c_nMapSize
-                );
-
-            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_string)
+            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 8ba8b414106258f40f9e52fd9240978b105ba78b..9b485aa14ea371e5a9927b1b92d978e4207aa527 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_string.h"
 #include "map2/map_type_bronson_avltree.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_BronsonAVLTreeMap( cc::bronson_avltree::implementation_tag, Map_InsDel_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_string, run_BronsonAVLTreeMap )
-        CDSUNIT_TEST_BronsonAVLTreeMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_BronsonAVLTreeMap
 } // namespace map2
index 92e8c79c34e03dbae023d4a474a05f7130288c8b..89ca6c01305fb1c62b671668bf0b8fdd4318cc42 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_string.h"
 #include "map2/map_type_cuckoo.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_CuckooMap(cds::intrusive::cuckoo::implementation_tag, Map_InsDel_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_string, run_CuckooMap )
-        CDSUNIT_TEST_CuckooMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_CuckooMap
 } // namespace map2
index cd00f031ccea9363bbd5d44f2b3f9b2b02c2d2f8..4da122c6e7a3be78ca4fc545bd25ca70f1e2f173 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_string.h"
 #include "map2/map_type_ellen_bintree.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_EllenBinTreeMap( cc::ellen_bintree::implementation_tag, Map_InsDel_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_string, run_EllenBinTreeMap )
-        CDSUNIT_TEST_EllenBinTreeMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_EllenBinTreeMap
 } // namespace map2
index 6a205ea0a17a001a0bc1ae92c83f43199786845a..513aa7905e68fee58fcc21a88d77b22fcd200536 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_string.h"
 #include "map2/map_type_michael.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_MichaelMap( cc::michael_map::implementation_tag, Map_InsDel_string )
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_string, 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_string_multilevelhashmap.cpp b/tests/unit/map2/map_insdel_string_multilevelhashmap.cpp
new file mode 100644 (file)
index 0000000..202a81d
--- /dev/null
@@ -0,0 +1,12 @@
+//$$CDS-header$$
+
+#include "map2/map_insdel_string.h"
+#include "map2/map_type_multilevel_hashmap.h"
+
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_string::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_string_refinable.cpp b/tests/unit/map2/map_insdel_string_refinable.cpp
deleted file mode 100644 (file)
index 74448fb..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-//$$CDS-header$$
-
-#include "map2/map_insdel_string.h"
-#include "map2/map_type_striped.h"
-
-namespace map2 {
-    CDSUNIT_DEFINE_RefinableMap(cc::striped_set::implementation_tag, Map_InsDel_string)
-
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_string, run_RefinableMap )
-        CDSUNIT_TEST_RefinableMap
-    CPPUNIT_TEST_SUITE_END_PART()
-} // namespace map2
index ba047749ffe61ad672f3f5b749c98f86777f9690..ac4422019e131f90a6741a8d6fc195e4cbe7306a 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_string.h"
 #include "map2/map_type_skip_list.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_SkipListMap( cc::skip_list::implementation_tag, Map_InsDel_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_string, run_SkipListMap )
-        CDSUNIT_TEST_SkipListMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_SkipListMap
 } // namespace map2
index 1ab66aae22c0f1a8c2bf4533e519cbd3cf7bab26..c14a7478087d458168d7a82379a726feff708e6b 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_string.h"
 #include "map2/map_type_split_list.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_SplitList( cc::split_list::implementation_tag, Map_InsDel_string )
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_string, run_SplitList )
-        CDSUNIT_TEST_SplitList
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_SplitList
 } // namespace map2
index 5ec096584276f894e64dd04b6466aa630023f3ba..cb64cf93d5104c095626a568ef3bc1b2070fcb4e 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_string.h"
 #include "map2/map_type_std.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_StdMap( map2::std_implementation_tag, Map_InsDel_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_string, run_StdMap )
-        CDSUNIT_TEST_StdMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_StdMap
 } // namespace map2
index f24df48680920a46d35e044bbdb893f1e5d926d0..578876082c5efc277e1b5ec9ab42dfd91e4ea35c 100644 (file)
@@ -3,10 +3,11 @@
 #include "map2/map_insdel_string.h"
 #include "map2/map_type_striped.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_StripedMap(cc::striped_set::implementation_tag, Map_InsDel_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_string, run_StripedMap )
-        CDSUNIT_TEST_StripedMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_StripedMap
+    CDSUNIT_DECLARE_RefinableMap
 } // namespace map2