Migrated SkipListMap unit test to gtest framework
authorkhizmax <libcds.dev@gmail.com>
Sat, 2 Apr 2016 16:01:59 +0000 (19:01 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sat, 2 Apr 2016 16:01:59 +0000 (19:01 +0300)
14 files changed:
projects/Win/vc14/gtest-map.vcxproj
projects/Win/vc14/gtest-map.vcxproj.filters
test/unit/map/CMakeLists.txt
test/unit/map/skiplist_dhp.cpp [new file with mode: 0644]
test/unit/map/skiplist_hp.cpp [new file with mode: 0644]
test/unit/map/skiplist_nogc.cpp [new file with mode: 0644]
test/unit/map/skiplist_rcu_gpb.cpp [new file with mode: 0644]
test/unit/map/skiplist_rcu_gpi.cpp [new file with mode: 0644]
test/unit/map/skiplist_rcu_gpt.cpp [new file with mode: 0644]
test/unit/map/skiplist_rcu_shb.cpp [new file with mode: 0644]
test/unit/map/skiplist_rcu_sht.cpp [new file with mode: 0644]
test/unit/map/test_map.h
test/unit/map/test_skiplist_hp.h [new file with mode: 0644]
test/unit/map/test_skiplist_rcu.h [new file with mode: 0644]

index 1d1b6d8e8c4f61550bfebb6689093717b1b157b4..f8d1cefb2d9d710198e856c33a6cfbc60087fa27 100644 (file)
     </ClCompile>\r
     <ClCompile Include="..\..\..\test\unit\map\michael_michael_rcu_shb.cpp" />\r
     <ClCompile Include="..\..\..\test\unit\map\michael_michael_rcu_sht.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_dhp.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_hp.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_nogc.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_rcu_gpb.cpp">\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4503</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_rcu_gpi.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_rcu_gpt.cpp">\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">4503</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4503</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_rcu_shb.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_rcu_sht.cpp" />\r
     <ClCompile Include="..\..\..\test\unit\map\split_lazy_dhp.cpp">\r
       <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503</DisableSpecificWarnings>\r
       <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">4503</DisableSpecificWarnings>\r
     <ClInclude Include="..\..\..\test\unit\map\test_map_rcu.h" />\r
     <ClInclude Include="..\..\..\test\unit\map\test_michael_lazy_rcu.h" />\r
     <ClInclude Include="..\..\..\test\unit\map\test_michael_michael_rcu.h" />\r
+    <ClInclude Include="..\..\..\test\unit\map\test_skiplist_hp.h" />\r
+    <ClInclude Include="..\..\..\test\unit\map\test_skiplist_rcu.h" />\r
     <ClInclude Include="..\..\..\test\unit\map\test_split_lazy_rcu.h" />\r
     <ClInclude Include="..\..\..\test\unit\map\test_split_michael_rcu.h" />\r
   </ItemGroup>\r
index d09f3f90f1b3a4ab92dfa45b7a0993b28ee34f95..ef768c7c594697da0d774554db35eeff011d73e9 100644 (file)
@@ -19,6 +19,9 @@
     <Filter Include="Source Files\SplitListMap">\r
       <UniqueIdentifier>{3f37c15c-de68-4230-9c59-bc3a2e059950}</UniqueIdentifier>\r
     </Filter>\r
+    <Filter Include="Source Files\SkipListMap">\r
+      <UniqueIdentifier>{1e70af02-0389-402a-bb6e-e1a399628288}</UniqueIdentifier>\r
+    </Filter>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClCompile Include="..\..\..\test\unit\main.cpp">\r
     <ClCompile Include="..\..\..\test\unit\map\split_lazy_rcu_sht.cpp">\r
       <Filter>Source Files\SplitListMap</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_hp.cpp">\r
+      <Filter>Source Files\SkipListMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_dhp.cpp">\r
+      <Filter>Source Files\SkipListMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_nogc.cpp">\r
+      <Filter>Source Files\SkipListMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_rcu_gpb.cpp">\r
+      <Filter>Source Files\SkipListMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_rcu_gpi.cpp">\r
+      <Filter>Source Files\SkipListMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_rcu_gpt.cpp">\r
+      <Filter>Source Files\SkipListMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_rcu_shb.cpp">\r
+      <Filter>Source Files\SkipListMap</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\map\skiplist_rcu_sht.cpp">\r
+      <Filter>Source Files\SkipListMap</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\..\..\test\unit\map\test_map.h">\r
     <ClInclude Include="..\..\..\test\unit\map\test_split_lazy_rcu.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\..\..\test\unit\map\test_skiplist_hp.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\..\test\unit\map\test_skiplist_rcu.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
 </Project>
\ No newline at end of file
index c1b9a80b810fecb6bb536e448be8437a676b916c..96d4ad13005f9442c6a6fcd8e452b8d4fb06cbf7 100644 (file)
@@ -18,6 +18,14 @@ set(CDSGTEST_MAP_SOURCES
     michael_michael_rcu_gpt.cpp
     michael_michael_rcu_shb.cpp
     michael_michael_rcu_sht.cpp
+    skiplist_hp.cpp
+    skiplist_dhp.cpp
+    skiplist_nogc.cpp
+    skiplist_rcu_gpb.cpp
+    skiplist_rcu_gpi.cpp
+    skiplist_rcu_gpt.cpp
+    skiplist_rcu_shb.cpp
+    skiplist_rcu_sht.cpp
     split_lazy_hp.cpp
     split_lazy_dhp.cpp
     split_lazy_nogc.cpp
diff --git a/test/unit/map/skiplist_dhp.cpp b/test/unit/map/skiplist_dhp.cpp
new file mode 100644 (file)
index 0000000..626ed2b
--- /dev/null
@@ -0,0 +1,161 @@
+/*
+    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_skiplist_hp.h"
+
+#include <cds/container/skip_list_map_dhp.h>
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::DHP gc_type;
+
+    class SkipListMap_DHP : public cds_test::skiplist_map_hp
+    {
+    protected:
+        typedef cds_test::skiplist_map_hp base_class;
+
+        void SetUp()
+        {
+            struct map_traits: public cc::skip_list::traits
+            {
+                typedef cmp compare;
+            };
+            typedef cc::SkipListMap< 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( SkipListMap_DHP, compare )
+    {
+        typedef cc::SkipListMap< gc_type, key_type, value_type,
+            typename cc::skip_list::make_traits<
+                cds::opt::compare< cmp >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_DHP, less )
+    {
+        typedef cc::SkipListMap< gc_type, key_type, value_type,
+            typename cc::skip_list::make_traits<
+                cds::opt::less< base_class::less >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_DHP, cmpmix )
+    {
+        typedef cc::SkipListMap< gc_type, key_type, value_type,
+            typename cc::skip_list::make_traits<
+                cds::opt::less< base_class::less >
+                ,cds::opt::compare< cmp >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_DHP, item_counting )
+    {
+        struct map_traits: public cc::skip_list::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cc::SkipListMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_DHP, backoff )
+    {
+        struct map_traits: public cc::skip_list::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+        };
+        typedef cc::SkipListMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_DHP, stat )
+    {
+        struct map_traits: public cc::skip_list::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cc::skip_list::stat<> stat;
+        };
+        typedef cc::SkipListMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_DHP, random_level_generator )
+    {
+        struct map_traits: public cc::skip_list::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cc::skip_list::stat<> stat;
+            typedef cc::skip_list::xorshift random_level_generator;
+        };
+        typedef cc::SkipListMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+} // namespace
diff --git a/test/unit/map/skiplist_hp.cpp b/test/unit/map/skiplist_hp.cpp
new file mode 100644 (file)
index 0000000..3166812
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+    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_skiplist_hp.h"
+
+#include <cds/container/skip_list_map_hp.h>
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::HP gc_type;
+
+    class SkipListMap_HP : public cds_test::skiplist_map_hp
+    {
+    protected:
+        typedef cds_test::skiplist_map_hp base_class;
+
+        void SetUp()
+        {
+            struct map_traits: public cc::skip_list::traits
+            {
+                typedef cmp compare;
+            };
+            typedef cc::SkipListMap< 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( SkipListMap_HP, compare )
+    {
+        typedef cc::SkipListMap< gc_type, key_type, value_type,
+            typename cc::skip_list::make_traits<
+                cds::opt::compare< cmp >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_HP, less )
+    {
+        typedef cc::SkipListMap< gc_type, key_type, value_type,
+            typename cc::skip_list::make_traits<
+                cds::opt::less< base_class::less >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_HP, cmpmix )
+    {
+        typedef cc::SkipListMap< gc_type, key_type, value_type,
+            typename cc::skip_list::make_traits<
+                cds::opt::less< base_class::less >
+                ,cds::opt::compare< cmp >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_HP, item_counting )
+    {
+        struct map_traits: public cc::skip_list::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cc::SkipListMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_HP, backoff )
+    {
+        struct map_traits: public cc::skip_list::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+        };
+        typedef cc::SkipListMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_HP, stat )
+    {
+        struct map_traits: public cc::skip_list::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cc::skip_list::stat<> stat;
+        };
+        typedef cc::SkipListMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_HP, random_level_generator )
+    {
+        struct map_traits: public cc::skip_list::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cc::skip_list::stat<> stat;
+            typedef cc::skip_list::xorshift random_level_generator;
+        };
+        typedef cc::SkipListMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+} // namespace
diff --git a/test/unit/map/skiplist_nogc.cpp b/test/unit/map/skiplist_nogc.cpp
new file mode 100644 (file)
index 0000000..a2f7957
--- /dev/null
@@ -0,0 +1,196 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+    
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+      list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+*/
+
+#include "test_map_nogc.h"
+
+#include <cds/container/skip_list_map_nogc.h>
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::nogc gc_type;
+
+    class SkipListMap_NoGC : public cds_test::container_map_nogc
+    {
+    protected:
+        typedef cds_test::container_map_nogc base_class;
+
+        template <typename 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;
+
+            // get_min
+            for ( int i = static_cast<int>( kkSize ); i > 0; --i ) {
+                ASSERT_TRUE( m.insert( i ) != m.end());
+
+                map_pair * p = m.get_min();
+                ASSERT_TRUE( p != nullptr );
+                EXPECT_EQ( p->first.nKey, i );
+
+                p = m.get_max();
+                ASSERT_TRUE( p != nullptr );
+                EXPECT_EQ( p->first.nKey, kkSize );
+            }
+
+            m.clear();
+            ASSERT_TRUE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, 0 );
+
+            // get_max
+            for ( int i = 0; i < static_cast<int>( kkSize ); ++i ) {
+                ASSERT_TRUE( m.insert( i ) != m.end());
+
+                map_pair * p = m.get_max();
+                ASSERT_TRUE( p != nullptr );
+                EXPECT_EQ( p->first.nKey, i );
+
+                p = m.get_min();
+                ASSERT_TRUE( p != nullptr );
+                EXPECT_EQ( p->first.nKey, 0 );
+            }
+
+            m.clear();
+        }
+
+        //void SetUp()
+        //{}
+
+        //void TearDown()
+        //{}
+    };
+
+    TEST_F( SkipListMap_NoGC, compare )
+    {
+        typedef cc::SkipListMap< gc_type, key_type, value_type,
+            typename cc::skip_list::make_traits<
+                cds::opt::compare< cmp >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_NoGC, less )
+    {
+        typedef cc::SkipListMap< gc_type, key_type, value_type,
+            typename cc::skip_list::make_traits<
+                cds::opt::less< base_class::less >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_NoGC, cmpmix )
+    {
+        typedef cc::SkipListMap< gc_type, key_type, value_type,
+            typename cc::skip_list::make_traits<
+                cds::opt::less< base_class::less >
+                ,cds::opt::compare< cmp >
+            >::type
+        > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_NoGC, item_counting )
+    {
+        struct map_traits: public cc::skip_list::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cc::SkipListMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_NoGC, backoff )
+    {
+        struct map_traits: public cc::skip_list::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+        };
+        typedef cc::SkipListMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_NoGC, stat )
+    {
+        struct map_traits: public cc::skip_list::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cds::backoff::yield back_off;
+            typedef cc::skip_list::stat<> stat;
+        };
+        typedef cc::SkipListMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+    TEST_F( SkipListMap_NoGC, random_level_generator )
+    {
+        struct map_traits: public cc::skip_list::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+            typedef cc::skip_list::stat<> stat;
+            typedef cc::skip_list::xorshift random_level_generator;
+        };
+        typedef cc::SkipListMap< gc_type, key_type, value_type, map_traits > map_type;
+
+        map_type m;
+        test( m );
+    }
+
+} // namespace
diff --git a/test/unit/map/skiplist_rcu_gpb.cpp b/test/unit/map/skiplist_rcu_gpb.cpp
new file mode 100644 (file)
index 0000000..cfb4fa5
--- /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_skiplist_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::general_buffered<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPB, SkipListMap, rcu_implementation );
diff --git a/test/unit/map/skiplist_rcu_gpi.cpp b/test/unit/map/skiplist_rcu_gpi.cpp
new file mode 100644 (file)
index 0000000..deacc8d
--- /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_skiplist_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::general_instant<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPI, SkipListMap, rcu_implementation );
diff --git a/test/unit/map/skiplist_rcu_gpt.cpp b/test/unit/map/skiplist_rcu_gpt.cpp
new file mode 100644 (file)
index 0000000..b9220d3
--- /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_skiplist_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::general_threaded<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_GPT, SkipListMap, rcu_implementation );
diff --git a/test/unit/map/skiplist_rcu_shb.cpp b/test/unit/map/skiplist_rcu_shb.cpp
new file mode 100644 (file)
index 0000000..b214dc3
--- /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_skiplist_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::signal_buffered<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_SHB, SkipListMap, rcu_implementation );
+
+#endif // CDS_URCU_SIGNAL_HANDLING_ENABLED
diff --git a/test/unit/map/skiplist_rcu_sht.cpp b/test/unit/map/skiplist_rcu_sht.cpp
new file mode 100644 (file)
index 0000000..f1bccdc
--- /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_skiplist_rcu.h"
+
+namespace {
+
+    typedef cds::urcu::signal_threaded<> rcu_implementation;
+
+} // namespace
+
+INSTANTIATE_TYPED_TEST_CASE_P( RCU_SHT, SkipListMap, rcu_implementation );
+
+#endif // CDS_URCU_SIGNAL_HANDLING_ENABLED
index 8caa8fb10d227166e1ef7a6128e5dacfecbf10ac..4ae9fe62293074c74fba285b4bb0cfdc4deaa108 100644 (file)
@@ -122,6 +122,20 @@ namespace cds_test {
                 }
                 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;
