Migrated SkipListSet unit test to gtest
authorkhizmax <libcds.dev@gmail.com>
Sat, 19 Mar 2016 09:01:53 +0000 (12:01 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sat, 19 Mar 2016 09:01:53 +0000 (12:01 +0300)
12 files changed:
projects/Win/vc14/gtest-set.vcxproj
projects/Win/vc14/gtest-set.vcxproj.filters
test/unit/set/CMakeLists.txt
test/unit/set/skiplist_dhp.cpp [new file with mode: 0644]
test/unit/set/skiplist_hp.cpp [new file with mode: 0644]
test/unit/set/skiplist_nogc.cpp [new file with mode: 0644]
test/unit/set/skiplist_rcu_gpb.cpp [new file with mode: 0644]
test/unit/set/skiplist_rcu_gpi.cpp [new file with mode: 0644]
test/unit/set/skiplist_rcu_gpt.cpp [new file with mode: 0644]
test/unit/set/skiplist_rcu_shb.cpp [new file with mode: 0644]
test/unit/set/skiplist_rcu_sht.cpp [new file with mode: 0644]
test/unit/set/test_skiplist_rcu.h [new file with mode: 0644]

index c70560666b0635e311273cef400241d5d8a84882..df5b23b61db239939dfabcb9cb07bdc674e3ca85 100644 (file)
     </ClCompile>\r
     <ClCompile Include="..\..\..\test\unit\set\michael_michael_rcu_shb.cpp" />\r
     <ClCompile Include="..\..\..\test\unit\set\michael_michael_rcu_sht.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\set\skiplist_dhp.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\set\skiplist_hp.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\set\skiplist_nogc.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\set\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\set\skiplist_rcu_gpi.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\set\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\set\skiplist_rcu_shb.cpp" />\r
+    <ClCompile Include="..\..\..\test\unit\set\skiplist_rcu_sht.cpp" />\r
     <ClCompile Include="..\..\..\test\unit\set\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\set\test_set_hp.h" />\r
     <ClInclude Include="..\..\..\test\unit\set\test_set_nogc.h" />\r
     <ClInclude Include="..\..\..\test\unit\set\test_set_rcu.h" />\r
+    <ClInclude Include="..\..\..\test\unit\set\test_skiplist_rcu.h" />\r
     <ClInclude Include="..\..\..\test\unit\set\test_split_lazy_rcu.h" />\r
     <ClInclude Include="..\..\..\test\unit\set\test_split_michael_rcu.h" />\r
   </ItemGroup>\r
index 6c8d01e9d05e08d796cb0beb4f4257deb0e7f00d..aad25aaadd5f1ddb1ba63bfd95a4b16e04f563b7 100644 (file)
@@ -19,6 +19,9 @@
     <Filter Include="Source Files\SplitList">\r
       <UniqueIdentifier>{6cf522b0-3039-424a-80f6-12e9ca592630}</UniqueIdentifier>\r
     </Filter>\r
+    <Filter Include="Source Files\SkipList">\r
+      <UniqueIdentifier>{5c30de7f-5e68-4ef5-b9a5-63a1ec626010}</UniqueIdentifier>\r
+    </Filter>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClCompile Include="..\..\..\test\unit\main.cpp">\r
     <ClCompile Include="..\..\..\test\unit\set\split_lazy_nogc.cpp">\r
       <Filter>Source Files\SplitList</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\set\skiplist_hp.cpp">\r
+      <Filter>Source Files\SkipList</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\set\skiplist_dhp.cpp">\r
+      <Filter>Source Files\SkipList</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\set\skiplist_nogc.cpp">\r
+      <Filter>Source Files\SkipList</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\set\skiplist_rcu_gpb.cpp">\r
+      <Filter>Source Files\SkipList</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\set\skiplist_rcu_gpi.cpp">\r
+      <Filter>Source Files\SkipList</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\set\skiplist_rcu_gpt.cpp">\r
+      <Filter>Source Files\SkipList</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\set\skiplist_rcu_shb.cpp">\r
+      <Filter>Source Files\SkipList</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\test\unit\set\skiplist_rcu_sht.cpp">\r
+      <Filter>Source Files\SkipList</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\..\..\test\unit\set\test_set.h">\r
     <ClInclude Include="..\..\..\test\unit\set\test_split_lazy_rcu.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\..\..\test\unit\set\test_skiplist_rcu.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
 </Project>
\ No newline at end of file
index 98606398f4881dae18fb0a6dfddcd879db8c9ffe..0dae6f46f28f954e04de9df8cfddda90f427ab42 100644 (file)
@@ -18,6 +18,14 @@ set(CDSGTEST_SET_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/set/skiplist_dhp.cpp b/test/unit/set/skiplist_dhp.cpp
new file mode 100644 (file)
index 0000000..5eb2c0e
--- /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_set_hp.h"
+
+#include <cds/container/skip_list_set_dhp.h>
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::DHP gc_type;
+
+    class SkipListSet_DHP : public cds_test::container_set_hp
+    {
+    protected:
+        typedef cds_test::container_set_hp base_class;
+
+        void SetUp()
+        {
+            struct set_traits: public cc::skip_list::traits
+            {
+                typedef cmp compare;
+            };
+            typedef cc::SkipListSet< gc_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::dhp::GarbageCollector::Destruct();
+        }
+    };
+
+    TEST_F( SkipListSet_DHP, compare )
+    {
+        typedef cc::SkipListSet< gc_type, int_item,
+            typename cc::skip_list::make_traits<
+                cds::opt::compare< cmp >
+            >::type
+        > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_DHP, less )
+    {
+        typedef cc::SkipListSet< gc_type, int_item,
+            typename cc::skip_list::make_traits<
+                cds::opt::less< base_class::less >
+            >::type
+        > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_DHP, cmpmix )
+    {
+        typedef cc::SkipListSet< gc_type, int_item,
+            typename cc::skip_list::make_traits<
+                cds::opt::less< base_class::less >
+                ,cds::opt::compare< cmp >
+            >::type
+        > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_DHP, item_counting )
+    {
+        struct set_traits: public cc::skip_list::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cc::SkipListSet< gc_type, int_item, set_traits >set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_DHP, backoff )
+    {
+        struct set_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::SkipListSet< gc_type, int_item, set_traits >set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_DHP, stat )
+    {
+        struct set_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::SkipListSet< gc_type, int_item, set_traits >set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_DHP, random_level_generator )
+    {
+        struct set_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::SkipListSet< gc_type, int_item, set_traits >set_type;
+
+        set_type s;
+        test( s );
+    }
+
+} // namespace
diff --git a/test/unit/set/skiplist_hp.cpp b/test/unit/set/skiplist_hp.cpp
new file mode 100644 (file)
index 0000000..bf9727e
--- /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_set_hp.h"
+
+#include <cds/container/skip_list_set_hp.h>
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::HP gc_type;
+
+    class SkipListSet_HP : public cds_test::container_set_hp
+    {
+    protected:
+        typedef cds_test::container_set_hp base_class;
+
+        void SetUp()
+        {
+            struct set_traits: public cc::skip_list::traits
+            {
+                typedef cmp compare;
+            };
+            typedef cc::SkipListSet< gc_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( SkipListSet_HP, compare )
+    {
+        typedef cc::SkipListSet< gc_type, int_item,
+            typename cc::skip_list::make_traits<
+                cds::opt::compare< cmp >
+            >::type
+        > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_HP, less )
+    {
+        typedef cc::SkipListSet< gc_type, int_item,
+            typename cc::skip_list::make_traits<
+                cds::opt::less< base_class::less >
+            >::type
+        > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_HP, cmpmix )
+    {
+        typedef cc::SkipListSet< gc_type, int_item,
+            typename cc::skip_list::make_traits<
+                cds::opt::less< base_class::less >
+                ,cds::opt::compare< cmp >
+            >::type
+        > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_HP, item_counting )
+    {
+        struct set_traits: public cc::skip_list::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cc::SkipListSet< gc_type, int_item, set_traits >set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_HP, backoff )
+    {
+        struct set_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::SkipListSet< gc_type, int_item, set_traits >set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_HP, stat )
+    {
+        struct set_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::SkipListSet< gc_type, int_item, set_traits >set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_HP, random_level_generator )
+    {
+        struct set_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::SkipListSet< gc_type, int_item, set_traits >set_type;
+
+        set_type s;
+        test( s );
+    }
+
+} // namespace
diff --git a/test/unit/set/skiplist_nogc.cpp b/test/unit/set/skiplist_nogc.cpp
new file mode 100644 (file)
index 0000000..302c21d
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+    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_set_nogc.h"
+
+#include <cds/container/skip_list_set_nogc.h>
+
+namespace {
+    namespace cc = cds::container;
+    typedef cds::gc::nogc gc_type;
+
+    class SkipListSet_NoGC : public cds_test::container_set_nogc
+    {
+    protected:
+        typedef cds_test::container_set_nogc base_class;
+
+        //void SetUp()
+        //{}
+
+        //void TearDown()
+        //{}
+    };
+
+    TEST_F( SkipListSet_NoGC, compare )
+    {
+        typedef cc::SkipListSet< gc_type, int_item,
+            typename cc::skip_list::make_traits<
+                cds::opt::compare< cmp >
+            >::type
+        > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_NoGC, less )
+    {
+        typedef cc::SkipListSet< gc_type, int_item,
+            typename cc::skip_list::make_traits<
+                cds::opt::less< base_class::less >
+            >::type
+        > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_NoGC, cmpmix )
+    {
+        typedef cc::SkipListSet< gc_type, int_item,
+            typename cc::skip_list::make_traits<
+                cds::opt::less< base_class::less >
+                ,cds::opt::compare< cmp >
+            >::type
+        > set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_NoGC, item_counting )
+    {
+        struct set_traits: public cc::skip_list::traits
+        {
+            typedef cmp compare;
+            typedef base_class::less less;
+            typedef cds::atomicity::item_counter item_counter;
+        };
+        typedef cc::SkipListSet< gc_type, int_item, set_traits >set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_NoGC, backoff )
+    {
+        struct set_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::SkipListSet< gc_type, int_item, set_traits >set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_NoGC, stat )
+    {
+        struct set_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::SkipListSet< gc_type, int_item, set_traits >set_type;
+
+        set_type s;
+        test( s );
+    }
+
+    TEST_F( SkipListSet_NoGC, random_level_generator )
+    {
+        struct set_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::SkipListSet< gc_type, int_item, set_traits >set_type;
+
+        set_type s;
+        test( s );
+    }
+
+} // namespace
diff --git a/test/unit/set/skiplist_rcu_gpb.cpp b/test/unit/set/skiplist_rcu_gpb.cpp
new file mode 100644 (file)
index 0000000..e6e77cf
--- /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, SkipListSet, rcu_implementation );
diff --git a/test/unit/set/skiplist_rcu_gpi.cpp b/test/unit/set/skiplist_rcu_gpi.cpp
new file mode 100644 (file)
index 0000000..86ca7c2
--- /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, SkipListSet, rcu_implementation );
diff --git a/test/unit/set/skiplist_rcu_gpt.cpp b/test/unit/set/skiplist_rcu_gpt.cpp
new file mode 100644 (file)
index 0000000..65aed08
--- /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, SkipListSet, rcu_implementation );
diff --git a/test/unit/set/skiplist_rcu_shb.cpp b/test/unit/set/skiplist_rcu_shb.cpp
new file mode 100644 (file)
index 0000000..4111ea8
--- /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, SkipListSet, rcu_implementation );
+
+#endif // CDS_URCU_SIGNAL_HANDLING_ENABLED
diff --git a/test/unit/set/skiplist_rcu_sht.cpp b/test/unit/set/skiplist_rcu_sht.cpp
new file mode 100644 (file)
index 0000000..bdc7565
--- /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, SkipListSet, rcu_implementation );
+
+#endif // CDS_URCU_SIGNAL_HANDLING_ENABLED
diff --git a/test/unit/set/test_skiplist_rcu.h b/test/unit/set/test_skiplist_rcu.h
new file mode 100644 (file)
index 0000000..ca93131
--- /dev/null
@@ -0,0 +1,191 @@
+/*
+    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_SET_TEST_SKIPLIST_RCU_H
+#define CDSUNIT_SET_TEST_SKIPLIST_RCU_H
+
+#include "test_set_rcu.h"
+#include <cds/container/skip_list_set_rcu.h>
+
+namespace cc = cds::container;
+
+template <class RCU>
+class SkipListSet: public cds_test::container_set_rcu
+{
+    typedef cds_test::container_set_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( SkipListSet );
+
+//TYPED_TEST_P( SkipListSet, compare )
+TYPED_TEST_P( SkipListSet, compare )
+{
+    typedef typename TestFixture::rcu_type rcu_type;
+    typedef typename TestFixture::int_item int_item;
+
+    typedef cc::SkipListSet< rcu_type, int_item,
+        typename cc::skip_list::make_traits<
+            cds::opt::compare< typename TestFixture::cmp >
+        >::type
+    > set_type;
+
+    set_type s;
+    this->test( s );
+}
+
+TYPED_TEST_P( SkipListSet, less )
+{
+    typedef typename TestFixture::rcu_type rcu_type;
+    typedef typename TestFixture::int_item int_item;
+
+    typedef cc::SkipListSet< rcu_type, int_item,
+        typename cc::skip_list::make_traits<
+            cds::opt::less< typename TestFixture::less >
+        >::type
+    > set_type;
+
+    set_type s;
+    this->test( s );
+}
+
+TYPED_TEST_P( SkipListSet, cmpmix )
+{
+    typedef typename TestFixture::rcu_type rcu_type;
+    typedef typename TestFixture::int_item int_item;
+
+    typedef cc::SkipListSet< rcu_type, int_item,
+        typename cc::skip_list::make_traits<
+            cds::opt::less< typename TestFixture::less >
+            ,cds::opt::compare< typename TestFixture::cmp >
+        >::type
+    > set_type;
+
+    set_type s;
+    this->test( s );
+}
+
+TYPED_TEST_P( SkipListSet, item_counting )
+{
+    typedef typename TestFixture::rcu_type rcu_type;
+    typedef typename TestFixture::int_item int_item;
+
+    struct set_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::SkipListSet< rcu_type, int_item, set_traits >set_type;
+
+    set_type s;
+    this->test( s );
+}
+
+TYPED_TEST_P( SkipListSet, backoff )
+{
+    typedef typename TestFixture::rcu_type rcu_type;
+    typedef typename TestFixture::int_item int_item;
+
+    struct set_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::SkipListSet< rcu_type, int_item, set_traits >set_type;
+
+    set_type s;
+    this->test( s );
+}
+
+TYPED_TEST_P( SkipListSet, stat )
+{
+    typedef typename TestFixture::rcu_type rcu_type;
+    typedef typename TestFixture::int_item int_item;
+
+    struct set_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::SkipListSet< rcu_type, int_item, set_traits >set_type;
+
+    set_type s;
+    this->test( s );
+}
+
+TYPED_TEST_P( SkipListSet, random_level_generator )
+{
+    typedef typename TestFixture::rcu_type rcu_type;
+    typedef typename TestFixture::int_item int_item;
+
+    struct set_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::SkipListSet< rcu_type, int_item, set_traits >set_type;
+
+    set_type s;
+    this->test( s );
+}
+
+
+// GCC 5: All this->test names should be written on single line, otherwise a runtime error will be encountered like as
+// "No this->test named <test_name> can be found in this this->test case"
+REGISTER_TYPED_TEST_CASE_P( SkipListSet,
+    compare, less, cmpmix, item_counting, backoff, stat, random_level_generator
+);
+
+
+#endif // CDSUNIT_SET_TEST_SKIPLIST_RCU_H
\ No newline at end of file