Refactored Map_find_string MT-test
authorkhizmax <libcds.dev@gmail.com>
Sun, 6 Sep 2015 09:26:33 +0000 (12:26 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sun, 6 Sep 2015 09:26:33 +0000 (12:26 +0300)
19 files changed:
projects/Win/vc12/unit-map-find.vcxproj
projects/Win/vc12/unit-map-find.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_find_string.cpp
tests/unit/map2/map_find_string.h
tests/unit/map2/map_find_string_bronsonavltree.cpp
tests/unit/map2/map_find_string_cuckoo.cpp
tests/unit/map2/map_find_string_ellentree.cpp
tests/unit/map2/map_find_string_michael.cpp
tests/unit/map2/map_find_string_multilevelhashmap.cpp [new file with mode: 0644]
tests/unit/map2/map_find_string_refinable.cpp [deleted file]
tests/unit/map2/map_find_string_skip.cpp
tests/unit/map2/map_find_string_split.cpp
tests/unit/map2/map_find_string_std.cpp
tests/unit/map2/map_find_string_striped.cpp

index ec8ae23ccc26ebe09a7c692979986aaaef95b3de..9c527b7a0941a611c93860d7eca6a683afa1bfb2 100644 (file)
@@ -58,7 +58,7 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_find_string_cuckoo.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_find_string_ellentree.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_find_string_michael.cpp" />\r
-    <ClCompile Include="..\..\..\tests\unit\map2\map_find_string_refinable.cpp" />\r
+    <ClCompile Include="..\..\..\tests\unit\map2\map_find_string_multilevelhashmap.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_find_string_skip.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_find_string_split.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_find_string_std.cpp" />\r
index ff0be0d87ff5244c9f042b1ebff08404292f80db..490f3fd6bbd134933e41bdb568ec73de70268708 100644 (file)
@@ -43,9 +43,6 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_find_string_michael.cpp">\r
       <Filter>map_find_string</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\tests\unit\map2\map_find_string_refinable.cpp">\r
-      <Filter>map_find_string</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_find_string_skip.cpp">\r
       <Filter>map_find_string</Filter>\r
     </ClCompile>\r
@@ -73,9 +70,6 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_insfind_int_michael.cpp">\r
       <Filter>map_insfind_int</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\tests\unit\map2\map_insfind_int_refinable.cpp">\r
-      <Filter>map_insfind_int</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insfind_int_skip.cpp">\r
       <Filter>map_insfind_int</Filter>\r
     </ClCompile>\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_find_int_multilevelhashmap.cpp">\r
       <Filter>map_find_int</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\..\..\tests\unit\map2\map_insfind_int_refinable.cpp">\r
+      <Filter>map_insfind_int</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\tests\unit\map2\map_find_string_multilevelhashmap.cpp">\r
+      <Filter>map_find_string</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\..\..\tests\unit\map2\map_find_int.h">\r
index 953e74ee5d13225d5201451673810de679bce5e5..80dc4804eb534717425ee429af22ed51dc06052b 100644 (file)
@@ -15,10 +15,10 @@ CDSUNIT_MAP_SOURCES := \
     tests/unit/map2/map_find_string_cuckoo.cpp \
     tests/unit/map2/map_find_string_ellentree.cpp \
     tests/unit/map2/map_find_string_michael.cpp \
+    tests/unit/map2/map_find_string_multilevelhashmap.cpp \
     tests/unit/map2/map_find_string_skip.cpp \
     tests/unit/map2/map_find_string_split.cpp \
     tests/unit/map2/map_find_string_striped.cpp \
-    tests/unit/map2/map_find_string_refinable.cpp \
     tests/unit/map2/map_find_string_std.cpp \
     tests/unit/map2/map_insfind_int.cpp \
     tests/unit/map2/map_insfind_int_bronsonavltree.cpp \
index d9a924f93f1503917511975b2b1dcd5d884cf37b..bf2a6506dd656c4f99e4d916ca062b08cf1d60ac 100644 (file)
@@ -122,6 +122,14 @@ PercentExists=50
 PassCount=2\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_find_string]\r
 ThreadCount=2\r
