Refactored Map_InsDel_Item_string MT-test
authorkhizmax <libcds.dev@gmail.com>
Mon, 7 Sep 2015 20:12:10 +0000 (23:12 +0300)
committerkhizmax <libcds.dev@gmail.com>
Mon, 7 Sep 2015 20:12:10 +0000 (23:12 +0300)
19 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.h
tests/unit/map2/map_insdel_item_string.cpp
tests/unit/map2/map_insdel_item_string.h
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_multilevelhashmap.cpp [new file with mode: 0644]
tests/unit/map2/map_insdel_item_string_refinable.cpp [deleted file]
tests/unit/map2/map_insdel_item_string_skip.cpp
tests/unit/map2/map_insdel_item_string_split.cpp
tests/unit/map2/map_insdel_item_string_striped.cpp

index 3b511b94f483b0d4d594e53d165bac1fa319253c..cdcd25db9cb2f00fc0038a051531aec91636a7af 100644 (file)
@@ -57,7 +57,7 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_string_cuckoo.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_string_ellentree.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_string_michael.cpp" />\r
-    <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_string_refinable.cpp" />\r
+    <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_string_multilevelhashmap.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_string_skip.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_string_split.cpp" />\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_string_striped.cpp" />\r
index 6c28496df5a460decc23f9ab9826e33ebc10fee5..5aa2b21ba868184385a7842e668a4001cbdf0b23 100644 (file)
@@ -48,9 +48,6 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_string_michael.cpp">\r
       <Filter>map_insdel_item_string</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_string_refinable.cpp">\r
-      <Filter>map_insdel_item_string</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_string_skip.cpp">\r
       <Filter>map_insdel_item_string</Filter>\r
     </ClCompile>\r
@@ -63,6 +60,9 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_int_multilevelhashmap.cpp">\r
       <Filter>map_insdel_item_int</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\..\..\tests\unit\map2\map_insdel_item_string_multilevelhashmap.cpp">\r
+      <Filter>map_insdel_item_string</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\..\..\tests\unit\map2\map_insdel_item_int.h">\r
index 15c35b5dc4ed2b563edb933cff25cdb06aa34a96..33ff37f527f7dcb3d0dbe82ef00f94c373715f76 100644 (file)
@@ -66,7 +66,6 @@ CDSUNIT_MAP_SOURCES := \
     tests/unit/map2/map_insdel_item_string_skip.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_string.cpp \
     tests/unit/map2/map_insdel_string_bronsonavltree.cpp \
     tests/unit/map2/map_insdel_string_cuckoo.cpp \
index 96a984334ed236c6cc13098702659672cda9bf48..85f686561b4badd607678a5e93685c7352ef3a9a 100644 (file)
@@ -219,6 +219,14 @@ GoalItemIndex=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_InsFind_int]\r
 ThreadCount=0\r
index 58547eadbb3cf5148e83fe758250326f1cdbe450..349ff184aa29c83bdbb42e07f5e83643036dc83e 100644 (file)
@@ -217,6 +217,14 @@ GoalItemIndex=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_InsFind_int]\r
 ThreadCount=0\r
index 1a0bccbbcca0560ac620a17d2ed247c3a16ccf83..5dcb208664532cd91710130beaec4f9ca82158e9 100644 (file)
@@ -212,6 +212,14 @@ GoalItemIndex=250000
 AttemptCount=500\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_InsFind_int]\r
 ThreadCount=0\r
