Fixed -Wshadow warnings
[libcds.git] / test / unit / intrusive-set / test_intrusive_michael_michael_rcu.h
index a8b02e21c59034a4b4edea20a43ca9bebd641659..5d9e3ee70a659347020e1b29f22bfda8e9069233 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:
 
@@ -66,14 +66,14 @@ TYPED_TEST_P( IntrusiveMichaelSet, base_cmp )
     typedef typename TestFixture::rcu_type rcu_type;
     typedef typename TestFixture::base_item_type base_item_type;
     typedef typename TestFixture::mock_disposer mock_disposer;
-    typedef typename TestFixture::template cmp<base_item_type> cmp;
+    typedef typename TestFixture::template cmp<base_item_type> item_cmp;
     typedef typename TestFixture::hash_int hash_int;
 
     typedef ci::MichaelList< rcu_type
         , base_item_type
         , typename ci::michael_list::make_traits<
             ci::opt::hook< ci::michael_list::base_hook< ci::opt::gc< rcu_type > > >
-            , ci::opt::compare< cmp >
+            , ci::opt::compare< item_cmp >
             , ci::opt::disposer< mock_disposer >
         >::type
     > bucket_type;
@@ -93,14 +93,14 @@ TYPED_TEST_P( IntrusiveMichaelSet, base_less )
     typedef typename TestFixture::rcu_type rcu_type;
     typedef typename TestFixture::base_item_type base_item_type;
     typedef typename TestFixture::mock_disposer mock_disposer;
-    typedef typename TestFixture::template less<base_item_type> less;
+    typedef typename TestFixture::template less<base_item_type> item_less;
     typedef typename TestFixture::hash_int hash_int;
 
     typedef ci::MichaelList< rcu_type
         , base_item_type
         , typename ci::michael_list::make_traits<
             ci::opt::hook< ci::michael_list::base_hook< ci::opt::gc< rcu_type >>>
-            , ci::opt::less< less >
+            , ci::opt::less< item_less >
             , ci::opt::disposer< mock_disposer >
         >::type
     > bucket_type;
@@ -168,6 +168,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, base_stat )
 
     set_type s( TestFixture::kSize, 2 );
     this->test( s );
+    EXPECT_GE( s.statistics().m_nInsertSuccess, 0u );
 }
 
 TYPED_TEST_P( IntrusiveMichaelSet, base_wrapped_stat )
@@ -196,6 +197,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, base_wrapped_stat )
 
     set_type s( TestFixture::kSize, 2 );
     this->test( s );
+    EXPECT_GE( s.statistics().m_nInsertSuccess, 0u );
 }
 
 TYPED_TEST_P( IntrusiveMichaelSet, member_cmp )
@@ -203,7 +205,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, member_cmp )
     typedef typename TestFixture::rcu_type rcu_type;
     typedef typename TestFixture::member_item_type member_item_type;
     typedef typename TestFixture::mock_disposer mock_disposer;
-    typedef typename TestFixture::template cmp<member_item_type> cmp;
+    typedef typename TestFixture::template cmp<member_item_type> item_cmp;
     typedef typename TestFixture::hash_int hash_int;
 
     typedef ci::MichaelList< rcu_type
@@ -213,7 +215,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, member_cmp )
                 offsetof( member_item_type, hMember ),
                 ci::opt::gc<rcu_type>
             >>
-            , ci::opt::compare< cmp >
+            , ci::opt::compare< item_cmp >
             , ci::opt::disposer< mock_disposer >
         >::type
     >    bucket_type;
@@ -233,7 +235,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, member_less )
     typedef typename TestFixture::rcu_type rcu_type;
     typedef typename TestFixture::member_item_type member_item_type;
     typedef typename TestFixture::mock_disposer mock_disposer;
-    typedef typename TestFixture::template less<member_item_type> less;
+    typedef typename TestFixture::template less<member_item_type> item_less;
     typedef typename TestFixture::hash_int hash_int;
 
     typedef ci::MichaelList< rcu_type
@@ -243,7 +245,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, member_less )
                 offsetof( member_item_type, hMember ),
                 ci::opt::gc<rcu_type>
             > >
-            , ci::opt::less< less >
+            , ci::opt::less< item_less >
             , ci::opt::disposer< mock_disposer >
         >::type
     > bucket_type;
@@ -310,6 +312,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, member_stat )
 
     set_type s( TestFixture::kSize, 2 );
     this->test( s );
+    EXPECT_GE( s.statistics().m_nInsertSuccess, 0u );
 }
 
 TYPED_TEST_P( IntrusiveMichaelSet, member_wrapped_stat )
@@ -337,6 +340,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, member_wrapped_stat )
 
     set_type s( TestFixture::kSize, 2 );
     this->test( s );
+    EXPECT_GE( s.statistics().m_nInsertSuccess, 0u );
 }
 
 // GCC 5: All test names should be written on single line, otherwise a runtime error will be encountered like as
@@ -347,4 +351,4 @@ REGISTER_TYPED_TEST_CASE_P( IntrusiveMichaelSet,
 
 
 #endif // CDSUNIT_SET_TEST_INTRUSIVE_MICHAEL_MICHAEL_RCU_H
\ No newline at end of file
+