@@ -130,6 +138,14 @@ PercentExists=50
 PassCount=2\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_int]\r
 InsertThreadCount=4\r
index 27e8f23211cd66471d3f00ca4bf79e21e11f7849..3a533135f1df9300dd5c46d3a1fda7f789f37a76 100644 (file)
@@ -120,6 +120,14 @@ PercentExists=50
 PassCount=2\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_find_string]\r
 ThreadCount=8\r
@@ -128,6 +136,14 @@ PercentExists=50
 PassCount=2\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_int]\r
 InsertThreadCount=4\r
index e270395179e8f890dd945ba3ba9ac2c94455b517..d65bd7131d793a835034c3f58a27c40c318ef423 100644 (file)
@@ -115,6 +115,14 @@ PercentExists=50
 PassCount=1\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_find_string]\r
 ThreadCount=8\r
@@ -123,6 +131,14 @@ PercentExists=50
 PassCount=1\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_int]\r
 InsertThreadCount=4\r
index 1e87f1ac9c1a6afdd713d4adc825d9c131e0c634..bc30418f0ed69106723e68ddee92f46ad560b9a4 100644 (file)
@@ -16,10 +16,10 @@ set(CDSUNIT_MAP_SOURCES
     map_find_string_cuckoo.cpp
     map_find_string_ellentree.cpp
     map_find_string_michael.cpp
+    map_find_string_multilevelhashmap.cpp
     map_find_string_skip.cpp
     map_find_string_split.cpp
     map_find_string_striped.cpp
-    map_find_string_refinable.cpp
     map_find_string_std.cpp
     map_insfind_int.cpp
     map_insfind_int_bronsonavltree.cpp
index c0629f434e929034987c2ce9e8bf67c9d67ccc8c..6ccadef365cf1a2b692a3649cecb2a164888bb33 100644 (file)
@@ -5,13 +5,6 @@
 namespace map2 {
     CPPUNIT_TEST_SUITE_REGISTRATION( Map_find_string );
 
-    size_t Map_find_string::c_nThreadCount = 8      ;  // thread count
-    size_t Map_find_string::c_nMapSize = 20000000   ;  // map size (count of searching item)
-    size_t Map_find_string::c_nPercentExists = 50   ;  // percent of existing keys in searching sequence
-    size_t Map_find_string::c_nPassCount = 2;
-    size_t Map_find_string::c_nMaxLoadFactor = 8    ;  // maximum load factor
-    bool   Map_find_string::c_bPrintGCState = true;
-
     void Map_find_string::generateSequence()
     {
         size_t nPercent = c_nPercentExists;
@@ -21,59 +14,47 @@ namespace map2 {
         else if ( nPercent < 1 )
             nPercent = 1;
 
-        m_nRealMapSize = 0;
-
-        std::vector<std::string> const & arrString = CppUnitMini::TestCase::getTestStrings();
+        std::vector<std::string> const& arrString = CppUnitMini::TestCase::getTestStrings();
         size_t nSize = arrString.size();
         if ( nSize > c_nMapSize )
             nSize = c_nMapSize;
         m_Arr.resize( nSize );
+
+        nSize = 0;
         for ( size_t i = 0; i < nSize; ++i ) {
             m_Arr[i].pKey = &( arrString[i] );
             m_Arr[i].bExists = CppUnitMini::Rand( 100 ) <= nPercent;
             if ( m_Arr[i].bExists )
-                ++m_nRealMapSize;
-        }
-    }
-
-    void Map_find_string::initTestSequence()
-    {
-        if ( !m_bSeqInit ) {
-            m_bSeqInit = true;
-
-            CPPUNIT_MSG( "Generating test data...");
-            cds::OS::Timer    timer;
-            generateSequence();
-            CPPUNIT_MSG( "   Duration=" << timer.duration() );
-            CPPUNIT_MSG( "Map size=" << m_nRealMapSize << " find key loop=" << m_Arr.size() << " (" << c_nPercentExists << "% success)" );
-            CPPUNIT_MSG( "Thread count=" << c_nThreadCount << " Pass count=" << c_nPassCount );
+                ++nSize;
         }
+        c_nMapSize = nSize;
     }
 
     void Map_find_string::setUpParams( const CppUnitMini::TestCfg& cfg )
     {
         c_nThreadCount = cfg.getSizeT("ThreadCount", c_nThreadCount );
-        c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize );
-        c_nPercentExists = cfg.getSizeT("PercentExists", c_nPercentExists );
-        c_nPassCount = cfg.getSizeT("PassCount", c_nPassCount );
-        c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor );
-        c_bPrintGCState = cfg.getBool("PrintGCStateFlag", true );
-    }
+        c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize);
+        c_nPercentExists = cfg.getSizeT("PercentExists", c_nPercentExists);
+        c_nPassCount = cfg.getSizeT("PassCount", c_nPassCount);
+        c_nMaxLoadFactor = cfg.getSizeT("MaxLoadFactor", c_nMaxLoadFactor);
+        c_bPrintGCState = cfg.getBool("PrintGCStateFlag", c_bPrintGCState );
 
