Removed trailing spaces
[libcds.git] / test / unit / map / michael_lazy_hp.cpp
index 5376a2e871b61877983d086f61a348be8b1bac50..fb54ca78e6615656b76c98c3e0459e4a45000eb7 100644 (file)
@@ -5,7 +5,7 @@
 
     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_map_hp.h"
@@ -68,7 +68,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
@@ -86,7 +86,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
@@ -105,7 +105,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
@@ -175,5 +175,47 @@ namespace {
         test( m );
     }
 
+    TEST_F( MichaelLazyMap_HP, stat )
+    {
+        struct list_traits: public cc::lazy_list::traits
+        {
+            typedef cmp compare;
+            typedef cds::backoff::yield back_off;
+            typedef cc::lazy_list::stat<> stat;
+        };
+        typedef cc::LazyKVList< gc_type, key_type, value_type, list_traits > list_type;
+
+        struct map_traits: public cc::michael_map::traits
+        {
+            typedef hash1 hash;
+        };
+        typedef cc::MichaelHashMap< gc_type, list_type, map_traits > map_type;
+
+        map_type m( kSize, 2 );
+        test( m );
+        EXPECT_GE( m.statistics().m_nInsertSuccess, 0u );
+    }
+
+    TEST_F( MichaelLazyMap_HP, wrapped_stat )
+    {
+        struct list_traits: public cc::lazy_list::traits
+        {
+            typedef cmp compare;
+            typedef cds::backoff::yield back_off;
+            typedef cc::lazy_list::wrapped_stat<> stat;
+        };
+        typedef cc::LazyKVList< gc_type, key_type, value_type, list_traits > list_type;
+
+        struct map_traits: public cc::michael_map::traits
+        {
+            typedef hash1 hash;
+        };
+        typedef cc::MichaelHashMap< gc_type, list_type, map_traits > map_type;
+
+        map_type m( kSize, 2 );
+        test( m );
+        EXPECT_GE( m.statistics().m_nInsertSuccess, 0u );
+    }
+
 } // namespace