HP and DHP SMR totally refactored
[libcds.git] / test / unit / map / michael_iterable_dhp.cpp
index 70637b1a4033312f8dd6f9456a152c72d5d9546b..c341b053e98c248efb59c3758c3d4210088ddb22 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:
 
@@ -48,14 +48,14 @@ namespace {
             typedef cc::IterableKVList< gc_type, key_type, value_type > list_type;
             typedef cc::MichaelHashMap< gc_type, list_type >   map_type;
 
-            cds::gc::dhp::GarbageCollector::Construct( 16, map_type::c_nHazardPtrCount );
+            cds::gc::dhp::smr::construct( map_type::c_nHazardPtrCount );
             cds::threading::Manager::attachThread();
         }
 
         void TearDown()
         {
             cds::threading::Manager::detachThread();
-            cds::gc::dhp::GarbageCollector::Destruct();
+            cds::gc::dhp::smr::destruct();
         }
     };
 
@@ -67,7 +67,7 @@ namespace {
             >::type
         > list_type;
 
-        typedef cc::MichaelHashMap< gc_type, list_type, 
+        typedef cc::MichaelHashMap< gc_type, list_type,
             typename cc::michael_map::make_traits<
                 cds::opt::hash< hash1 >
             >::type
@@ -85,7 +85,7 @@ namespace {
             >::type
         > list_type;
 
-        typedef cc::MichaelHashMap< gc_type, list_type, 
+        typedef cc::MichaelHashMap< gc_type, list_type,
             typename cc::michael_map::make_traits<
                 cds::opt::hash< hash1 >
             >::type
@@ -104,7 +104,7 @@ namespace {
             >::type
         > list_type;
 
-        typedef cc::MichaelHashMap< gc_type, list_type, 
+        typedef cc::MichaelHashMap< gc_type, list_type,
             typename cc::michael_map::make_traits<
                 cds::opt::hash< hash1 >
             >::type
@@ -170,8 +170,9 @@ namespace {
         };
         typedef cc::MichaelHashMap< gc_type, list_type, map_traits > map_type;
 
-        map_type s( kSize, 8 );
-        test( s );
+        map_type m( kSize, 8 );
+        test( m );
+        EXPECT_GE( m.statistics().m_nInsertSuccess, 0u );
     }
 
     TEST_F( MichaelIterableMap_DHP, wrapped_stat )
@@ -189,8 +190,9 @@ namespace {
         };
         typedef cc::MichaelHashMap< gc_type, list_type, map_traits > map_type;
 
-        map_type s( kSize, 8 );
-        test( s );
+        map_type m( kSize, 8 );
+        test( m );
+        EXPECT_GE( m.statistics().m_nInsertSuccess, 0u );
     }
 
 } // namespace