Migrated EllenBinTreeMap unit test to gtest framework
authorkhizmax <libcds.dev@gmail.com>
Sat, 16 Apr 2016 15:58:09 +0000 (18:58 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sat, 16 Apr 2016 15:58:09 +0000 (18:58 +0300)
20 files changed:
projects/Win/vc14/gtest-tree.vcxproj
projects/Win/vc14/gtest-tree.vcxproj.filters
test/unit/tree/CMakeLists.txt
test/unit/tree/ellen_bintree_map_dhp.cpp [new file with mode: 0644]
test/unit/tree/ellen_bintree_map_hp.cpp [new file with mode: 0644]
test/unit/tree/ellen_bintree_map_rcu_gpb.cpp [new file with mode: 0644]
test/unit/tree/ellen_bintree_map_rcu_gpi.cpp [new file with mode: 0644]
test/unit/tree/ellen_bintree_map_rcu_gpt.cpp [new file with mode: 0644]
test/unit/tree/ellen_bintree_map_rcu_shb.cpp [new file with mode: 0644]
test/unit/tree/ellen_bintree_map_rcu_sht.cpp [new file with mode: 0644]
test/unit/tree/ellen_bintree_set_dhp.cpp [new file with mode: 0644]
test/unit/tree/ellen_bintree_set_hp.cpp [new file with mode: 0644]
test/unit/tree/ellenbintree_set_dhp.cpp [deleted file]
test/unit/tree/ellenbintree_set_hp.cpp [deleted file]
test/unit/tree/test_ellen_bintree_map_rcu.h [new file with mode: 0644]
test/unit/tree/test_tree_map.h [new file with mode: 0644]
test/unit/tree/test_tree_map_data.h [new file with mode: 0644]
test/unit/tree/test_tree_map_hp.h [new file with mode: 0644]
test/unit/tree/test_tree_map_rcu.h [new file with mode: 0644]
test/unit/tree/test_tree_set.h

index 72712306b72d405319dadf1b740220b6e9b1648e..26d458ba9e5c0f7c12b1904c29dbc275c8574de9 100644 (file)
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\test\unit\main.cpp" />
-    <ClCompile Include="..\..\..\test\unit\tree\ellenbintree_set_dhp.cpp" />
-    <ClCompile Include="..\..\..\test\unit\tree\ellenbintree_set_hp.cpp" />
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_map_dhp.cpp" />
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_map_hp.cpp" />
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_map_rcu_gpb.cpp">
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4503</DisableSpecificWarnings>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_map_rcu_gpi.cpp">
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4503</DisableSpecificWarnings>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_map_rcu_gpt.cpp">
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">4503</DisableSpecificWarnings>
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4503</DisableSpecificWarnings>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_map_rcu_shb.cpp" />
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_map_rcu_sht.cpp" />
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_set_dhp.cpp" />
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_set_hp.cpp" />
     <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_set_rcu_gpb.cpp">
       <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503</DisableSpecificWarnings>
       <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">4503</DisableSpecificWarnings>
     <ClCompile Include="..\..\..\test\unit\tree\intrusive_ellenbintree_rcu_sht.cpp" />
   </ItemGroup>
   <ItemGroup>
+    <ClInclude Include="..\..\..\test\unit\tree\test_ellen_bintree_map_rcu.h" />
     <ClInclude Include="..\..\..\test\unit\tree\test_ellen_bintree_set_rcu.h" />
     <ClInclude Include="..\..\..\test\unit\tree\test_ellen_bintree_update_desc_pool.h" />
     <ClInclude Include="..\..\..\test\unit\tree\test_intrusive_ellen_bintree_rcu.h" />
     <ClInclude Include="..\..\..\test\unit\tree\test_intrusive_tree.h" />
     <ClInclude Include="..\..\..\test\unit\tree\test_intrusive_tree_hp.h" />
     <ClInclude Include="..\..\..\test\unit\tree\test_intrusive_tree_rcu.h" />
+    <ClInclude Include="..\..\..\test\unit\tree\test_tree_map.h" />
+    <ClInclude Include="..\..\..\test\unit\tree\test_tree_map_data.h" />
+    <ClInclude Include="..\..\..\test\unit\tree\test_tree_map_hp.h" />
+    <ClInclude Include="..\..\..\test\unit\tree\test_tree_map_rcu.h" />
     <ClInclude Include="..\..\..\test\unit\tree\test_tree_set.h" />
     <ClInclude Include="..\..\..\test\unit\tree\test_tree_set_hp.h" />
     <ClInclude Include="..\..\..\test\unit\tree\test_tree_set_rcu.h" />
index ebec5344b085291ff1a9fba920a052a58c0b7c05..04681082e0eed204be861912883a9eef11ae5f69 100644 (file)
@@ -19,6 +19,9 @@
     <Filter Include="Source Files\EllenBinTreeSet">
       <UniqueIdentifier>{9fc83943-2620-4528-a704-d3765f52522b}</UniqueIdentifier>
     </Filter>
+    <Filter Include="Source Files\EllenBinTreeMap">
+      <UniqueIdentifier>{5e8e3c4d-563e-41fd-91ed-52f61f4b7d24}</UniqueIdentifier>
+    </Filter>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\test\unit\tree\intrusive_ellenbintree_dhp.cpp">
     <ClCompile Include="..\..\..\test\unit\tree\intrusive_ellenbintree_rcu_sht.cpp">
       <Filter>Source Files\intrusive.EllenBinTree</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\..\test\unit\tree\ellenbintree_set_hp.cpp">
-      <Filter>Source Files\EllenBinTreeSet</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\..\test\unit\main.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_update_desc_pool.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\..\test\unit\tree\ellenbintree_set_dhp.cpp">
-      <Filter>Source Files\EllenBinTreeSet</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_set_rcu_gpb.cpp">
       <Filter>Source Files\EllenBinTreeSet</Filter>
     </ClCompile>
     <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_set_rcu_sht.cpp">
       <Filter>Source Files\EllenBinTreeSet</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_set_dhp.cpp">
+      <Filter>Source Files\EllenBinTreeSet</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_set_hp.cpp">
+      <Filter>Source Files\EllenBinTreeSet</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_map_hp.cpp">
+      <Filter>Source Files\EllenBinTreeMap</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_map_dhp.cpp">
+      <Filter>Source Files\EllenBinTreeMap</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_map_rcu_gpb.cpp">
+      <Filter>Source Files\EllenBinTreeMap</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_map_rcu_gpi.cpp">
+      <Filter>Source Files\EllenBinTreeMap</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_map_rcu_gpt.cpp">
+      <Filter>Source Files\EllenBinTreeMap</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_map_rcu_shb.cpp">
+      <Filter>Source Files\EllenBinTreeMap</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\test\unit\tree\ellen_bintree_map_rcu_sht.cpp">
+      <Filter>Source Files\EllenBinTreeMap</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\test\unit\tree\test_intrusive_tree.h">
     <ClInclude Include="..\..\..\test\unit\tree\test_ellen_bintree_set_rcu.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\test\unit\tree\test_tree_map.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\test\unit\tree\test_tree_map_data.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\test\unit\tree\test_tree_map_hp.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\test\unit\tree\test_tree_map_rcu.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\test\unit\tree\test_ellen_bintree_map_rcu.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
 </Project>
\ No newline at end of file
index 2406a48b0f2771361a6fd1eaa217897318fe05ae..c1c066d9d5e392b39c19687b174c8f9236fcaef8 100644 (file)
@@ -5,8 +5,15 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof")
 set(CDSGTEST_TREE_SOURCES
     ../main.cpp
     ellen_bintree_update_desc_pool.cpp
-    ellenbintree_set_dhp.cpp
-    ellenbintree_set_hp.cpp
+    ellen_bintree_map_hp.cpp
+    ellen_bintree_map_dhp.cpp
+    ellen_bintree_map_rcu_gpb.cpp
+    ellen_bintree_map_rcu_gpi.cpp
+    ellen_bintree_map_rcu_gpt.cpp
+    ellen_bintree_map_rcu_shb.cpp
+    ellen_bintree_map_rcu_sht.cpp
+    ellen_bintree_set_dhp.cpp
+    ellen_bintree_set_hp.cpp
     ellen_bintree_set_rcu_gpb.cpp
     ellen_bintree_set_rcu_gpi.cpp
     ellen_bintree_set_rcu_gpt.cpp
diff --git a/test/unit/tree/ellen_bintree_map_dhp.cpp b/test/unit/tree/ellen_bintree_map_dhp.cpp
new file mode 100644 (file)
index 0000000..5f717cb
--- /dev/null
@@ -0,0 +1,202 @@
+/*
+    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_tree_map_hp.h"
+
+#include <cds/container/ellen_bintree_map_dhp.h>
+#include "test_ellen_bintree_update_desc_pool.h"
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::DHP gc_type;
+
+    class EllenBinTreeMap_DHP : public cds_test::container_tree_map_hp
+    {
+    protected:
+        typedef cds_test::container_tree_map_hp base_class;
+
+        void SetUp()
+        {
+            typedef cc::EllenBinTreeMap< gc_type, key_type, value_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( EllenBinTreeMap_DHP, compare )
+    {
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
+            typename cc::ellen_bintree::make_map_traits<
+                cds::opt::compare< cmp >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_DHP, less )
+    {
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
+            typename cc::ellen_bintree::make_map_traits<
+                cds::opt::less< base_class::less >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_DHP, cmpmix )
+    {
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
+            typename cc::ellen_bintree::make_map_traits<
+                cds::opt::less< base_class::less >
+                ,cds::opt::compare< cmp >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_DHP, update_desc_pool )
+    {
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef cmp compare;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_DHP, update_desc_lazy_pool )
+    {
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef cmp compare;
+            typedef cds::memory::pool_allocator< cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_DHP, item_counting )
+    {
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_DHP, backoff )
+    {
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_DHP, stat )
+    {
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cc::ellen_bintree::stat<> stat;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_DHP, copy_policy )
+    {
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+            typedef copy_key copy_policy;
+        };
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_DHP, seq_cst )
+    {
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef cmp compare;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
+            typedef cds::opt::v::sequential_consistent memory_model;
+        };
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+} // namespace
diff --git a/test/unit/tree/ellen_bintree_map_hp.cpp b/test/unit/tree/ellen_bintree_map_hp.cpp
new file mode 100644 (file)
index 0000000..07e0b5e
--- /dev/null
@@ -0,0 +1,203 @@
+/*
+    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_tree_map_hp.h"
+
+#include <cds/container/ellen_bintree_map_hp.h>
+#include "test_ellen_bintree_update_desc_pool.h"
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::HP gc_type;
+
+    class EllenBinTreeMap_HP : public cds_test::container_tree_map_hp
+    {
+    protected:
+        typedef cds_test::container_tree_map_hp base_class;
+
+        void SetUp()
+        {
+            typedef cc::EllenBinTreeMap< gc_type, key_type, value_type > map_type;
+
+            // +1 - for guarded_ptr
+            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( EllenBinTreeMap_HP, compare )
+    {
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
+            typename cc::ellen_bintree::make_map_traits<
+                cds::opt::compare< cmp >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_HP, less )
+    {
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
+            typename cc::ellen_bintree::make_map_traits<
+                cds::opt::less< base_class::less >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_HP, cmpmix )
+    {
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type,
+            typename cc::ellen_bintree::make_map_traits<
+                cds::opt::less< base_class::less >
+                ,cds::opt::compare< cmp >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_HP, update_desc_pool )
+    {
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef cmp compare;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_HP, update_desc_lazy_pool )
+    {
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef cmp compare;
+            typedef cds::memory::pool_allocator< cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_HP, item_counting )
+    {
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_HP, backoff )
+    {
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_HP, stat )
+    {
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cc::ellen_bintree::stat<> stat;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_HP, copy_policy )
+    {
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+            typedef copy_key copy_policy;
+        };
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( EllenBinTreeMap_HP, seq_cst )
+    {
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef cmp compare;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
+            typedef cds::opt::v::sequential_consistent memory_model;
+        };
+        typedef cc::EllenBinTreeMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+} // namespace
diff --git a/test/unit/tree/ellen_bintree_map_rcu_gpb.cpp b/test/unit/tree/ellen_bintree_map_rcu_gpb.cpp
new file mode 100644 (file)
index 0000000..d844cad
--- /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_ellen_bintree_map_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::general_buffered<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPB, EllenBinTreeMap, rcu_implementation );
diff --git a/test/unit/tree/ellen_bintree_map_rcu_gpi.cpp b/test/unit/tree/ellen_bintree_map_rcu_gpi.cpp
new file mode 100644 (file)
index 0000000..077f98f
--- /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_ellen_bintree_map_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::general_instant<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPI, EllenBinTreeMap, rcu_implementation );
diff --git a/test/unit/tree/ellen_bintree_map_rcu_gpt.cpp b/test/unit/tree/ellen_bintree_map_rcu_gpt.cpp
new file mode 100644 (file)
index 0000000..fc9b9a1
--- /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_ellen_bintree_map_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::general_threaded<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPT, EllenBinTreeMap, rcu_implementation );
diff --git a/test/unit/tree/ellen_bintree_map_rcu_shb.cpp b/test/unit/tree/ellen_bintree_map_rcu_shb.cpp
new file mode 100644 (file)
index 0000000..3466a1c
--- /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_ellen_bintree_map_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::signal_buffered<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_SHB, EllenBinTreeMap, rcu_implementation );
+
+#endif // CDS_URCU_SIGNAL_HANDLING_ENABLED
diff --git a/test/unit/tree/ellen_bintree_map_rcu_sht.cpp b/test/unit/tree/ellen_bintree_map_rcu_sht.cpp
new file mode 100644 (file)
index 0000000..c284c27
--- /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_ellen_bintree_map_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::signal_threaded<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_SHT, EllenBinTreeMap, rcu_implementation );
+
+#endif // CDS_URCU_SIGNAL_HANDLING_ENABLED
diff --git a/test/unit/tree/ellen_bintree_set_dhp.cpp b/test/unit/tree/ellen_bintree_set_dhp.cpp
new file mode 100644 (file)
index 0000000..1e7dc06
--- /dev/null
@@ -0,0 +1,180 @@
+/*
+    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_tree_set_hp.h"
+
+#include <cds/container/ellen_bintree_set_dhp.h>
+#include "test_ellen_bintree_update_desc_pool.h"
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::DHP gc_type;
+
+    class EllenBinTreeSet_DHP : public cds_test::container_tree_set_hp
+    {
+    protected:
+        typedef cds_test::container_tree_set_hp base_class;
+        typedef int key_type;
+
+        struct generic_traits: public cc::ellen_bintree::traits
+        {
+            typedef base_class::key_extractor key_extractor;
+        };
+
+        void SetUp()
+        {
+            typedef cc::EllenBinTreeSet< gc_type, key_type, int_item > set_type;
+
+            cds::gc::dhp::GarbageCollector::Construct( 16, set_type::c_nHazardPtrCount );
+            cds::threading::Manager::attachThread();
+        }
+
+        void TearDown()
+        {
+            cds::threading::Manager::detachThread();
+            cds::gc::hp::GarbageCollector::Destruct();
+        }
+    };
+
+
+    TEST_F( EllenBinTreeSet_DHP, compare )
+    {
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item,
+            typename cc::ellen_bintree::make_set_traits<
+                cc::opt::type_traits< generic_traits >
+                ,cds::opt::compare< cmp >
+            >::type
+        > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( EllenBinTreeSet_DHP, less )
+    {
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item,
+            typename cc::ellen_bintree::make_set_traits<
+                cc::opt::type_traits< generic_traits >
+                ,cds::opt::less< base_class::less >
+            >::type
+        > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( EllenBinTreeSet_DHP, cmpmix )
+    {
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item,
+            typename cc::ellen_bintree::make_set_traits<
+                cc::opt::type_traits< generic_traits >
+                ,cds::opt::less< base_class::less >
+                ,cds::opt::compare< cmp >
+            >::type
+        > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( EllenBinTreeSet_DHP, update_desc_pool )
+    {
+        struct set_traits: public generic_traits
+        {
+            typedef cmp compare;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( EllenBinTreeSet_DHP, update_desc_lazy_pool )
+    {
+        struct set_traits: public generic_traits
+        {
+            typedef cmp compare;
+            typedef cds::memory::pool_allocator< cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( EllenBinTreeSet_DHP, item_counting )
+    {
+        struct set_traits: public generic_traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( EllenBinTreeSet_DHP, backoff )
+    {
+        struct set_traits: public generic_traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( EllenBinTreeSet_DHP, stat )
+    {
+        struct set_traits: public generic_traits
+        {
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cc::ellen_bintree::stat<> stat;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+} // namespace
diff --git a/test/unit/tree/ellen_bintree_set_hp.cpp b/test/unit/tree/ellen_bintree_set_hp.cpp
new file mode 100644 (file)
index 0000000..1152288
--- /dev/null
@@ -0,0 +1,181 @@
+/*
+    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_tree_set_hp.h"
+
+#include <cds/container/ellen_bintree_set_hp.h>
+#include "test_ellen_bintree_update_desc_pool.h"
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::HP gc_type;
+
+    class EllenBinTreeSet_HP : public cds_test::container_tree_set_hp
+    {
+    protected:
+        typedef cds_test::container_tree_set_hp base_class;
+        typedef int key_type;
+
+        struct generic_traits: public cc::ellen_bintree::traits
+        {
+            typedef base_class::key_extractor key_extractor;
+        };
+
+        void SetUp()
+        {
+            typedef cc::EllenBinTreeSet< gc_type, key_type, int_item > set_type;
+
+            // +1 - for guarded_ptr
+            cds::gc::hp::GarbageCollector::Construct( set_type::c_nHazardPtrCount + 1, 1, 16 );
+            cds::threading::Manager::attachThread();
+        }
+
+        void TearDown()
+        {
+            cds::threading::Manager::detachThread();
+            cds::gc::hp::GarbageCollector::Destruct( true );
+        }
+    };
+
+
+    TEST_F( EllenBinTreeSet_HP, compare )
+    {
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item,
+            typename cc::ellen_bintree::make_set_traits<
+                cc::opt::type_traits< generic_traits >
+                ,cds::opt::compare< cmp >
+            >::type
+        > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( EllenBinTreeSet_HP, less )
+    {
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item,
+            typename cc::ellen_bintree::make_set_traits<
+                cc::opt::type_traits< generic_traits >
+                ,cds::opt::less< base_class::less >
+            >::type
+        > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( EllenBinTreeSet_HP, cmpmix )
+    {
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item,
+            typename cc::ellen_bintree::make_set_traits<
+                cc::opt::type_traits< generic_traits >
+                ,cds::opt::less< base_class::less >
+                ,cds::opt::compare< cmp >
+            >::type
+        > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( EllenBinTreeSet_HP, update_desc_pool )
+    {
+        struct set_traits: public generic_traits
+        {
+            typedef cmp compare;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( EllenBinTreeSet_HP, update_desc_lazy_pool )
+    {
+        struct set_traits: public generic_traits
+        {
+            typedef cmp compare;
+            typedef cds::memory::pool_allocator< cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( EllenBinTreeSet_HP, item_counting )
+    {
+        struct set_traits: public generic_traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( EllenBinTreeSet_HP, backoff )
+    {
+        struct set_traits: public generic_traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( EllenBinTreeSet_HP, stat )
+    {
+        struct set_traits: public generic_traits
+        {
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cc::ellen_bintree::stat<> stat;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+} // namespace
diff --git a/test/unit/tree/ellenbintree_set_dhp.cpp b/test/unit/tree/ellenbintree_set_dhp.cpp
deleted file mode 100644 (file)
index 1e7dc06..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
-    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_tree_set_hp.h"
-
-#include <cds/container/ellen_bintree_set_dhp.h>
-#include "test_ellen_bintree_update_desc_pool.h"
-
-namespace {
-    namespace cc = cds::container;
-    typedef cds::gc::DHP gc_type;
-
-    class EllenBinTreeSet_DHP : public cds_test::container_tree_set_hp
-    {
-    protected:
-        typedef cds_test::container_tree_set_hp base_class;
-        typedef int key_type;
-
-        struct generic_traits: public cc::ellen_bintree::traits
-        {
-            typedef base_class::key_extractor key_extractor;
-        };
-
-        void SetUp()
-        {
-            typedef cc::EllenBinTreeSet< gc_type, key_type, int_item > set_type;
-
-            cds::gc::dhp::GarbageCollector::Construct( 16, set_type::c_nHazardPtrCount );
-            cds::threading::Manager::attachThread();
-        }
-
-        void TearDown()
-        {
-            cds::threading::Manager::detachThread();
-            cds::gc::hp::GarbageCollector::Destruct();
-        }
-    };
-
-
-    TEST_F( EllenBinTreeSet_DHP, compare )
-    {
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item,
-            typename cc::ellen_bintree::make_set_traits<
-                cc::opt::type_traits< generic_traits >
-                ,cds::opt::compare< cmp >
-            >::type
-        > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-    TEST_F( EllenBinTreeSet_DHP, less )
-    {
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item,
-            typename cc::ellen_bintree::make_set_traits<
-                cc::opt::type_traits< generic_traits >
-                ,cds::opt::less< base_class::less >
-            >::type
-        > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-    TEST_F( EllenBinTreeSet_DHP, cmpmix )
-    {
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item,
-            typename cc::ellen_bintree::make_set_traits<
-                cc::opt::type_traits< generic_traits >
-                ,cds::opt::less< base_class::less >
-                ,cds::opt::compare< cmp >
-            >::type
-        > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-    TEST_F( EllenBinTreeSet_DHP, update_desc_pool )
-    {
-        struct set_traits: public generic_traits
-        {
-            typedef cmp compare;
-            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
-        };
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-    TEST_F( EllenBinTreeSet_DHP, update_desc_lazy_pool )
-    {
-        struct set_traits: public generic_traits
-        {
-            typedef cmp compare;
-            typedef cds::memory::pool_allocator< cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
-        };
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-    TEST_F( EllenBinTreeSet_DHP, item_counting )
-    {
-        struct set_traits: public generic_traits
-        {
-            typedef cmp compare;
-            typedef base_class::less less;
-            typedef cds::atomicity::item_counter item_counter;
-            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
-        };
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-    TEST_F( EllenBinTreeSet_DHP, backoff )
-    {
-        struct set_traits: public generic_traits
-        {
-            typedef cmp compare;
-            typedef base_class::less less;
-            typedef cds::atomicity::item_counter item_counter;
-            typedef cds::backoff::yield back_off;
-            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
-        };
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-    TEST_F( EllenBinTreeSet_DHP, stat )
-    {
-        struct set_traits: public generic_traits
-        {
-            typedef base_class::less less;
-            typedef cds::atomicity::item_counter item_counter;
-            typedef cds::backoff::yield back_off;
-            typedef cc::ellen_bintree::stat<> stat;
-            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
-        };
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-} // namespace
diff --git a/test/unit/tree/ellenbintree_set_hp.cpp b/test/unit/tree/ellenbintree_set_hp.cpp
deleted file mode 100644 (file)
index 1152288..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
-    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_tree_set_hp.h"
-
-#include <cds/container/ellen_bintree_set_hp.h>
-#include "test_ellen_bintree_update_desc_pool.h"
-
-namespace {
-    namespace cc = cds::container;
-    typedef cds::gc::HP gc_type;
-
-    class EllenBinTreeSet_HP : public cds_test::container_tree_set_hp
-    {
-    protected:
-        typedef cds_test::container_tree_set_hp base_class;
-        typedef int key_type;
-
-        struct generic_traits: public cc::ellen_bintree::traits
-        {
-            typedef base_class::key_extractor key_extractor;
-        };
-
-        void SetUp()
-        {
-            typedef cc::EllenBinTreeSet< gc_type, key_type, int_item > set_type;
-
-            // +1 - for guarded_ptr
-            cds::gc::hp::GarbageCollector::Construct( set_type::c_nHazardPtrCount + 1, 1, 16 );
-            cds::threading::Manager::attachThread();
-        }
-
-        void TearDown()
-        {
-            cds::threading::Manager::detachThread();
-            cds::gc::hp::GarbageCollector::Destruct( true );
-        }
-    };
-
-
-    TEST_F( EllenBinTreeSet_HP, compare )
-    {
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item,
-            typename cc::ellen_bintree::make_set_traits<
-                cc::opt::type_traits< generic_traits >
-                ,cds::opt::compare< cmp >
-            >::type
-        > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-    TEST_F( EllenBinTreeSet_HP, less )
-    {
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item,
-            typename cc::ellen_bintree::make_set_traits<
-                cc::opt::type_traits< generic_traits >
-                ,cds::opt::less< base_class::less >
-            >::type
-        > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-    TEST_F( EllenBinTreeSet_HP, cmpmix )
-    {
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item,
-            typename cc::ellen_bintree::make_set_traits<
-                cc::opt::type_traits< generic_traits >
-                ,cds::opt::less< base_class::less >
-                ,cds::opt::compare< cmp >
-            >::type
-        > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-    TEST_F( EllenBinTreeSet_HP, update_desc_pool )
-    {
-        struct set_traits: public generic_traits
-        {
-            typedef cmp compare;
-            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
-        };
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-    TEST_F( EllenBinTreeSet_HP, update_desc_lazy_pool )
-    {
-        struct set_traits: public generic_traits
-        {
-            typedef cmp compare;
-            typedef cds::memory::pool_allocator< cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
-        };
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-    TEST_F( EllenBinTreeSet_HP, item_counting )
-    {
-        struct set_traits: public generic_traits
-        {
-            typedef cmp compare;
-            typedef base_class::less less;
-            typedef cds::atomicity::item_counter item_counter;
-            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
-        };
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-    TEST_F( EllenBinTreeSet_HP, backoff )
-    {
-        struct set_traits: public generic_traits
-        {
-            typedef cmp compare;
-            typedef base_class::less less;
-            typedef cds::atomicity::item_counter item_counter;
-            typedef cds::backoff::yield back_off;
-            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
-        };
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-    TEST_F( EllenBinTreeSet_HP, stat )
-    {
-        struct set_traits: public generic_traits
-        {
-            typedef base_class::less less;
-            typedef cds::atomicity::item_counter item_counter;
-            typedef cds::backoff::yield back_off;
-            typedef cc::ellen_bintree::stat<> stat;
-            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
-        };
-        typedef cc::EllenBinTreeSet< gc_type, key_type, int_item, set_traits > set_type;
-
-        set_type s;
-        test( s );
-    }
-
-} // namespace
diff --git a/test/unit/tree/test_ellen_bintree_map_rcu.h b/test/unit/tree/test_ellen_bintree_map_rcu.h
new file mode 100644 (file)
index 0000000..746cac6
--- /dev/null
@@ -0,0 +1,234 @@
+/*
+    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_TREE_TEST_ELLEN_BINTREE_MAP_RCU_H
+#define CDSUNIT_TREE_TEST_ELLEN_BINTREE_MAP_RCU_H
+
+#include "test_tree_map_rcu.h"
+#include <cds/container/ellen_bintree_map_rcu.h>
+#include "test_ellen_bintree_update_desc_pool.h"
+
+namespace {
+    namespace cc = cds::container;
+
+    template <class RCU>
+    class EllenBinTreeMap: public cds_test::container_tree_map_rcu
+    {
+        typedef cds_test::container_tree_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( EllenBinTreeMap );
+
+    TYPED_TEST_P( EllenBinTreeMap, compare )
+    {
+        typedef typename TestFixture::rcu_type   rcu_type;
+        typedef typename TestFixture::key_type   key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
+            typename cc::ellen_bintree::make_map_traits<
+                cds::opt::compare< typename TestFixture::cmp >
+            >::type
+        > map_type;
+
+        map_type m;
+        this->test( m );
+    }
+
+    TYPED_TEST_P( EllenBinTreeMap, less )
+    {
+        typedef typename TestFixture::rcu_type   rcu_type;
+        typedef typename TestFixture::key_type   key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
+            typename cc::ellen_bintree::make_map_traits<
+                cds::opt::less< typename TestFixture::less >
+            >::type
+        > map_type;
+
+        map_type m;
+        this->test( m );
+    }
+
+    TYPED_TEST_P( EllenBinTreeMap, update_desc_pool )
+    {
+        typedef typename TestFixture::rcu_type   rcu_type;
+        typedef typename TestFixture::key_type   key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
+            typename cc::ellen_bintree::make_map_traits<
+                cds::opt::less< typename TestFixture::less >
+                ,cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor>>
+            >::type
+        > map_type;
+
+        map_type m;
+        this->test( m );
+    }
+
+    TYPED_TEST_P( EllenBinTreeMap, update_desc_lazy_pool )
+    {
+        typedef typename TestFixture::rcu_type   rcu_type;
+        typedef typename TestFixture::key_type   key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
+            typename cc::ellen_bintree::make_map_traits<
+                cds::opt::less< typename TestFixture::less >
+                , cc::ellen_bintree::update_desc_allocator< cds::memory::pool_allocator<cds_test::update_desc, cds_test::lazy_pool_accessor>>
+            >::type
+        > map_type;
+
+            map_type m;
+            this->test( m );
+    }
+
+    TYPED_TEST_P( EllenBinTreeMap, cmpmix )
+    {
+        typedef typename TestFixture::rcu_type   rcu_type;
+        typedef typename TestFixture::key_type   key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type,
+            typename cc::ellen_bintree::make_map_traits<
+                cds::opt::less< typename TestFixture::less >
+                ,cds::opt::compare< typename TestFixture::cmp >
+            >::type
+        > map_type;
+
+        map_type m;
+        this->test( m );
+    }
+
+    TYPED_TEST_P( EllenBinTreeMap, item_counting )
+    {
+        typedef typename TestFixture::rcu_type   rcu_type;
+        typedef typename TestFixture::key_type   key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef typename TestFixture::cmp compare;
+            typedef typename TestFixture::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        this->test( m );
+    }
+
+    TYPED_TEST_P( EllenBinTreeMap, backoff )
+    {
+        typedef typename TestFixture::rcu_type   rcu_type;
+        typedef typename TestFixture::key_type   key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef typename TestFixture::cmp compare;
+            typedef typename TestFixture::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        this->test( m );
+    }
+
+    TYPED_TEST_P( EllenBinTreeMap, stat )
+    {
+        typedef typename TestFixture::rcu_type   rcu_type;
+        typedef typename TestFixture::key_type   key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef typename TestFixture::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cc::ellen_bintree::stat<> stat;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::pool_accessor> update_desc_allocator;
+        };
+        typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        this->test( m );
+    }
+
+    TYPED_TEST_P( EllenBinTreeMap, copy_policy )
+    {
+        typedef typename TestFixture::rcu_type   rcu_type;
+        typedef typename TestFixture::key_type   key_type;
+        typedef typename TestFixture::value_type value_type;
+
+        struct map_traits: public cc::ellen_bintree::traits
+        {
+            typedef typename TestFixture::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cc::ellen_bintree::stat<> stat;
+            typedef cds::memory::pool_allocator<cds_test::update_desc, cds_test::lazy_pool_accessor> update_desc_allocator;
+            typedef typename TestFixture::copy_key copy_policy;
+        };
+        typedef cc::EllenBinTreeMap< rcu_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        this->test( m );
+    }
+
+    REGISTER_TYPED_TEST_CASE_P( EllenBinTreeMap,
+        compare, less, update_desc_pool, update_desc_lazy_pool, cmpmix, item_counting, backoff, stat, copy_policy
+    );
+
+} // namespace
+
+#endif // CDSUNIT_TREE_TEST_ELLEN_BINTREE_MAP_RCU_H
\ No newline at end of file
diff --git a/test/unit/tree/test_tree_map.h b/test/unit/tree/test_tree_map.h
new file mode 100644 (file)
index 0000000..1733c98
--- /dev/null
@@ -0,0 +1,388 @@
+/*
+    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_TREE_TEST_TREE_MAP_H
+#define CDSUNIT_TREE_TEST_TREE_MAP_H
+
+#include "test_tree_map_data.h"
+
+// forward declaration
+namespace cds { namespace container {} }
+
+namespace cds_test {
+
+    class container_tree_map: public tree_map_fixture
+    {
+    public:
+        static size_t const kSize = 1000;
+
+    protected:
+        template <class Map>
+        void test( Map& m )
+        {
+            // Precondition: map is empty
+            // Postcondition: map is empty
+
+            ASSERT_TRUE( m.empty());
+            ASSERT_CONTAINER_SIZE( m, 0 );
+
+            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>(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 );
+            }
+
+            // insert/find
+            for ( auto const& i : arrKeys ) {
+                value_type const& val( arrVals.at( i.nKey ));
+
+                ASSERT_FALSE( m.contains( i.nKey ));
+                ASSERT_FALSE( m.contains( i ));
+                ASSERT_FALSE( m.contains( other_item( i.nKey ), other_less()));
+                ASSERT_FALSE( m.find( i, []( map_pair const& ) {
+                    ASSERT_TRUE( false );
+                } ));
+                ASSERT_FALSE( m.find( i.nKey, []( map_pair const& ) {
+                    EXPECT_TRUE( false );
+                } ));
+                ASSERT_FALSE( m.find_with( other_item( i.nKey ), other_less(), []( map_pair const& ) {
+                    EXPECT_TRUE( false );
+                } ));
+
+                std::pair< bool, bool > updResult;
+
+                switch ( i.nKey % 16 ) {
+                case 0:
+                    ASSERT_TRUE( m.insert( i ));
+                    ASSERT_FALSE( m.insert( i ));
+                    ASSERT_TRUE( m.find( i.nKey, []( map_pair& v ) {
+                        v.second.nVal = v.first.nKey;
+                        v.second.strVal = std::to_string( v.first.nKey );
+                    } ));
+                    break;
+                case 1:
+                    ASSERT_TRUE( m.insert( i.nKey ));
+                    ASSERT_FALSE( m.insert( i.nKey ));
+                    ASSERT_TRUE( m.find( i.nKey, []( map_pair& v ) {
+                        v.second.nVal = v.first.nKey;
+                        v.second.strVal = std::to_string( v.first.nKey );
+                    } ));
+                    break;
+                case 2:
+                    ASSERT_TRUE( m.insert( std::to_string( i.nKey )));
+                    ASSERT_FALSE( m.insert( std::to_string( i.nKey )));
+                    ASSERT_TRUE( m.find( i.nKey, []( map_pair& v ) {
+                        v.second.nVal = v.first.nKey;
+                        v.second.strVal = std::to_string( v.first.nKey );
+                    } ));
+                    break;
+                case 3:
+                    ASSERT_TRUE( m.insert( i, val ));
+                    ASSERT_FALSE( m.insert( i, val ));
+                    break;
+                case 4:
+                    ASSERT_TRUE( m.insert( i.nKey, val.strVal ));
+                    ASSERT_FALSE( m.insert( i.nKey, val.strVal ));
+                    break;
+                case 5:
+                    ASSERT_TRUE( m.insert( val.strVal, i.nKey ));
+                    ASSERT_FALSE( m.insert( val.strVal, i.nKey ));
+                    break;
+                case 6:
+                    ASSERT_TRUE( m.insert_with( i, []( map_pair& v ) {
+                        v.second.nVal = v.first.nKey;
+                        v.second.strVal = std::to_string( v.first.nKey );
+                    } ));
+                    ASSERT_FALSE( m.insert_with( i, []( map_pair& v ) {
+                        EXPECT_TRUE( false );
+                    } ));
+                    break;
+                case 7:
+                    ASSERT_TRUE( m.insert_with( i.nKey, []( map_pair& v ) {
+                        v.second.nVal = v.first.nKey;
+                        v.second.strVal = std::to_string( v.first.nKey );
+                    } ));
+                    ASSERT_FALSE( m.insert_with( i.nKey, []( map_pair& v ) {
+                        EXPECT_TRUE( false );
+                    } ));
+                    break;
+                case 8:
+                    ASSERT_TRUE( m.insert_with( val.strVal, []( map_pair& v ) {
+                        v.second.nVal = v.first.nKey;
+                        v.second.strVal = std::to_string( v.first.nKey );
+                    } ));
+                    ASSERT_FALSE( m.insert_with( val.strVal, []( map_pair& v ) {
+                        EXPECT_TRUE( false );
+                    } ));
+                    break;
+                case 9:
+                    updResult = m.update( i.nKey, []( bool, map_pair& ) {
+                        EXPECT_TRUE( false );
+                    }, false );
+                    ASSERT_FALSE( updResult.first );
+                    ASSERT_FALSE( updResult.second );
+
+                    updResult = m.update( i.nKey, []( bool bNew, map_pair& v ) {
+                        EXPECT_TRUE( bNew );
+                        v.second.nVal = v.first.nKey;
+                    });
+                    ASSERT_TRUE( updResult.first );
+                    ASSERT_TRUE( updResult.second );
+
+                    updResult = m.update( i.nKey, []( bool bNew, map_pair& v ) {
+                        EXPECT_FALSE( bNew );
+                        EXPECT_EQ( v.first.nKey, v.second.nVal );
+                        v.second.strVal = std::to_string( v.second.nVal );
+                    } );
+                    ASSERT_TRUE( updResult.first );
+                    ASSERT_FALSE( updResult.second );
+                    break;
+                case 10:
+                    updResult = m.update( i, []( bool, map_pair& ) {
+                        EXPECT_TRUE( false );
+                    }, false );
+                    ASSERT_FALSE( updResult.first );
+                    ASSERT_FALSE( updResult.second );
+
+                    updResult = m.update( i, []( bool bNew, map_pair& v ) {
+                        EXPECT_TRUE( bNew );
+                        v.second.nVal = v.first.nKey;
+                    });
+                    ASSERT_TRUE( updResult.first );
+                    ASSERT_TRUE( updResult.second );
+
+                    updResult = m.update( i, []( bool bNew, map_pair& v ) {
+                        EXPECT_FALSE( bNew );
+                        EXPECT_EQ( v.first.nKey, v.second.nVal );
+                        v.second.strVal = std::to_string( v.second.nVal );
+                    } );
+                    ASSERT_TRUE( updResult.first );
+                    ASSERT_FALSE( updResult.second );
+                    break;
+                case 11:
+                    updResult = m.update( val.strVal, []( bool, map_pair& ) {
+                        EXPECT_TRUE( false );
+                    }, false );
+                    ASSERT_FALSE( updResult.first );
+                    ASSERT_FALSE( updResult.second );
+
+                    updResult = m.update( val.strVal, []( bool bNew, map_pair& v ) {
+                        EXPECT_TRUE( bNew );
+                        v.second.nVal = v.first.nKey;
+                    });
+                    ASSERT_TRUE( updResult.first );
+                    ASSERT_TRUE( updResult.second );
+
+                    updResult = m.update( val.strVal, []( bool bNew, map_pair& v ) {
+                        EXPECT_FALSE( bNew );
+                        EXPECT_EQ( v.first.nKey, v.second.nVal );
+                        v.second.strVal = std::to_string( v.second.nVal );
+                    } );
+                    ASSERT_TRUE( updResult.first );
+                    ASSERT_FALSE( updResult.second );
+                    break;
+                case 12:
+                    ASSERT_TRUE( m.emplace( i.nKey ));
+                    ASSERT_FALSE( m.emplace( i.nKey ));
+                    ASSERT_TRUE( m.find( i.nKey, []( map_pair& v ) {
+                        v.second.nVal = v.first.nKey;
+                        v.second.strVal = std::to_string( v.first.nKey );
+                    } ));
+                    break;
+                case 13:
+                    ASSERT_TRUE( m.emplace( i, i.nKey ));
+                    ASSERT_FALSE( m.emplace( i, i.nKey ));
+                    break;
+                case 14:
+                    {
+                        std::string str = val.strVal;
+                        ASSERT_TRUE( m.emplace( i, std::move( str )));
+                        ASSERT_TRUE( str.empty());
+                        str = val.strVal;
+                        ASSERT_FALSE( m.emplace( i, std::move( str )));
+                        ASSERT_TRUE( str.empty());
+                    }
+                    break;
+                case 15:
+                    {
+                        std::string str = val.strVal;
+                        ASSERT_TRUE( m.emplace( i, i.nKey, std::move( str )));
+                        ASSERT_TRUE( str.empty());
+                        str = val.strVal;
+                        ASSERT_FALSE( m.emplace( i, i.nKey, std::move( str )));
+                        ASSERT_TRUE( str.empty());
+                    }
+                    break;
+                }
+
+                ASSERT_TRUE( m.contains( i.nKey ));
+                ASSERT_TRUE( m.contains( i ));
+                ASSERT_TRUE( m.contains( other_item( i.nKey ), other_less()));
+                ASSERT_TRUE( m.find( i, []( map_pair const& v ) {
+                    EXPECT_EQ( v.first.nKey, v.second.nVal );
+                    EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                } ));
+                ASSERT_TRUE( m.find( i.nKey, []( map_pair const& v ) {
+                    EXPECT_EQ( v.first.nKey, v.second.nVal );
+                    EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                } ));
+                ASSERT_TRUE( m.find_with( other_item( i.nKey ), other_less(), []( map_pair const& v ) {
+                    EXPECT_EQ( v.first.nKey, v.second.nVal );
+                    EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                } ));
+            }
+            ASSERT_FALSE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, kkSize );
+
+            ASSERT_TRUE( m.check_consistency());
+
+            shuffle( arrKeys.begin(), arrKeys.end() );
+
+            // erase/find
+            for ( auto const& i : arrKeys ) {
+                value_type const& val( arrVals.at( i.nKey ) );
+
+                ASSERT_TRUE( m.contains( i.nKey ));
+                ASSERT_TRUE( m.contains( val.strVal ) );
+                ASSERT_TRUE( m.contains( i ));
+                ASSERT_TRUE( m.contains( other_item( i.nKey ), other_less()));
+                ASSERT_TRUE( m.find( i, []( map_pair const& v ) {
+                    EXPECT_EQ( v.first.nKey, v.second.nVal );
+                    EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                } ));
+                ASSERT_TRUE( m.find( i.nKey, []( map_pair const& v ) {
+                    EXPECT_EQ( v.first.nKey, v.second.nVal );
+                    EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                } ));
+                ASSERT_TRUE( m.find_with( other_item( i.nKey ), other_less(), []( map_pair const& v ) {
+                    EXPECT_EQ( v.first.nKey, v.second.nVal );
+                    EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                } ));
+
+
+                switch ( i.nKey % 8 ) {
+                case 0:
+                    ASSERT_TRUE( m.erase( i ));
+                    ASSERT_FALSE( m.erase( i ));
+                    break;
+                case 1:
+                    ASSERT_TRUE( m.erase( i.nKey ));
+                    ASSERT_FALSE( m.erase( i.nKey ));
+                    break;
+                case 2:
+                    ASSERT_TRUE( m.erase( val.strVal ));
+                    ASSERT_FALSE( m.erase( val.strVal ));
+                    break;
+                case 3:
+                    ASSERT_TRUE( m.erase_with( other_item( i.nKey ), other_less()));
+                    ASSERT_FALSE( m.erase_with( other_item( i.nKey ), other_less()));
+                    break;
+                case 4:
+                    ASSERT_TRUE( m.erase( i, []( map_pair& v ) {
+                        EXPECT_EQ( v.first.nKey, v.second.nVal );
+                        EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                    }));
+                    ASSERT_FALSE( m.erase( i, []( map_pair& ) {
+                        EXPECT_TRUE( false );
+                    }));
+                    break;
+                case 5:
+                    ASSERT_TRUE( m.erase( i.nKey, []( map_pair& v ) {
+                        EXPECT_EQ( v.first.nKey, v.second.nVal );
+                        EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                    }));
+                    ASSERT_FALSE( m.erase( i.nKey, []( map_pair& ) {
+                        EXPECT_TRUE( false );
+                    }));
+                    break;
+                case 6:
+                    ASSERT_TRUE( m.erase( val.strVal, []( map_pair& v ) {
+                        EXPECT_EQ( v.first.nKey, v.second.nVal );
+                        EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                    }));
+                    ASSERT_FALSE( m.erase( val.strVal, []( map_pair& ) {
+                        EXPECT_TRUE( false );
+                    }));
+                    break;
+                case 7:
+                    ASSERT_TRUE( m.erase_with( other_item( i.nKey ), other_less(), []( map_pair& v ) {
+                        EXPECT_EQ( v.first.nKey, v.second.nVal );
+                        EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
+                    }));
+                    ASSERT_FALSE( m.erase_with( other_item( i.nKey ), other_less(), []( map_pair& ) {
+                        EXPECT_TRUE( false );
+                    }));
+                    break;
+                }
+
+                ASSERT_FALSE( m.contains( i.nKey ));
+                ASSERT_FALSE( m.contains( i ));
+                ASSERT_FALSE( m.contains( val.strVal ));
+                ASSERT_FALSE( m.contains( other_item( i.nKey ), other_less()));
+                ASSERT_FALSE( m.find( i, []( map_pair const& ) {
+                    ASSERT_TRUE( false );
+                } ));
+                ASSERT_FALSE( m.find( i.nKey, []( map_pair const& ) {
+                    EXPECT_TRUE( false );
+                } ));
+                ASSERT_FALSE( m.find_with( other_item( i.nKey ), other_less(), []( map_pair const& ) {
+                    EXPECT_TRUE( false );
+                } ));
+            }
+            ASSERT_TRUE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, 0 );
+
+            // clear
+            for ( auto const& i : arrKeys )
+                ASSERT_TRUE( m.insert( i ));
+
+            ASSERT_FALSE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, kkSize );
+
+            m.clear();
+
+            ASSERT_TRUE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, 0 );
+        }
+    };
+
+} // namespace cds_test
+
+#endif // #ifndef CDSUNIT_TREE_TEST_TREE_MAP_H
diff --git a/test/unit/tree/test_tree_map_data.h b/test/unit/tree/test_tree_map_data.h
new file mode 100644 (file)
index 0000000..236f4b8
--- /dev/null
@@ -0,0 +1,254 @@
+/*
+    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_TREE_TEST_TREE_MAP_DATA_H
+#define CDSUNIT_TREE_TEST_TREE_MAP_DATA_H
+
+#include <cds_test/check_size.h>
+#include <cds_test/fixture.h>
+
+#include <cds/opt/hash.h>
+
+namespace cds_test {
+
+    class tree_map_fixture: public fixture
+    {
+    public:
+        struct key_type {
+            int nKey;
+
+            key_type()
+            {}
+
+            explicit key_type( int n )
+                : nKey( n )
+            {}
+
+            explicit key_type( std::string const& str )
+                : nKey( std::stoi( str ))
+            {}
+
+            key_type( key_type const& s )
+                : nKey( s.nKey )
+            {}
+        };
+
+        struct value_type {
+            int nVal;
+            std::string strVal;
+
+            value_type()
+                : nVal( 0 )
+            {}
+
+            explicit value_type( int n )
+                : nVal( n )
+                , strVal( std::to_string( n ))
+            {}
+
+            explicit value_type( std::string const& str )
+                : nVal( std::stoi( str ))
+                , strVal( str )
+            {}
+
+            explicit value_type( std::string&& str )
+                : nVal( std::stoi( str ))
+                , strVal( std::move( str ))
+            {}
+
+            value_type( int n, std::string const& str )
+                : nVal( n )
+                , strVal( str )
+            {}
+
+            value_type( int n, std::string&& str )
+                : nVal( n )
+                , strVal( std::move( str ))
+            {}
+
+            value_type( value_type&& v )
+                : nVal( v.nVal )
+                , strVal( std::move( v.strVal ))
+            {}
+
+            value_type( value_type const& v )
+                : nVal( v.nVal )
+                , strVal( v.strVal )
+            {}
+
+            value_type& operator=( value_type const& v )
+            {
+                if ( this != &v ) {
+                    nVal = v.nVal;
+                    strVal = v.strVal;
+                }
+                return *this;
+            }
+
+            value_type& operator=( value_type&& v )
+            {
+                if ( this != &v ) {
+                    nVal = v.nVal;
+                    strVal = std::move( v.strVal );
+                }
+                return *this;
+            }
+
+            value_type& operator=( int i )
+            {
+                nVal = i;
+                strVal = std::to_string( i );
+                return *this;
+            }
+
+            value_type& operator=( std::string const& s )
+            {
+                nVal = std::stoi( s );
+                strVal = s;
+                return *this;
+            }
+        };
+
+        typedef std::pair<key_type const, value_type> pair_type;
+
+        struct copy_key {
+            void operator()( key_type& dest, key_type const& src ) const
+            {
+                dest.nKey = src.nKey;
+            }
+        };
+        struct less
+        {
+            bool operator ()( key_type const& v1, key_type const& v2 ) const
+            {
+                return v1.nKey < v2.nKey;
+            }
+
+            bool operator ()( key_type const& v1, int v2 ) const
+            {
+                return v1.nKey < v2;
+            }
+
+            bool operator ()( int v1, key_type const& v2 ) const
+            {
+                return v1 < v2.nKey;
+            }
+
+            bool operator ()( key_type const& v1, std::string const& v2 ) const
+            {
+                return v1.nKey < std::stoi(v2 );
+            }
+
+            bool operator ()( std::string const& v1, key_type const& v2 ) const
+            {
+                return std::stoi( v1 ) < v2.nKey;
+            }
+        };
+
+        struct cmp {
+            int operator ()( key_type const& v1, key_type const& v2 ) const
+            {
+                if ( v1.nKey < v2.nKey )
+                    return -1;
+                return v1.nKey > v2.nKey ? 1 : 0;
+            }
+
+            int operator ()( key_type const& v1, int v2 ) const
+            {
+                if ( v1.nKey < v2 )
+                    return -1;
+                return v1.nKey > v2 ? 1 : 0;
+            }
+
+            int operator ()( int v1, key_type const& v2 ) const
+            {
+                if ( v1 < v2.nKey )
+                    return -1;
+                return v1 > v2.nKey ? 1 : 0;
+            }
+
+            int operator ()( key_type const& v1, std::string const& v2 ) const
+            {
+                int n2 = std::stoi( v2 );
+                if ( v1.nKey < n2 )
+                    return -1;
+                return v1.nKey > n2 ? 1 : 0;
+            }
+
+            int operator ()( std::string const& v1, key_type const& v2 ) const
+            {
+                int n1 = std::stoi( v1 );
+                if ( n1 < v2.nKey )
+                    return -1;
+                return n1 > v2.nKey ? 1 : 0;
+            }
+        };
+
+        struct hash1 {
+            size_t operator()( int i ) const
+            {
+                return cds::opt::v::hash<int>()( i );
+            }
+
+            size_t operator()( std::string const& str ) const
+            {
+                return cds::opt::v::hash<int>()( std::stoi( str ));
+            }
+
+            template <typename T>
+            size_t operator()( T const& i ) const
+            {
+                return cds::opt::v::hash<int>()(i.nKey);
+            }
+        };
+
+        struct other_item {
+            int nKey;
+
+            other_item( int key )
+                : nKey( key )
+            {}
+        };
+
+        struct other_less
+        {
+            bool operator ()( key_type const& v1, other_item const& v2 ) const
+            {
+                return v1.nKey < v2.nKey;
+            }
+            bool operator ()( other_item const& v1, key_type const& v2 ) const
+            {
+                return v1.nKey < v2.nKey;
+            }
+        };
+    };
+} // namespace cds_test
+
+#endif // CDSUNIT_TREE_TEST_TREE_MAP_DATA_H
diff --git a/test/unit/tree/test_tree_map_hp.h b/test/unit/tree/test_tree_map_hp.h
new file mode 100644 (file)
index 0000000..831d0cd
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+    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_TREE_TEST_TREE_MAP_HP_H
+#define CDSUNIT_TREE_TEST_TREE_MAP_HP_H
+
+#include "test_tree_map.h"
+
+namespace cds_test {
+
+    class container_tree_map_hp: public container_tree_map
+    {
+        typedef container_tree_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 );
+
+            // get/extract
+            typedef typename Map::guarded_ptr guarded_ptr;
+            guarded_ptr gp;
+
+            for ( auto const& i : arrKeys ) {
+                value_type const& val = arrVals.at( i.nKey );
+
+                gp = m.get( i.nKey );
+                ASSERT_FALSE( !gp );
+                ASSERT_EQ( gp->first.nKey, i.nKey );
+                gp.release();
+                gp = m.get( i );
+                ASSERT_FALSE( !gp );
+                ASSERT_EQ( gp->first.nKey, i.nKey );
+                gp.release();
+                gp = m.get_with( other_item( i.nKey ), other_less());
+                ASSERT_FALSE( !gp );
+                ASSERT_EQ( gp->first.nKey, i.nKey );
+
+                switch ( i.nKey % 4 ) {
+                case 0:
+                    gp = m.extract( i.nKey );
+                    break;
+                case 1:
+                    gp = m.extract( i );
+                    break;
+                case 2:
+                    gp = m.extract( val.strVal );
+                    break;
+                case 3:
+                    gp = m.extract_with( other_item( i.nKey ), other_less());
+                    break;
+                }
+                ASSERT_FALSE( !gp );
+                ASSERT_EQ( gp->first.nKey, i.nKey );
+                gp.release();
+
+                gp = m.get( i.nKey );
+                ASSERT_TRUE( !gp );
+                gp = m.get( i );
+                ASSERT_TRUE( !gp );
+                gp = m.get_with( other_item( i.nKey ), other_less());
+                ASSERT_TRUE( !gp );
+            }
+            ASSERT_TRUE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, 0 );
+
+            gp = m.extract_min();
+            EXPECT_TRUE( !gp );
+            gp = m.extract_max();
+            EXPECT_TRUE( !gp );
+
+            for ( auto const& i : arrKeys )
+                ASSERT_TRUE( m.insert( i ) );
+            ASSERT_FALSE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, kkSize );
+
+            // extract_min
+            int nKey = -1;
+            size_t nCount = 0;
+            while ( !m.empty() ) {
+                gp = m.extract_min();
+                ASSERT_FALSE( !gp );
+                EXPECT_EQ( gp->first.nKey, nKey + 1 );
+                nKey = gp->first.nKey;
+                ++nCount;
+            }
+            ASSERT_TRUE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, 0 );
+            EXPECT_EQ( nCount, kkSize );
+
+            // extract_max
+            for ( auto const& i : arrKeys )
+                ASSERT_TRUE( m.insert( i ) );
+            ASSERT_FALSE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, kkSize );
+
+            nKey = kkSize;
+            nCount = 0;
+            while ( !m.empty() ) {
+                gp = m.extract_max();
+                ASSERT_FALSE( !gp );
+                EXPECT_EQ( gp->first.nKey, nKey - 1 );
+                nKey = gp->first.nKey;
+                ++nCount;
+            }
+            ASSERT_TRUE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, 0 );
+            EXPECT_EQ( nCount, kkSize );
+
+            ASSERT_TRUE( m.check_consistency());
+        }
+    };
+
+} // namespace cds_test
+
+#endif // #ifndef CDSUNIT_TREE_TEST_TREE_MAP_HP_H
diff --git a/test/unit/tree/test_tree_map_rcu.h b/test/unit/tree/test_tree_map_rcu.h
new file mode 100644 (file)
index 0000000..113a25e
--- /dev/null
@@ -0,0 +1,257 @@
+/*
+    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_TREE_TEST_TREE_MAP_RCU_H
+#define CDSUNIT_TREE_TEST_TREE_MAP_RCU_H
+
+#include "test_tree_map.h"
+
+namespace cds_test {
+
+    class container_tree_map_rcu: public container_tree_map
+    {
+        typedef container_tree_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 );
+
+            typedef typename Map::exempt_ptr    exempt_ptr;
+            typedef typename Map::value_type *  raw_ptr;
+            typedef typename Map::rcu_lock      rcu_lock;
+
+            // get/extract
+            shuffle( arrKeys.begin(), arrKeys.end() );
+
+            exempt_ptr xp;
+            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;
+                }
+
+                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 );
+
+
+            // extract_min
+            for ( auto const& i : arrKeys )
+                ASSERT_TRUE( m.insert( i ) );
+
+            size_t nCount = 0;
+            int nKey = -1;
+            while ( !m.empty() ) {
+                xp = m.extract_min();
+                ASSERT_FALSE( !xp );
+                EXPECT_EQ( xp->first.nKey, nKey + 1 );
+                nKey = xp->first.nKey;
+                ++nCount;
+            }
+            xp = m.extract_min();
+            ASSERT_TRUE( !xp );
+            xp = m.extract_max();
+            ASSERT_TRUE( !xp );
+            EXPECT_EQ( kkSize, nCount );
+            ASSERT_TRUE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, 0 );
+
+            // extract_max
+            xp = m.extract_min();
+            EXPECT_TRUE( !xp );
+            xp = m.extract_max();
+            EXPECT_TRUE( !xp );
+
+            for ( auto const& i : arrKeys )
+                ASSERT_TRUE( m.insert( i ) );
+
+            nKey = kkSize;
+            nCount = 0;
+            while ( !m.empty() ) {
+                xp = m.extract_max();
+                ASSERT_FALSE( !xp );
+                EXPECT_EQ( xp->first.nKey, nKey - 1 );
+                nKey = xp->first.nKey;
+                ++nCount;
+            }
+
+            xp = m.extract_min();
+            ASSERT_TRUE( !xp );
+            xp = m.extract_max();
+            ASSERT_TRUE( !xp );
+            EXPECT_EQ( kkSize, nCount );
+            ASSERT_TRUE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, 0 );
+        }
+    };
+
+} // namespace cds_test
+
+#endif // #ifndef CDSUNIT_TREE_TEST_TREE_MAP_RCU_H
index bc92bd6ef5741a98e8635f67236549c742a1f2ca..0c5ce9e42bbbce0e8b283f4e222b6a0a58b05911 100644 (file)
@@ -407,6 +407,8 @@ namespace cds_test {
             ASSERT_FALSE( s.empty() );
             ASSERT_CONTAINER_SIZE( s, nSetSize );
 
+            ASSERT_TRUE( s.check_consistency());
+
             // erase
             shuffle( indices.begin(), indices.end() );
             for ( auto idx : indices ) {