Refactored MapDelOdd MT-test
authorkhizmax <libcds.dev@gmail.com>
Sat, 29 Aug 2015 13:35:02 +0000 (16:35 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sat, 29 Aug 2015 13:35:02 +0000 (16:35 +0300)
cds/container/michael_map_nogc.h
projects/Win/vc12/unit-map-delodd.vcxproj
projects/source.unit.map.mk
tests/unit/map2/CMakeLists.txt
tests/unit/map2/map_delodd.h
tests/unit/map2/map_delodd_multilevel_hashmap.cpp [deleted file]
tests/unit/map2/map_type_michael.h
tests/unit/map2/map_type_multilevel_hashmap.h

index 7ed7747cbbcecd34e97bbb805583a1aa402d37fa..737578cadaf04bcc02795da5ee4ab4cec7a0be82 100644 (file)
@@ -435,7 +435,7 @@ namespace cds { namespace container {
             and returns an iterator pointed to item found and \ref end() otherwise
         */
         template <typename K>
-        iterator find( K const& key )
+        iterator contains( K const& key )
         {
             bucket_type& refBucket = bucket( key );
             bucket_iterator it = refBucket.contains( key );
index 61c4874409aaa3882964175036096ca8e3154f25..8fd3aa35c586fa58202eaebaf51747d763b280bb 100644 (file)
@@ -56,9 +56,6 @@
     <ClCompile Include="..\..\..\tests\unit\map2\map_delodd_michael.cpp">\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">false</ExcludedFromBuild>\r
     </ClCompile>\r
-    <ClCompile Include="..\..\..\tests\unit\map2\map_delodd_multilevel_hashmap.cpp">\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">true</ExcludedFromBuild>\r
-    </ClCompile>\r
     <ClCompile Include="..\..\..\tests\unit\map2\map_delodd_skip.cpp">\r
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">true</ExcludedFromBuild>\r
     </ClCompile>\r
index 98b927fbcf33a2a67b2efde1251c6955f4659c97..abbe9446f24c9f5d5a901c6dfca8850bc20a6c0f 100644 (file)
@@ -90,7 +90,6 @@ CDSUNIT_MAP_SOURCES := \
     tests/unit/map2/map_delodd_michael.cpp \
     tests/unit/map2/map_delodd_bronsonavltree.cpp \
     tests/unit/map2/map_delodd_ellentree.cpp \
-    tests/unit/map2/map_delodd_multilevel_hashmap.cpp \
     tests/unit/map2/map_delodd_split.cpp \
     tests/unit/map2/map_delodd_skip.cpp \
     tests/unit/map2/map_delodd_cuckoo.cpp \
index 96887a5de2fc6d7d2325b3c072b5673af19a6cd2..9cd5700cc666abc3ef8134ae64e82db68650aedd 100644 (file)
@@ -91,7 +91,6 @@ set(CDSUNIT_MAP_SOURCES
     map_delodd_michael.cpp
     map_delodd_bronsonavltree.cpp
     map_delodd_ellentree.cpp
-    map_delodd_multilevel_hashmap.cpp
     map_delodd_split.cpp
     map_delodd_skip.cpp
     map_delodd_cuckoo.cpp
index 836c10c73dd6a494b8ef1f163f63f1e3abbd8fa0..e30824fd8069b6c944cc600624d9ae3a754bad82 100644 (file)
@@ -6,12 +6,6 @@
 
 namespace map2 {
 
-//#   define TEST_MAP(IMPL, C, X)         void C::X() { test<map_type<IMPL, key_type, value_type>::X >(); }
-//#   define TEST_MAP_DEFAULT_CONSTRUCTIBLE(IMPL, C, X) void C::X() { test_default_constructible<map_type<IMPL, key_type, value_type>::X >(); }
-//#   define TEST_MAP_EXTRACT(IMPL, C, X) void C::X() { test_extract<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_NOLF_EXTRACT(IMPL, C, X) void C::X() { test_nolf_extract<map_type<IMPL, key_type, value_type>::X >(); }
-
 #   define TEST_CASE(TAG, X)  void X();
 
     namespace {
@@ -654,68 +648,6 @@ namespace map2 {
             additional_cleanup( testMap );
         }
 
-        //template <class Map>
-        //void test()
-        //{
-        //    CPPUNIT_MSG( "Insert thread count=" << c_nInsThreadCount
-        //        << " delete thread count=" << c_nDelThreadCount
-        //        << " set size=" << c_nMapSize
-        //        );
-
-        //    for ( size_t nLoadFactor = 1; nLoadFactor <= c_nMaxLoadFactor; nLoadFactor *= 2 ) {
-        //        CPPUNIT_MSG( "Load factor=" << nLoadFactor );
-        //        do_test<Map>( nLoadFactor );
-        //        if ( c_bPrintGCState )
-        //            print_gc_state();
-        //    }
-        //}
-
-        //template <class Map>
-        //void test_extract()
-        //{
-        //    CPPUNIT_MSG( "Thread count: insert=" << c_nInsThreadCount
-        //        << ", delete=" << c_nDelThreadCount
-        //        << ", extract=" << c_nExtractThreadCount
-        //        << "; set size=" << c_nMapSize
-        //        );
-
-        //    for ( size_t nLoadFactor = 1; nLoadFactor <= c_nMaxLoadFactor; nLoadFactor *= 2 ) {
-        //        CPPUNIT_MSG( "Load factor=" << nLoadFactor );
-        //        do_test_extract<Map>( nLoadFactor );
-        //        if ( c_bPrintGCState )
-        //            print_gc_state();
-        //    }
-        //}
-
-        //template <class Map>
-        //void test_nolf()
-        //{
-        //    CPPUNIT_MSG( "Insert thread count=" << c_nInsThreadCount
-        //        << " delete thread count=" << c_nDelThreadCount
-        //        << " set size=" << c_nMapSize
-        //        );
-
-        //    Map s;
-        //    do_test_with( s );
-        //    if ( c_bPrintGCState )
-        //        print_gc_state();
-        //}
-
-        //template <class Map>
-        //void test_nolf_extract()
-        //{
-        //    CPPUNIT_MSG( "Thread count: insert=" << c_nInsThreadCount
-        //        << ", delete=" << c_nDelThreadCount
-        //        << ", extract=" << c_nExtractThreadCount
-        //        << "; set size=" << c_nMapSize
-        //        );
-
-        //    Map s;
-        //    do_test_extract_with( s );
-        //    if ( c_bPrintGCState )
-        //        print_gc_state();
-        //}
-
         template <class Map>
         void run_test()
         {
@@ -756,26 +688,15 @@ 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_MultiLevelHashMap(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_MultiLevelHashMap
+
+        // This test is not suitable for MultiLevelHashMap
+        //CDSUNIT_DECLARE_MultiLevelHashMap
 
         CPPUNIT_TEST_SUITE(Map_DelOdd)
             CDSUNIT_TEST_MichaelMap
-            //CDSUNIT_TEST_MultiLevelHashMap
+            //CDSUNIT_TEST_MultiLevelHashMap // the test is not suitable
         CPPUNIT_TEST_SUITE_END();
 
         //CDSUNIT_DECLARE_MichaelMap
diff --git a/tests/unit/map2/map_delodd_multilevel_hashmap.cpp b/tests/unit/map2/map_delodd_multilevel_hashmap.cpp
deleted file mode 100644 (file)
index 8cdf979..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-//$$CDS-header$$
-
-#include "map2/map_delodd.h"
-#include "map2/map_type_multilevel_hashmap.h"
-
-#undef TEST_CASE
-#define TEST_CASE(TAG, X)  void Map_DelOdd::X() { run_test<typename map_type< TAG, key_type, value_type>::X>(); }
-#include "map2/map_defs.h"
-
-namespace map2 {
-    CDSUNIT_DECLARE_MultiLevelHashMap
-} // namespace map2
index 095c5b735d9a66bc73bd4aa3961cca55187170aa..76d8fcda5504e07f1fb886c3ba3fe83b9766d93d 100644 (file)
@@ -25,8 +25,6 @@ namespace map2 {
         // for testing
         static CDS_CONSTEXPR bool const c_bExtractSupported = true;
         static CDS_CONSTEXPR bool const c_bLoadFactorDepended = true;
-        static CDS_CONSTEXPR bool const c_erase_with_supported = true;
-        static CDS_CONSTEXPR bool const c_extract_with_supported = true;
     };
 
     struct tag_MichaelHashMap;
index 0e0b10fc940ae8cc1fd041e16df5d7551b9ef5b1..2c25a8e950bb11d80bb03968f33942ecce6ed19e 100644 (file)
@@ -25,14 +25,12 @@ namespace map2 {
         // for testing
         static CDS_CONSTEXPR bool const c_bExtractSupported = true;
         static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
-        static CDS_CONSTEXPR bool const c_erase_with_supported = false;
-        static CDS_CONSTEXPR bool const c_extract_with_supported = false;
     };
 
     struct tag_MultiLevelHashMap;
 
     template <typename Key, typename Value>
-    struct map_type< map2::tag_MultiLevelHashMap, Key, Value >: public map_type_base< Key, Value >
+    struct map_type< tag_MultiLevelHashMap, Key, Value >: public map_type_base< Key, Value >
     {
         typedef map_type_base< Key, Value > base_class;
         typedef typename base_class::compare    compare;