-    void Map_find_string::myRun(const char *in_name, bool invert /*= false*/)
-    {
-        setUpParams( m_Cfg.get( "Map_find_string" ));
+        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 = std::thread::hardware_concurrency();
 
-        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);
+        CPPUNIT_MSG( "Generating test data...");
+        cds::OS::Timer    timer;
+        generateSequence();
+        CPPUNIT_MSG( "   Duration=" << timer.duration() );
+        CPPUNIT_MSG( "Map size=" << c_nMapSize << " find key loop=" << m_Arr.size() << " (" << c_nPercentExists << "% success)" );
+        CPPUNIT_MSG( "Thread count=" << c_nThreadCount << " Pass count=" << c_nPassCount );
 
-        endTestCase();
     }
 } // namespace map2
index 31d3fe43dbdd480936dee55db70d6a69a04daa02..bb0510532e2c06f2ed78876de60b30f2f0135779 100644 (file)
@@ -7,20 +7,28 @@
 
 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_find_string: public CppUnitMini::TestCase
     {
-        static size_t  c_nThreadCount;      // thread count
-        static size_t  c_nMapSize;          // map size (count of searching item)
-        static size_t  c_nPercentExists;    // percent of existing keys in searching sequence
-        static size_t  c_nPassCount;
-        static size_t  c_nMaxLoadFactor;    // maximum load factor
-        static bool    c_bPrintGCState;
+    public:
+        size_t c_nThreadCount = 8;     // thread count
+        size_t c_nMapSize = 10000000;  // map size (count of searching item)
+        size_t c_nPercentExists = 50;  // percent of existing keys in searching sequence
+        size_t c_nPassCount = 2;
+        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_nLoadFactor;  // current load factor
+
+    private:
         typedef CppUnitMini::TestCase Base;
         typedef std::string  key_type;
         struct value_type {
@@ -30,8 +38,6 @@ namespace map2 {
 
         typedef std::vector<value_type> ValueVector;
         ValueVector             m_Arr;
-        size_t                  m_nRealMapSize;
-        bool                    m_bSeqInit;
 
         template <typename Iterator, typename Map>
         static bool check_result( Iterator const& it, Map const& map )
@@ -44,10 +50,10 @@ namespace map2 {
             return b;
         }
 
-        template <class MAP>
+        template <class Map>
         class TestThread: public CppUnitMini::TestThread
         {
-            MAP&     m_Map;
+            Map&     m_Map;
 
             virtual TestThread *    clone()
             {
@@ -68,7 +74,7 @@ namespace map2 {
             Stat    m_KeyNotExists;
 
         public:
-            TestThread( CppUnitMini::ThreadPool& pool, MAP& rMap )
+            TestThread( CppUnitMini::ThreadPool& pool, Map& rMap )
                 : CppUnitMini::TestThread( pool )
                 , m_Map( rMap )
             {}
@@ -88,14 +94,14 @@ namespace map2 {
             virtual void test()
             {
                 ValueVector& arr = getTest().m_Arr;
-                //size_t nSize = arr.size();
+                size_t const nPassCount = getTest().c_nPassCount;
 
-                MAP& rMap = m_Map;
-                for ( size_t nPass = 0; nPass < c_nPassCount; ++nPass ) {
+                Map& rMap = m_Map;
+                for ( size_t nPass = 0; nPass < nPassCount; ++nPass ) {
                     if ( m_nThreadNo & 1 ) {
                         ValueVector::const_iterator itEnd = arr.end();
                         for ( ValueVector::const_iterator it = arr.begin(); it != itEnd; ++it ) {
-                            auto bFound = rMap.find( *(it->pKey) );
+                            auto bFound = rMap.contains( *(it->pKey) );
                             if ( it->bExists ) {
                                 if ( check_result(bFound, rMap))
                                     ++m_KeyExists.nSuccess;
@@ -113,7 +119,7 @@ namespace map2 {
                     else {
                         ValueVector::const_reverse_iterator itEnd = arr.rend();
                         for ( ValueVector::const_reverse_iterator it = arr.rbegin(); it != itEnd; ++it ) {
-                            auto bFound = rMap.find( *(it->pKey) );
+                            auto bFound = rMap.contains( *(it->pKey) );
                             if ( it->bExists ) {
                                 if ( check_result(bFound, rMap))
                                     ++m_KeyExists.nSuccess;
@@ -134,17 +140,17 @@ namespace map2 {
 
     public:
         Map_find_string()
-            : m_bSeqInit( false )
+            : c_nLoadFactor( 2 )
         {}
 
     protected:
 
         void generateSequence();
 
-        template <class MAP>
-        void find_string_test( MAP& testMap )
+        template <class Map>
+        void find_string_test( Map& testMap )
         {
-            typedef TestThread<MAP>     Thread;
+            typedef TestThread<Map>     Thread;
             cds::OS::Timer    timer;
 
             // Fill the map
@@ -166,9 +172,9 @@ namespace map2 {
             // Postcondition: the number of success searching == the number of map item
             for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) {
                 Thread * pThread = static_cast<Thread *>( *it );
-                CPPUNIT_CHECK( pThread->m_KeyExists.nSuccess == m_nRealMapSize * c_nPassCount );
+                CPPUNIT_CHECK( pThread->m_KeyExists.nSuccess == c_nMapSize * c_nPassCount );
                 CPPUNIT_CHECK( pThread->m_KeyExists.nFailed == 0 );
-                CPPUNIT_CHECK( pThread->m_KeyNotExists.nSuccess == (m_Arr.size() - m_nRealMapSize) * c_nPassCount );
+                CPPUNIT_CHECK( pThread->m_KeyNotExists.nSuccess == (m_Arr.size() - c_nMapSize) * c_nPassCount );
                 CPPUNIT_CHECK( pThread->m_KeyNotExists.nFailed == 0 );
             }
 
@@ -180,28 +186,32 @@ namespace map2 {
             additional_cleanup( testMap );
         }
 
-        void initTestSequence();
-
-        template <class MAP>
-        void test()
+        template <class Map>
+        void run_test()
         {
-            initTestSequence();
-
-            for ( size_t nLoadFactor = 1; nLoadFactor <= c_nMaxLoadFactor; nLoadFactor *= 2 ) {
-                CPPUNIT_MSG( "Load factor=" << nLoadFactor );
-                MAP  testMap( m_Arr.size(), nLoadFactor );
+            if ( Map::c_bLoadFactorDepended ) {
+                for ( size_t nLoadFactor = 1; nLoadFactor <= c_nMaxLoadFactor; nLoadFactor *= 2 ) {
+                    CPPUNIT_MSG( "Load factor=" << nLoadFactor );
+                    Map testMap( *this );
+                    find_string_test( testMap );
+                    if ( c_bPrintGCState )
+                        print_gc_state();
+                }
+            }
+            else {
+                Map testMap( *this );
                 find_string_test( testMap );
                 if ( c_bPrintGCState )
                     print_gc_state();
             }
         }
 
-        template <class MAP>
+        template <class Map>
         void test_nolf()
         {
             initTestSequence();
 
-            MAP testMap;
+            Map testMap;
             find_string_test( testMap );
             if ( c_bPrintGCState )
                 print_gc_state();
@@ -209,19 +219,6 @@ namespace map2 {
 
         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_MichaelMap_nogc
@@ -231,9 +228,28 @@ namespace map2 {
         CDSUNIT_DECLARE_SkipListMap_nogc
         CDSUNIT_DECLARE_EllenBinTreeMap
         CDSUNIT_DECLARE_BronsonAVLTreeMap
+        CDSUNIT_DECLARE_MultiLevelHashMap
         CDSUNIT_DECLARE_StripedMap
         CDSUNIT_DECLARE_RefinableMap
         CDSUNIT_DECLARE_CuckooMap
         CDSUNIT_DECLARE_StdMap
+        CDSUNIT_DECLARE_StdMap_NoLock
+
+        CPPUNIT_TEST_SUITE(Map_find_string)
+            CDSUNIT_TEST_MichaelMap
+            CDSUNIT_TEST_MichaelMap_nogc
+            CDSUNIT_TEST_SplitList
+            CDSUNIT_TEST_SplitList_nogc
+            CDSUNIT_TEST_SkipListMap
+            CDSUNIT_TEST_SkipListMap_nogc
+            CDSUNIT_TEST_EllenBinTreeMap
+            CDSUNIT_TEST_BronsonAVLTreeMap
+            CDSUNIT_TEST_MultiLevelHashMap
+            CDSUNIT_TEST_CuckooMap
+            CDSUNIT_TEST_StripedMap
+            CDSUNIT_TEST_RefinableMap
+            CDSUNIT_TEST_StdMap
+            CDSUNIT_TEST_StdMap_NoLock
+        CPPUNIT_TEST_SUITE_END();
     };
 } // namespace map2
index 5f4fb3c501978a3bc2d8affd0e1a9b1b2d082af4..dac0690f23059e2ea99fca74e5c22559d05939dd 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_find_string.h"
 #include "map2/map_type_bronson_avltree.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_BronsonAVLTreeMap( cc::bronson_avltree::implementation_tag, Map_find_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_find_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_find_string, run_BronsonAVLTreeMap )
-        CDSUNIT_TEST_BronsonAVLTreeMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_BronsonAVLTreeMap
 } // namespace map2
index 6bb731587312863aad8bda4ae1c3b1a21a604ba6..4f419f5a97a69c738f2f8b84cd418c0ccf193909 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_find_string.h"
 #include "map2/map_type_cuckoo.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_CuckooMap(cds::intrusive::cuckoo::implementation_tag, Map_find_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_find_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_find_string, run_CuckooMap )
-        CDSUNIT_TEST_CuckooMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_CuckooMap
 } // namespace map2
index 6dfe517244d7c911bea2088dab9780cdf5c039a4..5888ccd733f0019c324392baf669e58ba98157cb 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_find_string.h"
 #include "map2/map_type_ellen_bintree.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_EllenBinTreeMap( cc::ellen_bintree::implementation_tag, Map_find_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_find_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_find_string, run_EllenBinTreeMap )
-        CDSUNIT_TEST_EllenBinTreeMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_EllenBinTreeMap
 } // namespace map2
index 9cb59f5097a47fdcc04a92443e592ef8677ff330..399b73f78227bb3f88456f4755632c757b7d789e 100644 (file)
@@ -3,12 +3,11 @@
 #include "map2/map_find_string.h"
 #include "map2/map_type_michael.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_MichaelMap( cc::michael_map::implementation_tag, Map_find_string )
-    CDSUNIT_DEFINE_MichaelMap_nogc( cc::michael_map::implementation_tag, Map_find_string )
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_find_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_find_string, run_MichaelMap )
-        CDSUNIT_TEST_MichaelMap
-        CDSUNIT_TEST_MichaelMap_nogc
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_MichaelMap
+    CDSUNIT_DECLARE_MichaelMap_nogc
 } // namespace map2
diff --git a/tests/unit/map2/map_find_string_multilevelhashmap.cpp b/tests/unit/map2/map_find_string_multilevelhashmap.cpp
new file mode 100644 (file)
index 0000000..e7eb41a
--- /dev/null
@@ -0,0 +1,12 @@
+//$$CDS-header$$
+
+#include "map2/map_find_string.h"
+#include "map2/map_type_multilevel_hashmap.h"
+
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_find_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_find_string_refinable.cpp b/tests/unit/map2/map_find_string_refinable.cpp
deleted file mode 100644 (file)
index 3f708ed..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-//$$CDS-header$$
-
-#include "map2/map_find_string.h"
-#include "map2/map_type_striped.h"
-
-namespace map2 {
-    CDSUNIT_DEFINE_RefinableMap(cc::striped_set::implementation_tag, Map_find_string)
-
-    CPPUNIT_TEST_SUITE_PART( Map_find_string, run_RefinableMap )
-        CDSUNIT_TEST_RefinableMap
-    CPPUNIT_TEST_SUITE_END_PART()
-} // namespace map2
index ae9f27fa087e8b5a14fdf3863e96d5629183ac02..92443b396b4b8c8aaab49718a84437a373050b33 100644 (file)
@@ -3,12 +3,11 @@
 #include "map2/map_find_string.h"
 #include "map2/map_type_skip_list.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_SkipListMap( cc::skip_list::implementation_tag, Map_find_string)
-    CDSUNIT_DEFINE_SkipListMap_nogc( cc::skip_list::implementation_tag, Map_find_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_find_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_find_string, run_SkipListMap )
-        CDSUNIT_TEST_SkipListMap
-        CDSUNIT_TEST_SkipListMap_nogc
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_SkipListMap
+    CDSUNIT_DECLARE_SkipListMap_nogc
 } // namespace map2
index ee236aa56f160692869145978cd9fd22f105986f..0ce0f88245d1480999ba832b3b228d69f742352e 100644 (file)
@@ -3,12 +3,11 @@
 #include "map2/map_find_string.h"
 #include "map2/map_type_split_list.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_SplitList( cc::split_list::implementation_tag, Map_find_string )
-    CDSUNIT_DEFINE_SplitList_nogc( cc::split_list::implementation_tag, Map_find_string )
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_find_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_find_string, run_SplitList )
-        CDSUNIT_TEST_SplitList
-        CDSUNIT_TEST_SplitList_nogc
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_SplitList
+    CDSUNIT_DECLARE_SplitList_nogc
 } // namespace map2
index 6f2a645cfb121064c9c46c1ae530b7b0cb5038de..b148617f49caa5152e38fdd8be098af268ad167d 100644 (file)
@@ -3,10 +3,11 @@
 #include "map2/map_find_string.h"
 #include "map2/map_type_std.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_StdMap( map2::std_implementation_tag, Map_find_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_find_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_find_string, run_StdMap )
-        CDSUNIT_TEST_StdMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_StdMap
+    CDSUNIT_DECLARE_StdMap_NoLock
 } // namespace map2
index afba7b6722ab01b4d152fa5227947c39ad51d655..c0188ba69f15d5679cc1fbd88fae421b9c044fdb 100644 (file)
@@ -3,10 +3,11 @@
 #include "map2/map_find_string.h"
 #include "map2/map_type_striped.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_StripedMap(cc::striped_set::implementation_tag, Map_find_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_find_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_find_string, run_StripedMap )
-        CDSUNIT_TEST_StripedMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_StripedMap
+    CDSUNIT_DECLARE_RefinableMap
 } // namespace map2