diff --git a/test/unit/map/test_skiplist_hp.h b/test/unit/map/test_skiplist_hp.h
new file mode 100644 (file)
index 0000000..59e4d59
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+    
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+      list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+*/
+
+#ifndef CDSUNIT_MAP_TEST_SKIPLIST_HP_H
+#define CDSUNIT_MAP_TEST_SKIPLIST_HP_H
+
+#include "test_map_hp.h"
+
+namespace cds_test {
+
+    class skiplist_map_hp: public container_map_hp
+    {
+        typedef container_map_hp 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());
+
+            for ( auto const& i : arrKeys )
+                ASSERT_TRUE( m.insert( i ) );
+            ASSERT_FALSE( m.empty() );
+            ASSERT_CONTAINER_SIZE( m, kkSize );
+
+            // extract_min
+            typedef typename Map::guarded_ptr guarded_ptr;
+            guarded_ptr gp;
+
+            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 );
+        }
+    };
+
+} // namespace cds_test
+
+#endif // #ifndef CDSUNIT_MAP_TEST_SKIPLIST_HP_H
diff --git a/test/unit/map/test_skiplist_rcu.h b/test/unit/map/test_skiplist_rcu.h
new file mode 100644 (file)
index 0000000..ea0d3ed
--- /dev/null
@@ -0,0 +1,255 @@
+/*
+    This file is a part of libcds - Concurrent Data Structures library
+
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+
+    Source code repo: http://github.com/khizmax/libcds/
+    Download: http://sourceforge.net/projects/libcds/files/
+    
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this
+      list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+*/
+#ifndef CDSUNIT_MAP_TEST_SKIPLIST_RCU_H
+#define CDSUNIT_MAP_TEST_SKIPLIST_RCU_H
+
+#include "test_map_rcu.h"
+#include <cds/container/skip_list_map_rcu.h>
+
+namespace cc = cds::container;
+
+template <class RCU>
+class SkipListMap: public cds_test::container_map_rcu
+{
+    typedef cds_test::container_map_rcu base_class;
+public:
+    typedef cds::urcu::gc<RCU> rcu_type;
+
+protected:
+    template <typename 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;
+        typedef typename Map::exempt_ptr exempt_ptr;
+        size_t const kkSize = base_class::kSize;
+
+        // get_min
+        for ( int i = static_cast<int>(kkSize); i > 0; --i )
+            ASSERT_TRUE( m.insert( i ));
+
+        exempt_ptr xp;
+
+        size_t nCount = 0;
+        int nKey = 0;
+        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 );
+
+        // get_max
+        for ( int i = 0; i < static_cast<int>(kkSize); ++i )
+            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 );
+    }
+
+    void SetUp()
+    {
+        RCU::Construct();
+        cds::threading::Manager::attachThread();
+    }
+
+    void TearDown()
+    {
+        cds::threading::Manager::detachThread();
+        RCU::Destruct();
+    }
+};
+
+TYPED_TEST_CASE_P( SkipListMap );
+
+TYPED_TEST_P( SkipListMap, compare )
+{
+    typedef typename TestFixture::rcu_type   rcu_type;
+    typedef typename TestFixture::key_type   key_type;
+    typedef typename TestFixture::value_type value_type;
+
+    typedef cc::SkipListMap< rcu_type, key_type, value_type,
+        typename cc::skip_list::make_traits<
+            cds::opt::compare< typename TestFixture::cmp >
+        >::type
+    > map_type;
+
+    map_type m;
+    this->test( m );
+}
+
+TYPED_TEST_P( SkipListMap, less )
+{
+    typedef typename TestFixture::rcu_type   rcu_type;
+    typedef typename TestFixture::key_type   key_type;
+    typedef typename TestFixture::value_type value_type;
+
+    typedef cc::SkipListMap< rcu_type, key_type, value_type,
+        typename cc::skip_list::make_traits<
+            cds::opt::less< typename TestFixture::less >
+        >::type
+    > map_type;
+
+    map_type m;
+    this->test( m );
+}
+
+TYPED_TEST_P( SkipListMap, cmpmix )
+{
+    typedef typename TestFixture::rcu_type   rcu_type;
+    typedef typename TestFixture::key_type   key_type;
+    typedef typename TestFixture::value_type value_type;
+
+    typedef cc::SkipListMap< rcu_type, key_type, value_type,
+        typename cc::skip_list::make_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( SkipListMap, 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::skip_list::traits
+    {
+        typedef typename TestFixture::cmp compare;
+        typedef typename TestFixture::less less;
+        typedef cds::atomicity::item_counter item_counter;
+    };
+    typedef cc::SkipListMap< rcu_type, key_type, value_type, map_traits > map_type;
+
+    map_type m;
+    this->test( m );
+}
+
+TYPED_TEST_P( SkipListMap, 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::skip_list::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 cc::SkipListMap< rcu_type, key_type, value_type, map_traits > map_type;
+
+    map_type m;
+    this->test( m );
+}
+
+TYPED_TEST_P( SkipListMap, 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::skip_list::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 cc::skip_list::stat<> stat;
+    };
+    typedef cc::SkipListMap< rcu_type, key_type, value_type, map_traits > map_type;
+
+    map_type m;
+    this->test( m );
+}
+
+TYPED_TEST_P( SkipListMap, random_level_generator )
+{
+    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::skip_list::traits
+    {
+        typedef typename TestFixture::cmp compare;
+        typedef typename TestFixture::less less;
+        typedef cds::atomicity::item_counter item_counter;
+        typedef cc::skip_list::stat<> stat;
+        typedef cc::skip_list::xorshift random_level_generator;
+        typedef cds::opt::v::rcu_assert_deadlock rcu_check_deadlock;
+    };
+    typedef cc::SkipListMap< rcu_type, key_type, value_type, map_traits > map_type;
+
+    map_type m;
+    this->test( m );
+}
+
+
+REGISTER_TYPED_TEST_CASE_P( SkipListMap,
+    compare, less, cmpmix, item_counting, backoff, stat, random_level_generator
+);
+
+
+#endif // CDSUNIT_MAP_TEST_SKIPLIST_RCU_H
\ No newline at end of file