Adds util header for testing
[libcds.git] / test / unit / map / skiplist_hp.cpp
index 316681299c682855ddc694c010db0c4c1b8b9856..a5d4a0da4f2b834ac050dafb32c0a239c4e34020 100644 (file)
@@ -1,11 +1,11 @@
 /*
     This file is a part of libcds - Concurrent Data Structures library
 
-    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
 
     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:
 
@@ -25,7 +25,7 @@
     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.     
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
 #include "test_skiplist_hp.h"
@@ -43,10 +43,6 @@ namespace {
 
         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
@@ -61,102 +57,7 @@ namespace {
         }
     };
 
-    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 );
-    }
+#   define CDSTEST_FIXTURE_NAME SkipListMap_HP
+#   include "skiplist_hp_inl.h"
 
 } // namespace