Migrated MichaelMap unit test to gtest
authorkhizmax <libcds.dev@gmail.com>
Mon, 28 Mar 2016 21:49:23 +0000 (00:49 +0300)
committerkhizmax <libcds.dev@gmail.com>
Mon, 28 Mar 2016 21:49:23 +0000 (00:49 +0300)
20 files changed:
projects/Win/vc14/gtest-map.vcxproj
projects/Win/vc14/gtest-map.vcxproj.filters
test/unit/map/CMakeLists.txt
test/unit/map/michael_lazy_dhp.cpp [new file with mode: 0644]
test/unit/map/michael_lazy_hp.cpp [new file with mode: 0644]
test/unit/map/michael_lazy_rcu_gpb.cpp [new file with mode: 0644]
test/unit/map/michael_lazy_rcu_gpi.cpp [new file with mode: 0644]
test/unit/map/michael_lazy_rcu_gpt.cpp [new file with mode: 0644]
test/unit/map/michael_lazy_rcu_shb.cpp [new file with mode: 0644]
test/unit/map/michael_lazy_rcu_sht.cpp [new file with mode: 0644]
test/unit/map/michael_michael_rcu_gpb.cpp [new file with mode: 0644]
test/unit/map/michael_michael_rcu_gpi.cpp [new file with mode: 0644]
test/unit/map/michael_michael_rcu_gpt.cpp [new file with mode: 0644]
test/unit/map/michael_michael_rcu_shb.cpp [new file with mode: 0644]
test/unit/map/michael_michael_rcu_sht.cpp [new file with mode: 0644]
test/unit/map/test_map.h
test/unit/map/test_map_hp.h
test/unit/map/test_map_rcu.h [new file with mode: 0644]
test/unit/map/test_michael_lazy_rcu.h [new file with mode: 0644]
test/unit/map/test_michael_michael_rcu.h [new file with mode: 0644]

index 5f73f33742636f648fbb9da8e5f52cd264ba2017..535d34aeee24c33d0105147ef7126032fb0021e7 100644 (file)
   </ItemGroup>\r
   <ItemGroup>\r
     <ClCompile Include="..\..\..\test\unit\main.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_lazy_dhp.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_lazy_hp.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_lazy_rcu_gpb.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_lazy_rcu_gpi.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_lazy_rcu_gpt.cpp">\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4503</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_lazy_rcu_shb.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_lazy_rcu_sht.cpp" />\r
     <ClCompile Include="..\..\..\test\unit\map\michael_michael_dhp.cpp" />\r
     <ClCompile Include="..\..\..\test\unit\map\michael_michael_hp.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_michael_rcu_gpb.cpp">\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4503</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_michael_rcu_gpi.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_michael_rcu_gpt.cpp">\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4503</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_michael_rcu_shb.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_michael_rcu_sht.cpp" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\..\..\test\unit\map\test_map.h" />\r
     <ClInclude Include="..\..\..\test\unit\map\test_map_hp.h" />\r
+    <ClInclude Include="..\..\..\test\unit\map\test_map_rcu.h" />\r
+    <ClInclude Include="..\..\..\test\unit\map\test_michael_lazy_rcu.h" />\r
+    <ClInclude Include="..\..\..\test\unit\map\test_michael_michael_rcu.h" />\r
   </ItemGroup>\r
   <PropertyGroup Label="Globals">\r
     <ProjectGuid>{42B7E892-DDDA-4D00-9AB7-378E0E7E9433}</ProjectGuid>\r
index 69cfb7d1118a824079228ff28ed14a36d4523202..3d8dbfa0b306791152a3b4a2608eb20b5c5b2881 100644 (file)
     <ClCompile Include="..\..\..\test\unit\map\michael_michael_dhp.cpp">\r
       <Filter>Source Files\MichaelMap</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_lazy_hp.cpp">\r
+      <Filter>Source Files\MichaelMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_lazy_dhp.cpp">\r
+      <Filter>Source Files\MichaelMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_michael_rcu_gpb.cpp">\r
+      <Filter>Source Files\MichaelMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_michael_rcu_gpi.cpp">\r
+      <Filter>Source Files\MichaelMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_michael_rcu_gpt.cpp">\r
+      <Filter>Source Files\MichaelMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_michael_rcu_shb.cpp">\r
+      <Filter>Source Files\MichaelMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_michael_rcu_sht.cpp">\r
+      <Filter>Source Files\MichaelMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_lazy_rcu_gpb.cpp">\r
+      <Filter>Source Files\MichaelMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_lazy_rcu_gpi.cpp">\r
+      <Filter>Source Files\MichaelMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_lazy_rcu_gpt.cpp">\r
+      <Filter>Source Files\MichaelMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_lazy_rcu_shb.cpp">\r
+      <Filter>Source Files\MichaelMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\michael_lazy_rcu_sht.cpp">\r
+      <Filter>Source Files\MichaelMap</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\..\..\test\unit\map\test_map.h">\r
     <ClInclude Include="..\..\..\test\unit\map\test_map_hp.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\..\..\test\unit\map\test_map_rcu.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\..\test\unit\map\test_michael_michael_rcu.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\..\test\unit\map\test_michael_lazy_rcu.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
 </Project>