index d449b989a9266345c655e18bd974534f5ab71127..1a51a7652701cc47687ba33834ebe4fed388e36f 100644 (file)
@@ -60,14 +60,13 @@ set(CDSUNIT_MAP_SOURCES
     map_insdel_item_int_split.cpp
     map_insdel_item_int_striped.cpp
     map_insdel_item_string.cpp
+    map_insdel_item_string_bronsonavltree.cpp
+    map_insdel_item_string_cuckoo.cpp
+    map_insdel_item_string_ellentree.cpp
     map_insdel_item_string_michael.cpp
-    map_insdel_item_string_split.cpp
     map_insdel_item_string_skip.cpp
-    map_insdel_item_string_ellentree.cpp
-    map_insdel_item_string_bronsonavltree.cpp
+    map_insdel_item_string_split.cpp
     map_insdel_item_string_striped.cpp
-    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
index a18bdca914137f7c175199554579860a54894001..1578495044025bcee21d390e62a881fec2858f7c 100644 (file)
@@ -12,14 +12,14 @@ namespace map2 {
     class Map_InsDel_Item_int: public CppUnitMini::TestCase
     {
     public:
-        size_t  c_nMapSize = 1000000;        // map size
-        size_t  c_nThreadCount = 4;    // thread count
+        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
+        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_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;
@@ -253,8 +253,8 @@ namespace map2 {
         void run_test()
         {
             if ( Map::c_bLoadFactorDepended ) {
-                for ( size_t nLoadFactor = 1; nLoadFactor <= c_nMaxLoadFactor; nLoadFactor *= 2 ) {
-                    CPPUNIT_MSG( "Load factor=" << nLoadFactor );
+                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 )
@@ -283,7 +283,7 @@ namespace map2 {
         CDSUNIT_DECLARE_CuckooMap
         // CDSUNIT_DECLARE_StdMap // very slow!!
 
-        CPPUNIT_TEST_SUITE(Map_InsDel_int)
+        CPPUNIT_TEST_SUITE(Map_InsDel_Item_int)
             CDSUNIT_TEST_MichaelMap
             CDSUNIT_TEST_SplitList
             CDSUNIT_TEST_SkipListMap
index 09980ce8d05a27f96f4fc82a050593c68affc20d..a8c125be3366001f4fc2b630700c305c6b083599 100644 (file)
@@ -5,36 +5,23 @@
 namespace map2 {
     CPPUNIT_TEST_SUITE_REGISTRATION( Map_InsDel_Item_string );
 
-    size_t Map_InsDel_Item_string::c_nMapSize = 1000000;
-    size_t Map_InsDel_Item_string::c_nThreadCount = 4;
-    size_t Map_InsDel_Item_string::c_nGoalItem = c_nMapSize / 2;
-    size_t Map_InsDel_Item_string::c_nAttemptCount = 100000;
-    size_t Map_InsDel_Item_string::c_nMaxLoadFactor = 8;
-    bool   Map_InsDel_Item_string::c_bPrintGCState = true;
-
     void Map_InsDel_Item_string::setUpParams( const CppUnitMini::TestCfg& cfg )
     {
         c_nThreadCount = cfg.getSizeT("ThreadCount", c_nThreadCount );
         c_nMapSize = cfg.getSizeT("MapSize", c_nMapSize );
-        c_nGoalItem = cfg.getSizeT("GoalItemIndex", 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_string::myRun(const char *in_name, bool invert /*= false*/)
-    {
-        setUpParams( m_Cfg.get( "Map_InsDel_Item_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);
+        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 532ab5c4652798a2840eaed46f43376388d59c92..7156d54da3bd60ab1a43e42f0d24cc24ff639dcf 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_InsDel_Item_string: 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 std::string  key_type;
         typedef size_t  value_type;
@@ -65,10 +73,11 @@ namespace map2 {
                 m_nInsertSuccess =
                     m_nInsertFailed = 0;
 
-                size_t nGoalItem = c_nGoalItem;
+                size_t nGoalItem = getTest().c_nGoalItem;
                 std::string strGoal = (*getTest().m_parrString)[nGoalItem];
+                size_t const nAttemptCount = getTest().c_nAttemptCount;
 
-                for ( size_t nAttempt = 0; nAttempt < c_nAttemptCount; ) {
+                for ( size_t nAttempt = 0; nAttempt < nAttemptCount; ) {
                     if ( rMap.insert( strGoal, nGoalItem )) {
                         ++m_nInsertSuccess;
                         ++nAttempt;
@@ -134,10 +143,11 @@ namespace map2 {
                 m_nDeleteSuccess =
                     m_nDeleteFailed = 0;
 
-                size_t nGoalItem = c_nGoalItem;
+                size_t nGoalItem = getTest().c_nGoalItem;
                 std::string strGoal = (*getTest().m_parrString)[nGoalItem];
+                size_t const nAttemptCount = getTest().c_nAttemptCount;
 
-                for ( size_t nAttempt = 0; nAttempt < c_nAttemptCount; ) {
+                for ( size_t nAttempt = 0; nAttempt < nAttemptCount; ) {
                     if ( rMap.erase( strGoal, erase_cleaner() )) {
                         ++m_nDeleteSuccess;
                         ++nAttempt;
@@ -197,7 +207,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( (*m_parrString)[i] ), "Key \"" << (*m_parrString)[i] << "\" not found" );
+                CPPUNIT_CHECK_EX( testMap.contains( (*m_parrString)[i] ), "Key \"" << (*m_parrString)[i] << "\" not found" );
             }
             CPPUNIT_MSG( "    Duration=" << timer.duration() );
 
@@ -210,7 +220,7 @@ namespace map2 {
         }
 
         template <class Map>
-        void test()
+        void run_test()
         {
             m_parrString = &CppUnitMini::TestCase::getTestStrings();
             if ( c_nMapSize > m_parrString->size() )
@@ -223,57 +233,49 @@ 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 ( 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 <typename Map>
-        void test_nolf()
-        {
-            m_parrString = &CppUnitMini::TestCase::getTestStrings();
-            if ( c_nMapSize > m_parrString->size() )
-                c_nMapSize = m_parrString->size();
-            if ( c_nGoalItem > m_parrString->size() )
-                c_nGoalItem = m_parrString->size() / 2;
-
-            CPPUNIT_MSG( "Thread count= " << c_nThreadCount
-                << " pass count=" << c_nAttemptCount
-                << " 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_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_Item_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 // very slow!!
+        CPPUNIT_TEST_SUITE_END();
+
     };
 } // namespace map2
index 3e159558b15feb72484aefbb35f1b945c1f80d9d..2286482cf9bf76808e82e9c41f14fd30cde395f4 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_item_string.h"
 #include "map2/map_type_bronson_avltree.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_BronsonAVLTreeMap( cc::bronson_avltree::implementation_tag, Map_InsDel_Item_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_string, run_BronsonAVLTreeMap )
-        CDSUNIT_TEST_BronsonAVLTreeMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_BronsonAVLTreeMap
 } // namespace map2
index e05b60697ce5f0a64416cfd8328aa65208828e18..85caf711755db3b53ef0cc031a53f76f513cb3a6 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_item_string.h"
 #include "map2/map_type_cuckoo.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_CuckooMap(cds::intrusive::cuckoo::implementation_tag, Map_InsDel_Item_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_string, run_CuckooMap )
-        CDSUNIT_TEST_CuckooMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_CuckooMap
 } // namespace map2
index 1ab799517e0f333bab29094275553027df8a74e2..243fcdae959e6a3d08ee5234af8090fe58a43d3a 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_item_string.h"
 #include "map2/map_type_ellen_bintree.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_EllenBinTreeMap( cc::ellen_bintree::implementation_tag, Map_InsDel_Item_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_string, run_EllenBinTreeMap )
-        CDSUNIT_TEST_EllenBinTreeMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_EllenBinTreeMap
 } // namespace map2
index 3e35739a0e9a9a4c60771a619def435f2711d1d6..eee9bc9c9d1e39c5f89b4c919312435e55520676 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_item_string.h"
 #include "map2/map_type_michael.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_MichaelMap( cc::michael_map::implementation_tag, Map_InsDel_Item_string )
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_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_item_string_multilevelhashmap.cpp b/tests/unit/map2/map_insdel_item_string_multilevelhashmap.cpp
new file mode 100644 (file)
index 0000000..c23e967
--- /dev/null
@@ -0,0 +1,12 @@
+//$$CDS-header$$
+
+#include "map2/map_insdel_item_string.h"
+#include "map2/map_type_multilevel_hashmap.h"
+
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_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_item_string_refinable.cpp b/tests/unit/map2/map_insdel_item_string_refinable.cpp
deleted file mode 100644 (file)
index 44bac2d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-//$$CDS-header$$
-
-#include "map2/map_insdel_item_string.h"
-#include "map2/map_type_striped.h"
-
-namespace map2 {
-    CDSUNIT_DEFINE_RefinableMap(cc::striped_set::implementation_tag, Map_InsDel_Item_string)
-
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_string, run_RefinableMap )
-        CDSUNIT_TEST_RefinableMap
-    CPPUNIT_TEST_SUITE_END_PART()
-} // namespace map2
index 60235a714a4f74998c1457049cf3e90a4202f758..073b49d718b0f1d5cc4b7b4ca761743e11e306fc 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_item_string.h"
 #include "map2/map_type_skip_list.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_SkipListMap( cc::skip_list::implementation_tag, Map_InsDel_Item_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_string, run_SkipListMap )
-        CDSUNIT_TEST_SkipListMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_SkipListMap
 } // namespace map2
index 1efdd6b8b64c2b1a76ced25d1ca52be5c582561b..75bad032943f07efea37f29ad5b8566618373b02 100644 (file)
@@ -3,10 +3,10 @@
 #include "map2/map_insdel_item_string.h"
 #include "map2/map_type_split_list.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_SplitList( cc::split_list::implementation_tag, Map_InsDel_Item_string )
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_string, run_SplitList )
-        CDSUNIT_TEST_SplitList
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_SplitList
 } // namespace map2
index 2ae3b6df2fa74fa392c8c4115e595ec6b6d90e87..10aeb5ea325a221fbba07177b1e1c4cc70cbfbfd 100644 (file)
@@ -3,10 +3,11 @@
 #include "map2/map_insdel_item_string.h"
 #include "map2/map_type_striped.h"
 
-namespace map2 {
-    CDSUNIT_DEFINE_StripedMap(cc::striped_set::implementation_tag, Map_InsDel_Item_string)
+#undef TEST_CASE
+#define TEST_CASE(TAG, X)  void Map_InsDel_Item_string::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
+#include "map2/map_defs.h"
 
-    CPPUNIT_TEST_SUITE_PART( Map_InsDel_Item_string, run_StripedMap )
-        CDSUNIT_TEST_StripedMap
-    CPPUNIT_TEST_SUITE_END_PART()
+namespace map2 {
+    CDSUNIT_DECLARE_StripedMap
+    CDSUNIT_DECLARE_RefinableMap
 } // namespace map2