Removes unnecessary test cases for maps
[libcds.git] / test / stress / map / map_type_std.h
index 30ce916a4aed63fd639efd0fe7c778703df69b6b..8b88c673e614cf5f324cff37dd75795ee7d57788 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.
 */
 
 #ifndef CDSUNIT_MAP_TYPE_STD_H
@@ -73,14 +73,14 @@ namespace map {
         bool insert( const Key& key, const Value& val )
         {
             scoped_lock al( m_lock );
-            return base_class::insert( typename base_class::value_type( key, val ) ).second;
+            return base_class::insert( typename base_class::value_type( key, val )).second;
         }
 
         template <typename T, typename Func>
         bool insert( const Key& key, const T& val, Func func )
         {
             scoped_lock al( m_lock );
-            std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value() ) );
+            std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value()));
             if ( pRet.second ) {
                 func( pRet.first->second, val );
                 return true;
@@ -92,7 +92,7 @@ namespace map {
         std::pair<bool, bool> update( const T& key, Func func, bool /*bAllowInsert*/ = true )
         {
             scoped_lock al( m_lock );
-            std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value() ) );
+            std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value()));
             if ( pRet.second ) {
                 func( true, *pRet.first );
                 return std::make_pair( true, true );
@@ -114,16 +114,18 @@ namespace map {
         {
             scoped_lock al( m_lock );
             typename base_class::iterator it = base_class::find( key );
-            if ( it != base_class::end() ) {
-                func( (*it) );
+            if ( it != base_class::end()) {
+                func( (*it));
                 base_class::erase( it );
                 return true;
             }
             return false;
         }
 
-        std::ostream& dump( std::ostream& stm ) { return stm; }
-
+        empty_stat statistics() const
+        {
+            return empty_stat();
+        }
 
         // for testing
         static CDS_CONSTEXPR bool const c_bExtractSupported = false;
@@ -178,7 +180,7 @@ namespace map {
         bool insert( const Key& key, const T& val, Func func )
         {
             scoped_lock al( m_lock );
-            std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type(key, Value() ));
+            std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type(key, Value()));
             if ( pRet.second ) {
                 func( pRet.first->second, val );
                 return true;
@@ -190,7 +192,7 @@ namespace map {
         std::pair<bool, bool> update( const T& key, Func func, bool /*bAllowInsert*/ = true )
         {
             scoped_lock al( m_lock );
-            std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value() ));
+            std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value()));
             if ( pRet.second ) {
                 func( true, *pRet.first );
                 return std::make_pair( true, true );
@@ -212,21 +214,24 @@ namespace map {
         {
             scoped_lock al( m_lock );
             typename base_class::iterator it = base_class::find( key );
-            if ( it != base_class::end() ) {
+            if ( it != base_class::end()) {
                 func( *it );
                 return base_class::erase( key ) != 0;
             }
             return false;
         }
 
-        std::ostream& dump( std::ostream& stm ) { return stm; }
+        empty_stat statistics() const
+        {
+            return empty_stat();
+        }
 
 
         // for testing
         static CDS_CONSTEXPR bool const c_bExtractSupported = false;
         static CDS_CONSTEXPR bool const c_bLoadFactorDepended = false;
         static CDS_CONSTEXPR bool const c_bEraseExactKey = false;
-    }; 
+    };
 
     struct tag_StdMap;
 
@@ -247,6 +252,7 @@ namespace map {
     };
 }   // namespace map
 
+
 #define CDSSTRESS_StdMap_case( fixture, test_case, std_map_type, key_type, value_type ) \
     TEST_F( fixture, std_map_type ) \
     { \
@@ -256,9 +262,7 @@ namespace map {
 
 #define CDSSTRESS_StdMap( fixture, test_case, key_type, value_type ) \
     CDSSTRESS_StdMap_case( fixture, test_case, StdMap_Spin,      key_type, value_type ) \
-    CDSSTRESS_StdMap_case( fixture, test_case, StdMap_Mutex,     key_type, value_type ) \
     CDSSTRESS_StdMap_case( fixture, test_case, StdHashMap_Spin,  key_type, value_type ) \
-    CDSSTRESS_StdMap_case( fixture, test_case, StdHashMap_Mutex, key_type, value_type )
 
 #define CDSSTRESS_StdMap_nolock( fixture, test_case, key_type, value_type ) \
     CDSSTRESS_StdMap_case( fixture, test_case, StdMap_NoLock,      key_type, value_type ) \