\ No newline at end of file
index f62bf96fa1ad377ea3ad2e7b177568959c41121a..c10feb1b5e319fad2f7df7b9f41df96f46af24dd 100644 (file)
@@ -2,8 +2,20 @@ set(PACKAGE_NAME unit-map)
 
 set(CDSGTEST_MAP_SOURCES
     ../main.cpp
+    michael_lazy_hp.cpp
+    michael_lazy_dhp.cpp
+    michael_lazy_rcu_gpb.cpp
+    michael_lazy_rcu_gpi.cpp
+    michael_lazy_rcu_gpt.cpp
+    michael_lazy_rcu_shb.cpp
+    michael_lazy_rcu_sht.cpp
     michael_michael_hp.cpp
     michael_michael_dhp.cpp
+    michael_michael_rcu_gpb.cpp
+    michael_michael_rcu_gpi.cpp
+    michael_michael_rcu_gpt.cpp
+    michael_michael_rcu_shb.cpp
+    michael_michael_rcu_sht.cpp
 )
 
 include_directories(
diff --git a/test/unit/map/michael_lazy_dhp.cpp b/test/unit/map/michael_lazy_dhp.cpp
new file mode 100644 (file)
index 0000000..02b535e
--- /dev/null
@@ -0,0 +1,178 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+    
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+      list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+*/
+
+#include "test_map_hp.h"
+
+#include <cds/container/lazy_kvlist_dhp.h>
+#include <cds/container/michael_map.h>
+
+namespace {
+
+    namespace cc = cds::container;
+    typedef cds::gc::DHP gc_type;
+
+    class MichaelLazyMap_DHP: public cds_test::container_map_hp
+    {
+    protected:
+        typedef cds_test::container_map_hp base_class;
+
+        void SetUp()
+        {
+            typedef cc::LazyKVList< gc_type, key_type, value_type > list_type;
+            typedef cc::MichaelHashMap< gc_type, list_type >   map_type;
+
+            cds::gc::dhp::GarbageCollector::Construct( 16, map_type::c_nHazardPtrCount );
+            cds::threading::Manager::attachThread();
+        }
+
+        void TearDown()
+        {
+            cds::threading::Manager::detachThread();
+            cds::gc::dhp::GarbageCollector::Destruct();
+        }
+    };
+
+    TEST_F( MichaelLazyMap_DHP, compare )
+    {
+        typedef cc::LazyKVList< gc_type, key_type, value_type,
+            typename cc::lazy_list::make_traits<
+                cds::opt::compare< cmp >
+            >::type
+        > list_type;
+
+        typedef cc::MichaelHashMap< gc_type, list_type, 
+            typename cc::michael_map::make_traits<
+                cds::opt::hash< hash1 >
+            >::type
+        > map_type;
+
+        map_type m( kSize, 2 );
+        test( m );
+    }
+
+    TEST_F( MichaelLazyMap_DHP, less )
+    {
+        typedef cc::LazyKVList< gc_type, key_type, value_type,
+            typename cc::lazy_list::make_traits<
+                cds::opt::less< less >
+            >::type
+        > list_type;
+
+        typedef cc::MichaelHashMap< gc_type, list_type, 
+            typename cc::michael_map::make_traits<
+                cds::opt::hash< hash1 >
+            >::type
+        > map_type;
+
+        map_type m( kSize, 1 );
+        test( m );
+    }
+
+    TEST_F( MichaelLazyMap_DHP, cmpmix )
+    {
+        typedef cc::LazyKVList< gc_type, key_type, value_type,
+            typename cc::lazy_list::make_traits<
+                cds::opt::less< less >
+                ,cds::opt::compare< cmp >
+            >::type
+        > list_type;
+
+        typedef cc::MichaelHashMap< gc_type, list_type, 
+            typename cc::michael_map::make_traits<
+                cds::opt::hash< hash1 >
+            >::type
+        > map_type;
+
+        map_type m( kSize, 2 );
+        test( m );
+    }
+
+    TEST_F( MichaelLazyMap_DHP, backoff )
+    {
+        struct list_traits: public cc::lazy_list::traits
+        {
+            typedef cmp compare;
+            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+        };
+        typedef cc::LazyKVList< gc_type, key_type, value_type, list_traits > list_type;
+
+        struct map_traits: public cc::michael_map::traits
+        {
+            typedef hash1 hash;
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cc::MichaelHashMap< gc_type, list_type, map_traits > map_type;
+
+        map_type m( kSize, 4 );
+        test( m );
+    }
+
+    TEST_F( MichaelLazyMap_DHP, seq_cst )
+    {
+        struct list_traits: public cc::lazy_list::traits
+        {
+            typedef cmp compare;
+            typedef cds::backoff::yield back_off;
+            typedef cds::opt::v::sequential_consistent memory_model;
+        };
+        typedef cc::LazyKVList< gc_type, key_type, value_type, list_traits > list_type;
+
+        struct map_traits: public cc::michael_map::traits
+        {
+            typedef hash1 hash;
+        };
+        typedef cc::MichaelHashMap< gc_type, list_type, map_traits > map_type;
+
+        map_type m( kSize, 8 );
+        test( m );
+    }
+
+    TEST_F( MichaelLazyMap_DHP, mutex )
+    {
+        struct list_traits: public cc::lazy_list::traits
+        {
+            typedef cmp                 compare;
+            typedef cds::backoff::yield back_off;
+            typedef std::mutex          lock_type;
+        };
+        typedef cc::LazyKVList< gc_type, key_type, value_type, list_traits > list_type;
+
+        struct map_traits: public cc::michael_map::traits
+        {
+            typedef hash1 hash;
+        };
+        typedef cc::MichaelHashMap< gc_type, list_type, map_traits > map_type;
+
+        map_type m( kSize, 2 );
+        test( m );
+    }
+
+} // namespace
+
diff --git a/test/unit/map/michael_lazy_hp.cpp b/test/unit/map/michael_lazy_hp.cpp
new file mode 100644 (file)
index 0000000..5376a2e
--- /dev/null
@@ -0,0 +1,179 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+    
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+      list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+*/
+
+#include "test_map_hp.h"
+
+#include <cds/container/lazy_kvlist_hp.h>
+#include <cds/container/michael_map.h>
+
+namespace {
+
+    namespace cc = cds::container;
+    typedef cds::gc::HP gc_type;
+
+    class MichaelLazyMap_HP: public cds_test::container_map_hp
+    {
+    protected:
+        typedef cds_test::container_map_hp base_class;
+
+        void SetUp()
+        {
+            typedef cc::LazyKVList< gc_type, key_type, value_type > list_type;
+            typedef cc::MichaelHashMap< gc_type, list_type >   map_type;
+
+            // +1 - for guarded_ptr and iterator
+            cds::gc::hp::GarbageCollector::Construct( map_type::c_nHazardPtrCount + 1, 1, 16 );
+            cds::threading::Manager::attachThread();
+        }
+
+        void TearDown()
+        {
+            cds::threading::Manager::detachThread();
+            cds::gc::hp::GarbageCollector::Destruct( true );
+        }
+    };
+
+    TEST_F( MichaelLazyMap_HP, compare )
+    {
+        typedef cc::LazyKVList< gc_type, key_type, value_type,
+            typename cc::lazy_list::make_traits<
+                cds::opt::compare< cmp >
+            >::type
+        > list_type;
+
+        typedef cc::MichaelHashMap< gc_type, list_type, 
+            typename cc::michael_map::make_traits<
+                cds::opt::hash< hash1 >
+            >::type
+        > map_type;
+
+        map_type m( kSize, 2 );
+        test( m );
+    }
+
+    TEST_F( MichaelLazyMap_HP, less )
+    {
+        typedef cc::LazyKVList< gc_type, key_type, value_type,
+            typename cc::lazy_list::make_traits<
+                cds::opt::less< less >
+            >::type
+        > list_type;
+
+        typedef cc::MichaelHashMap< gc_type, list_type, 
+            typename cc::michael_map::make_traits<
+                cds::opt::hash< hash1 >
+            >::type
+        > map_type;
+
+        map_type m( kSize, 1 );
+        test( m );
+    }
+
+    TEST_F( MichaelLazyMap_HP, cmpmix )
+    {
+        typedef cc::LazyKVList< gc_type, key_type, value_type,
+            typename cc::lazy_list::make_traits<
+                cds::opt::less< less >
+                ,cds::opt::compare< cmp >
+            >::type
+        > list_type;
+
+        typedef cc::MichaelHashMap< gc_type, list_type, 
+            typename cc::michael_map::make_traits<
+                cds::opt::hash< hash1 >
+            >::type
+        > map_type;
+
+        map_type m( kSize, 2 );
+        test( m );
+    }
+
+    TEST_F( MichaelLazyMap_HP, backoff )
+    {
+        struct list_traits: public cc::lazy_list::traits
+        {
+            typedef cmp compare;
+            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+        };
+        typedef cc::LazyKVList< gc_type, key_type, value_type, list_traits > list_type;
+
+        struct map_traits: public cc::michael_map::traits
+        {
+            typedef hash1 hash;
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cc::MichaelHashMap< gc_type, list_type, map_traits > map_type;
+
+        map_type m( kSize, 4 );
+        test( m );
+    }
+
+    TEST_F( MichaelLazyMap_HP, seq_cst )
+    {
+        struct list_traits: public cc::lazy_list::traits
+        {
+            typedef cmp compare;
+            typedef cds::backoff::yield back_off;
+            typedef cds::opt::v::sequential_consistent memory_model;
+        };
+        typedef cc::LazyKVList< gc_type, key_type, value_type, list_traits > list_type;
+
+        struct map_traits: public cc::michael_map::traits
+        {
+            typedef hash1 hash;
+        };
+        typedef cc::MichaelHashMap< gc_type, list_type, map_traits > map_type;
+
+        map_type m( kSize, 8 );
+        test( m );
+    }
+
+    TEST_F( MichaelLazyMap_HP, mutex )
+    {
+        struct list_traits: public cc::lazy_list::traits
+        {
+            typedef cmp compare;
+            typedef cds::backoff::yield back_off;
+            typedef std::mutex lock_type;
+        };
+        typedef cc::LazyKVList< gc_type, key_type, value_type, list_traits > list_type;
+
+        struct map_traits: public cc::michael_map::traits
+        {
+            typedef hash1 hash;
+        };
+        typedef cc::MichaelHashMap< gc_type, list_type, map_traits > map_type;
+
+        map_type m( kSize, 2 );
+        test( m );
+    }
+
+} // namespace
+
diff --git a/test/unit/map/michael_lazy_rcu_gpb.cpp b/test/unit/map/michael_lazy_rcu_gpb.cpp
new file mode 100644 (file)
index 0000000..fa22f17
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <cds/urcu/general_buffered.h>
+
+#include "test_michael_lazy_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::general_buffered<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPB, MichaelLazyMap, rcu_implementation );
diff --git a/test/unit/map/michael_lazy_rcu_gpi.cpp b/test/unit/map/michael_lazy_rcu_gpi.cpp
new file mode 100644 (file)
index 0000000..bebd11a
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <cds/urcu/general_instant.h>
+
+#include "test_michael_lazy_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::general_instant<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPI, MichaelLazyMap, rcu_implementation );
diff --git a/test/unit/map/michael_lazy_rcu_gpt.cpp b/test/unit/map/michael_lazy_rcu_gpt.cpp
new file mode 100644 (file)
index 0000000..a9d41f5
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <cds/urcu/general_threaded.h>
+
+#include "test_michael_lazy_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::general_threaded<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPT, MichaelLazyMap, rcu_implementation );
diff --git a/test/unit/map/michael_lazy_rcu_shb.cpp b/test/unit/map/michael_lazy_rcu_shb.cpp
new file mode 100644 (file)
index 0000000..85430bb
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <cds/urcu/signal_buffered.h>
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+
+#include "test_michael_lazy_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::signal_buffered<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_SHB, MichaelLazyMap, rcu_implementation );
+
+#endif // CDS_URCU_SIGNAL_HANDLING_ENABLED
diff --git a/test/unit/map/michael_lazy_rcu_sht.cpp b/test/unit/map/michael_lazy_rcu_sht.cpp
new file mode 100644 (file)
index 0000000..546e57b
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <cds/urcu/signal_threaded.h>
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+
+#include "test_michael_lazy_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::signal_threaded<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_SHT, MichaelLazyMap, rcu_implementation );
+
+#endif // CDS_URCU_SIGNAL_HANDLING_ENABLED
diff --git a/test/unit/map/michael_michael_rcu_gpb.cpp b/test/unit/map/michael_michael_rcu_gpb.cpp
new file mode 100644 (file)
index 0000000..39e68a1
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <cds/urcu/general_buffered.h>
+
+#include "test_michael_michael_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::general_buffered<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPB, MichaelMap, rcu_implementation );
diff --git a/test/unit/map/michael_michael_rcu_gpi.cpp b/test/unit/map/michael_michael_rcu_gpi.cpp
new file mode 100644 (file)
index 0000000..c5ad3f6
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <cds/urcu/general_instant.h>
+
+#include "test_michael_michael_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::general_instant<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPI, MichaelMap, rcu_implementation );
diff --git a/test/unit/map/michael_michael_rcu_gpt.cpp b/test/unit/map/michael_michael_rcu_gpt.cpp
new file mode 100644 (file)
index 0000000..95896fa
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <cds/urcu/general_threaded.h>
+
+#include "test_michael_michael_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::general_threaded<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPT, MichaelMap, rcu_implementation );
diff --git a/test/unit/map/michael_michael_rcu_shb.cpp b/test/unit/map/michael_michael_rcu_shb.cpp
new file mode 100644 (file)
index 0000000..fb5c32a
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <cds/urcu/signal_buffered.h>
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+
+#include "test_michael_michael_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::signal_buffered<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_SHB, MichaelMap, rcu_implementation );
+
+#endif // CDS_URCU_SIGNAL_HANDLING_ENABLED
diff --git a/test/unit/map/michael_michael_rcu_sht.cpp b/test/unit/map/michael_michael_rcu_sht.cpp
new file mode 100644 (file)
index 0000000..b998848
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation
+    and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <cds/urcu/signal_threaded.h>
+
+#ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
+
+#include "test_michael_michael_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::signal_threaded<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_SHT, MichaelMap, rcu_implementation );
+
+#endif // CDS_URCU_SIGNAL_HANDLING_ENABLED
index 3253705f1987c68ee09ebe9a3f56f4ce6e1c18bf..43bd2bdf4fea82fa8654d8fde4747913fa27c78b 100644 (file)
@@ -237,15 +237,16 @@ namespace cds_test {
             ASSERT_TRUE( m.empty());
             ASSERT_CONTAINER_SIZE( m, 0 );
 
-            typedef Map::value_type map_pair;
+            typedef typename Map::value_type map_pair;
+            size_t const kkSize = kSize;
 
             std::vector<key_type> arrKeys;
-            for ( int i = 0; i < static_cast<int>(kSize); ++i )
+            for ( int i = 0; i < static_cast<int>(kkSize); ++i )
                 arrKeys.push_back( key_type( i ));
             shuffle( arrKeys.begin(), arrKeys.end());
 
             std::vector< value_type > arrVals;
-            for ( size_t i = 0; i < kSize; ++i ) {
+            for ( size_t i = 0; i < kkSize; ++i ) {
                 value_type val;
                 val.nVal = static_cast<int>( i );
                 val.strVal = std::to_string( i );
@@ -452,7 +453,7 @@ namespace cds_test {
                 } ));
             }
             ASSERT_FALSE( m.empty() );
-            ASSERT_CONTAINER_SIZE( m, kSize );
+            ASSERT_CONTAINER_SIZE( m, kkSize );
             ASSERT_FALSE( m.begin() == m.end() );
             ASSERT_FALSE( m.cbegin() == m.cend() );
 
@@ -560,7 +561,7 @@ namespace cds_test {
                 ASSERT_TRUE( m.insert( i ));
 
             ASSERT_FALSE( m.empty() );
-            ASSERT_CONTAINER_SIZE( m, kSize );
+            ASSERT_CONTAINER_SIZE( m, kkSize );
 
             m.clear();
 
index 7b4bd05ea13673f2e22b094e7bfe257fa1117ab3..220951150c6d560ae261d3de49baa5d5f58587dd 100644 (file)
@@ -51,15 +51,16 @@ namespace cds_test {
             ASSERT_TRUE( m.empty());
             ASSERT_CONTAINER_SIZE( m, 0 );
 
-            typedef Map::value_type map_pair;
+            typedef typename Map::value_type map_pair;
+            size_t const kkSize = base_class::kSize;
 
             std::vector<key_type> arrKeys;
-            for ( int i = 0; i < static_cast<int>(kSize); ++i )
+            for ( int i = 0; i < static_cast<int>(kkSize); ++i )
                 arrKeys.push_back( key_type( i ));
             shuffle( arrKeys.begin(), arrKeys.end());
 
             std::vector< value_type > arrVals;
-            for ( size_t i = 0; i < kSize; ++i ) {
+            for ( size_t i = 0; i < kkSize; ++i ) {
                 value_type val;
                 val.nVal = static_cast<int>( i );
                 val.strVal = std::to_string( i );
@@ -69,23 +70,23 @@ namespace cds_test {
             for ( auto const& i : arrKeys )
                 ASSERT_TRUE( m.insert( i ) );
             ASSERT_FALSE( m.empty() );
-            ASSERT_CONTAINER_SIZE( m, kSize );
+            ASSERT_CONTAINER_SIZE( m, kkSize );
 
             // iterators
             size_t nCount = 0;
             for ( auto it = m.begin(); it != m.end(); ++it ) {
                 EXPECT_EQ( it->second.nVal, 0 );
-                it->second.nVal = it->first.nKey;
+                it->second.nVal = it->first.nKey * 2;
                 ++nCount;
             }
-            EXPECT_EQ( nCount, kSize );
+            EXPECT_EQ( nCount, kkSize );
 
             nCount = 0;
             for ( auto it = m.cbegin(); it != m.cend(); ++it ) {
-                EXPECT_EQ( it->second.nVal, it->first.nKey );
+                EXPECT_EQ( it->second.nVal, it->first.nKey * 2 );
                 ++nCount;
             }
-            EXPECT_EQ( nCount, kSize );
+            EXPECT_EQ( nCount, kkSize );
 
             // get/extract
             typedef typename Map::guarded_ptr guarded_ptr;
diff --git a/test/unit/map/test_map_rcu.h b/test/unit/map/test_map_rcu.h
new file mode 100644 (file)
index 0000000..f05bac5
--- /dev/null
@@ -0,0 +1,224 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+    
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+      list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+*/
+
+#ifndef CDSUNIT_MAP_TEST_MAP_RCU_H
+#define CDSUNIT_MAP_TEST_MAP_RCU_H
+
+#include "test_map.h"
+
+namespace cds_test {
+
+    class container_map_rcu: public container_map
+    {
+        typedef container_map base_class;
+
+    protected:
+        template <class Map>
+        void test( Map& m )
+        {
+            // Precondition: map is empty
+            // Postcondition: map is empty
+
+            base_class::test( m );
+
+            ASSERT_TRUE( m.empty());
+            ASSERT_CONTAINER_SIZE( m, 0 );
+
+            typedef typename Map::value_type map_pair;
+            size_t const kkSize = base_class::kSize;
+
+            std::vector<key_type> arrKeys;
+            for ( int i = 0; i < static_cast<int>(kkSize); ++i )
+                arrKeys.push_back( key_type( i ));
+            shuffle( arrKeys.begin(), arrKeys.end());
+
+            std::vector< value_type > arrVals;
+            for ( size_t i = 0; i < kkSize; ++i ) {
+                value_type val;
+                val.nVal = static_cast<int>( i );
+                val.strVal = std::to_string( i );
+                arrVals.push_back( val );
+            }
+
+            for ( auto const& i : arrKeys )
+                ASSERT_TRUE( m.insert( i ) );
+            ASSERT_FALSE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, kkSize );
+
+            // iterators
+            size_t nCount = 0;
+            for ( auto it = m.begin(); it != m.end(); ++it ) {
+                EXPECT_EQ( it->second.nVal, 0 );
+                it->second.nVal = it->first.nKey * 2;
+                ++nCount;
+            }
+            EXPECT_EQ( nCount, kkSize );
+
+            nCount = 0;
+            for ( auto it = m.cbegin(); it != m.cend(); ++it ) {
+                EXPECT_EQ( it->second.nVal, it->first.nKey * 2 );
+                ++nCount;
+            }
+            EXPECT_EQ( nCount, kkSize );
+
+            typedef typename Map::exempt_ptr exempt_ptr;
+            typedef typename Map::raw_ptr    raw_ptr;
+            typedef typename Map::rcu_lock   rcu_lock;
+
+            // get/extract
+            shuffle( arrKeys.begin(), arrKeys.end() );
+
+            for ( auto const& i : arrKeys ) {
+                value_type const& val = arrVals.at( i.nKey );
+
+                {
+                    rcu_lock l;
+                    raw_ptr rp;
+
+                    rp = m.get( i.nKey );
+                    ASSERT_FALSE( !rp );
+                    EXPECT_EQ( rp->first.nKey, i.nKey );
+                    rp->second.nVal = rp->first.nKey * 2;
+
+                    rp = m.get( i );
+                    ASSERT_FALSE( !rp );
+                    EXPECT_EQ( rp->first.nKey, i.nKey );
+                    EXPECT_EQ( rp->second.nVal, rp->first.nKey * 2 );
+                    rp->second.nVal = rp->first.nKey * 3;
+
+                    rp = m.get_with( other_item( i.nKey ), other_less());
+                    ASSERT_FALSE( !rp );
+                    EXPECT_EQ( rp->first.nKey, i.nKey );
+                    EXPECT_EQ( rp->second.nVal, rp->first.nKey * 3 );
+                    rp->second.nVal = rp->first.nKey;
+                }
+
+                exempt_ptr xp;
+                if ( Map::c_bExtractLockExternal ) {
+                    {
+                        rcu_lock l;
+
+                        switch ( i.nKey % 4 ) {
+                        case 0:
+                            xp = m.extract( i.nKey );
+                            break;
+                        case 1:
+                            xp = m.extract( i );
+                            break;
+                        case 2:
+                            xp = m.extract( val.strVal );
+                            break;
+                        case 3:
+                            xp = m.extract_with( other_item( i.nKey ), other_less() );
+                            break;
+                        }
+                        ASSERT_FALSE( !xp );
+                        EXPECT_EQ( xp->first.nKey, i.nKey );
+                        EXPECT_EQ( xp->second.nVal, xp->first.nKey );
+                    }
+                    xp.release();
+
+                    {
+                        rcu_lock l;
+
+                        switch ( i.nKey % 4 ) {
+                        case 0:
+                            xp = m.extract( i.nKey );
+                            break;
+                        case 1:
+                            xp = m.extract( i );
+                            break;
+                        case 2:
+                            xp = m.extract( val.strVal );
+                            break;
+                        case 3:
+                            xp = m.extract_with( other_item( i.nKey ), other_less() );
+                            break;
+                        }
+                        EXPECT_TRUE( !xp );
+                    }
+                }
+                else {
+                    switch ( i.nKey % 4 ) {
+                    case 0:
+                        xp = m.extract( i.nKey );
+                        break;
+                    case 1:
+                        xp = m.extract( i );
+                        break;
+                    case 2:
+                        xp = m.extract( val.strVal );
+                        break;
+                    case 3:
+                        xp = m.extract_with( other_item( i.nKey ), other_less());
+                        break;
+                    }
+                    ASSERT_FALSE( !xp );
+                    EXPECT_EQ( xp->first.nKey, i.nKey );
+                    EXPECT_EQ( xp->second.nVal, xp->first.nKey );
+
+                    switch ( i.nKey % 4 ) {
+                    case 0:
+                        xp = m.extract( i.nKey );
+                        break;
+                    case 1:
+                        xp = m.extract( i );
+                        break;
+                    case 2:
+                        xp = m.extract( val.strVal );
+                        break;
+                    case 3:
+                        xp = m.extract_with( other_item( i.nKey ), other_less() );
+                        break;
+                    }
+                    EXPECT_TRUE( !xp );
+                }
+
+                {
+                    rcu_lock l;
+                    raw_ptr rp;
+
+                    rp = m.get( i.nKey );
+                    ASSERT_TRUE( !rp );
+                    rp = m.get( i );
+                    ASSERT_TRUE( !rp );
+                    rp = m.get_with( other_item( i.nKey ), other_less() );
+                    ASSERT_TRUE( !rp );
+                }
+            }
+
+            ASSERT_TRUE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, 0 );
+        }
+    };
+
+} // namespace cds_test
+
+#endif // #ifndef CDSUNIT_MAP_TEST_MAP_H
diff --git a/test/unit/map/test_michael_lazy_rcu.h b/test/unit/map/test_michael_lazy_rcu.h
new file mode 100644 (file)
index 0000000..db97971
--- /dev/null
@@ -0,0 +1,213 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+    
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+      list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+*/
+#ifndef CDSUNIT_MAP_TEST_MICHAEL_LAZY_RCU_H
+#define CDSUNIT_MAP_TEST_MICHAEL_LAZY_RCU_H
+
+#include "test_map_rcu.h"
+#include <cds/container/lazy_kvlist_rcu.h>
+#include <cds/container/michael_map_rcu.h>
+
+namespace {
+    namespace cc = cds::container;
+
+    template <class RCU>
+    class MichaelLazyMap: public cds_test::container_map_rcu
+    {
+        typedef cds_test::container_map_rcu base_class;
+    public:
+        typedef cds::urcu::gc<RCU> rcu_type;
+
+    protected:
+        void SetUp()
+        {
+            RCU::Construct();
+            cds::threading::Manager::attachThread();
+        }
+
+        void TearDown()
+        {
+            cds::threading::Manager::detachThread();
+            RCU::Destruct();
+        }
+    };
+
+    TYPED_TEST_CASE_P( MichaelLazyMap );
+
+    TYPED_TEST_P( MichaelLazyMap, compare )
+    {
+        typedef typename TestFixture::rcu_type rcu_type;
+        typedef typename TestFixture::key_type key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        typedef cc::LazyKVList< rcu_type, key_type, value_type,
+            typename cc::lazy_list::make_traits<
+                cds::opt::compare< typename TestFixture::cmp >
+            >::type
+        > list_type;
+
+        typedef cc::MichaelHashMap< rcu_type, list_type, 
+            typename cc::michael_map::make_traits<
+                cds::opt::hash< typename TestFixture::hash1 >
+            >::type
+        > map_type;
+
+        map_type m( TestFixture::kSize, 2 );
+        this->test( m );
+    }
+
+    TYPED_TEST_P( MichaelLazyMap, less )
+    {
+        typedef typename TestFixture::rcu_type rcu_type;
+        typedef typename TestFixture::key_type key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        typedef cc::LazyKVList< rcu_type, key_type, value_type,
+            typename cc::lazy_list::make_traits<
+                cds::opt::less< typename TestFixture::less >
+            >::type
+        > list_type;
+
+        typedef cc::MichaelHashMap< rcu_type, list_type, 
+            typename cc::michael_map::make_traits<
+                cds::opt::hash< typename TestFixture::hash1 >
+            >::type
+        > map_type;
+
+        map_type m( TestFixture::kSize, 2 );
+        this->test( m );
+    }
+
+    TYPED_TEST_P( MichaelLazyMap, cmpmix )
+    {
+        typedef typename TestFixture::rcu_type rcu_type;
+        typedef typename TestFixture::key_type key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        struct list_traits : public cc::lazy_list::traits
+        {
+            typedef typename TestFixture::less less;
+            typedef typename TestFixture::cmp compare;
+        };
+        typedef cc::LazyKVList< rcu_type, key_type, value_type, list_traits > list_type;
+
+        typedef cc::MichaelHashMap< rcu_type, list_type,
+            typename cc::michael_map::make_traits<
+                cds::opt::hash< typename TestFixture::hash1 >
+            >::type
+        > map_type;
+
+        map_type m( TestFixture::kSize, 2 );
+        this->test( m );
+    }
+
+    TYPED_TEST_P( MichaelLazyMap, backoff )
+    {
+        typedef typename TestFixture::rcu_type rcu_type;
+        typedef typename TestFixture::key_type key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        struct list_traits : public cc::lazy_list::traits
+        {
+            typedef typename TestFixture::cmp compare;
+            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+        };
+        typedef cc::LazyKVList< rcu_type, key_type, value_type, list_traits > list_type;
+
+        struct set_traits : public cc::michael_map::traits
+        {
+            typedef typename TestFixture::hash1 hash;
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cc::MichaelHashMap< rcu_type, list_type, set_traits >map_type;
+
+        map_type m( TestFixture::kSize, 4 );
+        this->test( m );
+    }
+
+    TYPED_TEST_P( MichaelLazyMap, seq_cst )
+    {
+        typedef typename TestFixture::rcu_type rcu_type;
+        typedef typename TestFixture::key_type key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        struct list_traits : public cc::lazy_list::traits
+        {
+            typedef typename TestFixture::less less;
+            typedef cds::backoff::pause back_off;
+            typedef cds::opt::v::sequential_consistent memory_model;
+        };
+        typedef cc::LazyKVList< rcu_type, key_type, value_type, list_traits > list_type;
+
+        struct set_traits : public cc::michael_map::traits
+        {
+            typedef typename TestFixture::hash1 hash;
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cc::MichaelHashMap< rcu_type, list_type, set_traits >map_type;
+
+        map_type m( TestFixture::kSize, 4 );
+        this->test( m );
+    }
+
+    TYPED_TEST_P( MichaelLazyMap, mutex )
+    {
+        typedef typename TestFixture::rcu_type rcu_type;
+        typedef typename TestFixture::key_type key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        struct list_traits : public cc::lazy_list::traits
+        {
+            typedef typename TestFixture::less less;
+            typedef cds::backoff::pause back_off;
+            typedef std::mutex lock_type;
+        };
+        typedef cc::LazyKVList< rcu_type, key_type, value_type, list_traits > list_type;
+
+        struct set_traits : public cc::michael_map::traits
+        {
+            typedef typename TestFixture::hash1 hash;
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cc::MichaelHashMap< rcu_type, list_type, set_traits >map_type;
+
+        map_type m( TestFixture::kSize, 4 );
+        this->test( m );
+    }
+
+
+    // GCC 5: All test names should be written on single line, otherwise a runtime error will be encountered like as
+    // "No test named <test_name> can be found in this test case"
+    REGISTER_TYPED_TEST_CASE_P( MichaelLazyMap,
+        compare, less, cmpmix, backoff, seq_cst, mutex
+    );
+} // namespace
+
+#endif // CDSUNIT_MAP_TEST_MICHAEL_LAZY_RCU_H
\ No newline at end of file
diff --git a/test/unit/map/test_michael_michael_rcu.h b/test/unit/map/test_michael_michael_rcu.h
new file mode 100644 (file)
index 0000000..dc66ad8
--- /dev/null
@@ -0,0 +1,186 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+    
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+      list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+*/
+#ifndef CDSUNIT_MAP_TEST_MICHAEL_MICHAEL_RCU_H
+#define CDSUNIT_MAP_TEST_MICHAEL_MICHAEL_RCU_H
+
+#include "test_map_rcu.h"
+#include <cds/container/michael_kvlist_rcu.h>
+#include <cds/container/michael_map_rcu.h>
+
+namespace {
+    namespace cc = cds::container;
+
+    template <class RCU>
+    class MichaelMap: public cds_test::container_map_rcu
+    {
+        typedef cds_test::container_map_rcu base_class;
+    public:
+        typedef cds::urcu::gc<RCU> rcu_type;
+
+    protected:
+        void SetUp()
+        {
+            RCU::Construct();
+            cds::threading::Manager::attachThread();
+        }
+
+        void TearDown()
+        {
+            cds::threading::Manager::detachThread();
+            RCU::Destruct();
+        }
+    };
+
+    TYPED_TEST_CASE_P( MichaelMap );
+
+    TYPED_TEST_P( MichaelMap, compare )
+    {
+        typedef typename TestFixture::rcu_type rcu_type;
+        typedef typename TestFixture::key_type key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+            typename cc::michael_list::make_traits<
+                cds::opt::compare< typename TestFixture::cmp >
+            >::type
+        > list_type;
+
+        typedef cc::MichaelHashMap< rcu_type, list_type, 
+            typename cc::michael_map::make_traits<
+                cds::opt::hash< typename TestFixture::hash1 >
+            >::type
+        > map_type;
+
+        map_type m( TestFixture::kSize, 2 );
+        this->test( m );
+    }
+
+    TYPED_TEST_P( MichaelMap, less )
+    {
+        typedef typename TestFixture::rcu_type rcu_type;
+        typedef typename TestFixture::key_type key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        typedef cc::MichaelKVList< rcu_type, key_type, value_type,
+            typename cc::michael_list::make_traits<
+                cds::opt::less< typename TestFixture::less >
+            >::type
+        > list_type;
+
+        typedef cc::MichaelHashMap< rcu_type, list_type, 
+            typename cc::michael_map::make_traits<
+                cds::opt::hash< typename TestFixture::hash1 >
+            >::type
+        > map_type;
+
+        map_type m( TestFixture::kSize, 2 );
+        this->test( m );
+    }
+
+    TYPED_TEST_P( MichaelMap, cmpmix )
+    {
+        typedef typename TestFixture::rcu_type rcu_type;
+        typedef typename TestFixture::key_type key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        struct list_traits : public cc::michael_list::traits
+        {
+            typedef typename TestFixture::less less;
+            typedef typename TestFixture::cmp compare;
+        };
+        typedef cc::MichaelKVList< rcu_type, key_type, value_type, list_traits > list_type;
+
+        typedef cc::MichaelHashMap< rcu_type, list_type,
+            typename cc::michael_map::make_traits<
+                cds::opt::hash< typename TestFixture::hash1 >
+            >::type
+        > map_type;
+
+        map_type m( TestFixture::kSize, 2 );
+        this->test( m );
+    }
+
+    TYPED_TEST_P( MichaelMap, backoff )
+    {
+        typedef typename TestFixture::rcu_type rcu_type;
+        typedef typename TestFixture::key_type key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        struct list_traits : public cc::michael_list::traits
+        {
+            typedef typename TestFixture::cmp compare;
+            typedef cds::backoff::exponential<cds::backoff::pause, cds::backoff::yield> back_off;
+        };
+        typedef cc::MichaelKVList< rcu_type, key_type, value_type, list_traits > list_type;
+
+        struct map_traits : public cc::michael_map::traits
+        {
+            typedef typename TestFixture::hash1 hash;
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cc::MichaelHashMap< rcu_type, list_type, map_traits >map_type;
+
+        map_type m( TestFixture::kSize, 4 );
+        this->test( m );
+    }
+
+    TYPED_TEST_P( MichaelMap, seq_cst )
+    {
+        typedef typename TestFixture::rcu_type rcu_type;
+        typedef typename TestFixture::key_type key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        struct list_traits : public cc::michael_list::traits
+        {
+            typedef typename TestFixture::less less;
+            typedef cds::backoff::pause back_off;
+            typedef cds::opt::v::sequential_consistent memory_model;
+        };
+        typedef cc::MichaelKVList< rcu_type, key_type, value_type, list_traits > list_type;
+
+        struct map_traits : public cc::michael_map::traits
+        {
+            typedef typename TestFixture::hash1 hash;
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cc::MichaelHashMap< rcu_type, list_type, map_traits >map_type;
+
+        map_type m( TestFixture::kSize, 4 );
+        this->test( m );
+    }
+
+
+    REGISTER_TYPED_TEST_CASE_P( MichaelMap,
+        compare, less, cmpmix, backoff, seq_cst
+    );
+}
+
+#endif // CDSUNIT_MAP_TEST_MICHAEL_MICHAEL_RCU_H
\ No newline at end of file