Removed redundant spaces
[libcds.git] / test / unit / map / test_map.h
index 3253705f1987c68ee09ebe9a3f56f4ce6e1c18bf..6593f3b6c9f1749199330f9c0f9403002d25f56e 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:
 
     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_TEST_MAP_H
 #define CDSUNIT_MAP_TEST_MAP_H
 
-#include <cds_test/check_size.h>
-#include <cds_test/fixture.h>
-
-#include <cds/opt/hash.h>
+#include "test_map_data.h"
 
 // forward declaration
 namespace cds { namespace container {} }
 
 namespace cds_test {
 
-    class container_map: public fixture
+    class container_map: public map_fixture
     {
     public:
         static size_t const kSize = 1000;
 
-        struct key_type {
-            int nKey;
-
-            explicit key_type( int n )
-                : nKey( n )
-            {}
-
-            explicit key_type( std::string const& str )
-                : nKey( std::stoi( str ))
-            {}
-        };
-
-        struct value_type {
-            int nVal;
-            std::string strVal;
-
-            value_type()
-                : nVal( 0 )
-            {}
-
-            explicit value_type( int n )
-                : nVal( n )
-                , strVal( std::to_string( n ))
-            {}
-
-            explicit value_type( std::string const& str )
-                : nVal( std::stoi( str ))
-                , strVal( str )
-            {}
-
-            explicit value_type( std::string&& str )
-                : nVal( std::stoi( str ))
-                , strVal( std::move( str ))
-            {}
-
-            value_type( int n, std::string const& str )
-                : nVal( n )
-                , strVal( str )
-            {}
-
-            value_type( int n, std::string&& str )
-                : nVal( n )
-                , strVal( std::move( str ))
-            {}
-
-            value_type( value_type&& v )
-                : nVal( v.nVal )
-                , strVal( std::move( v.strVal ))
-            {}
-
-            value_type( value_type const& v )
-                : nVal( v.nVal )
-                , strVal( v.strVal )
-            {}
-
-            value_type& operator=( value_type const& v )
-            {
-                if ( this != &v ) {
-                    nVal = v.nVal;
-                    strVal = v.strVal;
-                }
-                return *this;
-            }
-
-            value_type& operator=( value_type&& v )
-            {
-                if ( this != &v ) {
-                    nVal = v.nVal;
-                    strVal = std::move( v.strVal );
-                }
-                return *this;
-            }
-        };
-
-        typedef std::pair<key_type const, value_type> pair_type;
-
-        struct less
-        {
-            bool operator ()( key_type const& v1, key_type const& v2 ) const
-            {
-                return v1.nKey < v2.nKey;
-            }
-
-            bool operator ()( key_type const& v1, int v2 ) const
-            {
-                return v1.nKey < v2;
-            }
-
-            bool operator ()( int v1, key_type const& v2 ) const
-            {
-                return v1 < v2.nKey;
-            }
-
-            bool operator ()( key_type const& v1, std::string const& v2 ) const
-            {
-                return v1.nKey < std::stoi(v2 );
-            }
-
-            bool operator ()( std::string const& v1, key_type const& v2 ) const
-            {
-                return std::stoi( v1 ) < v2.nKey;
-            }
-        };
-
-        struct cmp {
-            int operator ()( key_type const& v1, key_type const& v2 ) const
-            {
-                if ( v1.nKey < v2.nKey )
-                    return -1;
-                return v1.nKey > v2.nKey ? 1 : 0;
-            }
-
-            int operator ()( key_type const& v1, int v2 ) const
-            {
-                if ( v1.nKey < v2 )
-                    return -1;
-                return v1.nKey > v2 ? 1 : 0;
-            }
-
-            int operator ()( int v1, key_type const& v2 ) const
-            {
-                if ( v1 < v2.nKey )
-                    return -1;
-                return v1 > v2.nKey ? 1 : 0;
-            }
-
-            int operator ()( key_type const& v1, std::string const& v2 ) const
-            {
-                int n2 = std::stoi( v2 );
-                if ( v1.nKey < n2 )
-                    return -1;
-                return v1.nKey > n2 ? 1 : 0;
-            }
-
-            int operator ()( std::string const& v1, key_type const& v2 ) const
-            {
-                int n1 = std::stoi( v1 );
-                if ( n1 < v2.nKey )
-                    return -1;
-                return n1 > v2.nKey ? 1 : 0;
-            }
-        };
-
-        struct hash1 {
-            size_t operator()( int i ) const
-            {
-                return cds::opt::v::hash<int>()( i );
-            }
-
-            size_t operator()( std::string const& str ) const
-            {
-                return cds::opt::v::hash<int>()( std::stoi( str ));
-            }
-
-            template <typename T>
-            size_t operator()( T const& i ) const
-            {
-                return cds::opt::v::hash<int>()(i.nKey);
-            }
-        };
-
-        struct other_item {
-            int nKey;
-
-            other_item( int key )
-                : nKey( key )
-            {}
-        };
-
-        struct other_less
-        {
-            bool operator ()( key_type const& v1, other_item const& v2 ) const
-            {
-                return v1.nKey < v2.nKey;
-            }
-            bool operator ()( other_item const& v1, key_type const& v2 ) const
-            {
-                return v1.nKey < v2.nKey;
-            }
-        };
-
     protected:
         template <class Map>
         void test( Map& m )
@@ -234,18 +50,19 @@ namespace cds_test {
             // Precondition: map is empty
             // Postcondition: map is empty
 
-            ASSERT_TRUE( m.empty());
-            ASSERT_CONTAINER_SIZE( m, 0 );
+            EXPECT_TRUE( m.empty());
+            EXPECT_CONTAINER_SIZE( m, 0 );
 
-            typedef Map::value_type map_pair;
+            typedef typename Map::value_type map_pair;
+            size_t const kkSize = kSize;
 
             std::vector<key_type> arrKeys;
-            for ( int i = 0; i < static_cast<int>(kSize); ++i )
+            for ( int i = 0; i < static_cast<int>(kkSize); ++i )
                 arrKeys.push_back( key_type( i ));
             shuffle( arrKeys.begin(), arrKeys.end());
 
             std::vector< value_type > arrVals;
-            for ( size_t i = 0; i < kSize; ++i ) {
+            for ( size_t i = 0; i < kkSize; ++i ) {
                 value_type val;
                 val.nVal = static_cast<int>( i );
                 val.strVal = std::to_string( i );
@@ -256,16 +73,16 @@ namespace cds_test {
             for ( auto const& i : arrKeys ) {
                 value_type const& val( arrVals.at( i.nKey ));
 
-                ASSERT_FALSE( m.contains( i.nKey ));
-                ASSERT_FALSE( m.contains( i ));
-                ASSERT_FALSE( m.contains( other_item( i.nKey ), other_less()));
-                ASSERT_FALSE( m.find( i, []( map_pair const& ) {
-                    ASSERT_TRUE( false );
+                EXPECT_FALSE( m.contains( i.nKey ));
+                EXPECT_FALSE( m.contains( i ));
+                EXPECT_FALSE( m.contains( other_item( i.nKey ), other_less()));
+                EXPECT_FALSE( m.find( i, []( map_pair const& ) {
+                    EXPECT_TRUE( false );
                 } ));
-                ASSERT_FALSE( m.find( i.nKey, []( map_pair const& ) {
+                EXPECT_FALSE( m.find( i.nKey, []( map_pair const& ) {
                     EXPECT_TRUE( false );
                 } ));
-                ASSERT_FALSE( m.find_with( other_item( i.nKey ), other_less(), []( map_pair const& ) {
+                EXPECT_FALSE( m.find_with( other_item( i.nKey ), other_less(), []( map_pair const& ) {
                     EXPECT_TRUE( false );
                 } ));
 
@@ -273,65 +90,65 @@ namespace cds_test {
 
                 switch ( i.nKey % 16 ) {
                 case 0:
-                    ASSERT_TRUE( m.insert( i ));
-                    ASSERT_FALSE( m.insert( i ));
-                    ASSERT_TRUE( m.find( i.nKey, []( map_pair& v ) {
+                    EXPECT_TRUE( m.insert( i ));
+                    EXPECT_FALSE( m.insert( i ));
+                    EXPECT_TRUE( m.find( i.nKey, []( map_pair& v ) {
                         v.second.nVal = v.first.nKey;
                         v.second.strVal = std::to_string( v.first.nKey );
                     } ));
                     break;
                 case 1:
-                    ASSERT_TRUE( m.insert( i.nKey ));
-                    ASSERT_FALSE( m.insert( i.nKey ));
-                    ASSERT_TRUE( m.find( i.nKey, []( map_pair& v ) {
+                    EXPECT_TRUE( m.insert( i.nKey ));
+                    EXPECT_FALSE( m.insert( i.nKey ));
+                    EXPECT_TRUE( m.find( i.nKey, []( map_pair& v ) {
                         v.second.nVal = v.first.nKey;
                         v.second.strVal = std::to_string( v.first.nKey );
                     } ));
                     break;
                 case 2:
-                    ASSERT_TRUE( m.insert( std::to_string( i.nKey )));
-                    ASSERT_FALSE( m.insert( std::to_string( i.nKey )));
-                    ASSERT_TRUE( m.find( i.nKey, []( map_pair& v ) {
+                    EXPECT_TRUE( m.insert( std::to_string( i.nKey )));
+                    EXPECT_FALSE( m.insert( std::to_string( i.nKey )));
+                    EXPECT_TRUE( m.find( i.nKey, []( map_pair& v ) {
                         v.second.nVal = v.first.nKey;
                         v.second.strVal = std::to_string( v.first.nKey );
                     } ));
                     break;
                 case 3:
-                    ASSERT_TRUE( m.insert( i, val ));
-                    ASSERT_FALSE( m.insert( i, val ));
+                    EXPECT_TRUE( m.insert( i, val ));
+                    EXPECT_FALSE( m.insert( i, val ));
                     break;
                 case 4:
-                    ASSERT_TRUE( m.insert( i.nKey, val.strVal ));
-                    ASSERT_FALSE( m.insert( i.nKey, val.strVal ));
+                    EXPECT_TRUE( m.insert( i.nKey, val.strVal ));
+                    EXPECT_FALSE( m.insert( i.nKey, val.strVal ));
                     break;
                 case 5:
-                    ASSERT_TRUE( m.insert( val.strVal, i.nKey ));
-                    ASSERT_FALSE( m.insert( val.strVal, i.nKey ));
+                    EXPECT_TRUE( m.insert( val.strVal, i.nKey ));
+                    EXPECT_FALSE( m.insert( val.strVal, i.nKey ));
                     break;
                 case 6:
-                    ASSERT_TRUE( m.insert_with( i, []( map_pair& v ) {
+                    EXPECT_TRUE( m.insert_with( i, []( map_pair& v ) {
                         v.second.nVal = v.first.nKey;
                         v.second.strVal = std::to_string( v.first.nKey );
                     } ));
-                    ASSERT_FALSE( m.insert_with( i, []( map_pair& v ) {
+                    EXPECT_FALSE( m.insert_with( i, []( map_pair& ) {
                         EXPECT_TRUE( false );
                     } ));
                     break;
                 case 7:
-                    ASSERT_TRUE( m.insert_with( i.nKey, []( map_pair& v ) {
+                    EXPECT_TRUE( m.insert_with( i.nKey, []( map_pair& v ) {
                         v.second.nVal = v.first.nKey;
                         v.second.strVal = std::to_string( v.first.nKey );
                     } ));
-                    ASSERT_FALSE( m.insert_with( i.nKey, []( map_pair& v ) {
+                    EXPECT_FALSE( m.insert_with( i.nKey, []( map_pair& ) {
                         EXPECT_TRUE( false );
                     } ));
                     break;
                 case 8:
-                    ASSERT_TRUE( m.insert_with( val.strVal, []( map_pair& v ) {
+                    EXPECT_TRUE( m.insert_with( val.strVal, []( map_pair& v ) {
                         v.second.nVal = v.first.nKey;
                         v.second.strVal = std::to_string( v.first.nKey );
                     } ));
-                    ASSERT_FALSE( m.insert_with( val.strVal, []( map_pair& v ) {
+                    EXPECT_FALSE( m.insert_with( val.strVal, []( map_pair& ) {
                         EXPECT_TRUE( false );
                     } ));
                     break;
@@ -339,142 +156,142 @@ namespace cds_test {
                     updResult = m.update( i.nKey, []( bool, map_pair& ) {
                         EXPECT_TRUE( false );
                     }, false );
-                    ASSERT_FALSE( updResult.first );
-                    ASSERT_FALSE( updResult.second );
+                    EXPECT_FALSE( updResult.first );
+                    EXPECT_FALSE( updResult.second );
 
                     updResult = m.update( i.nKey, []( bool bNew, map_pair& v ) {
                         EXPECT_TRUE( bNew );
                         v.second.nVal = v.first.nKey;
                     });
-                    ASSERT_TRUE( updResult.first );
-                    ASSERT_TRUE( updResult.second );
+                    EXPECT_TRUE( updResult.first );
+                    EXPECT_TRUE( updResult.second );
 
                     updResult = m.update( i.nKey, []( bool bNew, map_pair& v ) {
                         EXPECT_FALSE( bNew );
                         EXPECT_EQ( v.first.nKey, v.second.nVal );
                         v.second.strVal = std::to_string( v.second.nVal );
                     } );
-                    ASSERT_TRUE( updResult.first );
-                    ASSERT_FALSE( updResult.second );
+                    EXPECT_TRUE( updResult.first );
+                    EXPECT_FALSE( updResult.second );
                     break;
                 case 10:
                     updResult = m.update( i, []( bool, map_pair& ) {
                         EXPECT_TRUE( false );
                     }, false );
-                    ASSERT_FALSE( updResult.first );
-                    ASSERT_FALSE( updResult.second );
+                    EXPECT_FALSE( updResult.first );
+                    EXPECT_FALSE( updResult.second );
 
                     updResult = m.update( i, []( bool bNew, map_pair& v ) {
                         EXPECT_TRUE( bNew );
                         v.second.nVal = v.first.nKey;
                     });
-                    ASSERT_TRUE( updResult.first );
-                    ASSERT_TRUE( updResult.second );
+                    EXPECT_TRUE( updResult.first );
+                    EXPECT_TRUE( updResult.second );
 
                     updResult = m.update( i, []( bool bNew, map_pair& v ) {
                         EXPECT_FALSE( bNew );
                         EXPECT_EQ( v.first.nKey, v.second.nVal );
                         v.second.strVal = std::to_string( v.second.nVal );
                     } );
-                    ASSERT_TRUE( updResult.first );
-                    ASSERT_FALSE( updResult.second );
+                    EXPECT_TRUE( updResult.first );
+                    EXPECT_FALSE( updResult.second );
                     break;
                 case 11:
                     updResult = m.update( val.strVal, []( bool, map_pair& ) {
                         EXPECT_TRUE( false );
                     }, false );
-                    ASSERT_FALSE( updResult.first );
-                    ASSERT_FALSE( updResult.second );
+                    EXPECT_FALSE( updResult.first );
+                    EXPECT_FALSE( updResult.second );
 
                     updResult = m.update( val.strVal, []( bool bNew, map_pair& v ) {
                         EXPECT_TRUE( bNew );
                         v.second.nVal = v.first.nKey;
                     });
-                    ASSERT_TRUE( updResult.first );
-                    ASSERT_TRUE( updResult.second );
+                    EXPECT_TRUE( updResult.first );
+                    EXPECT_TRUE( updResult.second );
 
                     updResult = m.update( val.strVal, []( bool bNew, map_pair& v ) {
                         EXPECT_FALSE( bNew );
                         EXPECT_EQ( v.first.nKey, v.second.nVal );
                         v.second.strVal = std::to_string( v.second.nVal );
                     } );
-                    ASSERT_TRUE( updResult.first );
-                    ASSERT_FALSE( updResult.second );
+                    EXPECT_TRUE( updResult.first );
+                    EXPECT_FALSE( updResult.second );
                     break;
                 case 12:
-                    ASSERT_TRUE( m.emplace( i.nKey ));
-                    ASSERT_FALSE( m.emplace( i.nKey ));
-                    ASSERT_TRUE( m.find( i.nKey, []( map_pair& v ) {
+                    EXPECT_TRUE( m.emplace( i.nKey ));
+                    EXPECT_FALSE( m.emplace( i.nKey ));
+                    EXPECT_TRUE( m.find( i.nKey, []( map_pair& v ) {
                         v.second.nVal = v.first.nKey;
                         v.second.strVal = std::to_string( v.first.nKey );
                     } ));
                     break;
                 case 13:
-                    ASSERT_TRUE( m.emplace( i, i.nKey ));
-                    ASSERT_FALSE( m.emplace( i, i.nKey ));
+                    EXPECT_TRUE( m.emplace( i, i.nKey ));
+                    EXPECT_FALSE( m.emplace( i, i.nKey ));
                     break;
                 case 14:
                     {
                         std::string str = val.strVal;
-                        ASSERT_TRUE( m.emplace( i, std::move( str )));
-                        ASSERT_TRUE( str.empty());
+                        EXPECT_TRUE( m.emplace( i, std::move( str )));
+                        EXPECT_TRUE( str.empty());
                         str = val.strVal;
-                        ASSERT_FALSE( m.emplace( i, std::move( str )));
-                        ASSERT_TRUE( str.empty());
+                        EXPECT_FALSE( m.emplace( i, std::move( str )));
+                        EXPECT_TRUE( str.empty());
                     }
                     break;
                 case 15:
                     {
                         std::string str = val.strVal;
-                        ASSERT_TRUE( m.emplace( i, i.nKey, std::move( str )));
-                        ASSERT_TRUE( str.empty());
+                        EXPECT_TRUE( m.emplace( i, i.nKey, std::move( str )));
+                        EXPECT_TRUE( str.empty());
                         str = val.strVal;
-                        ASSERT_FALSE( m.emplace( i, i.nKey, std::move( str )));
-                        ASSERT_TRUE( str.empty());
+                        EXPECT_FALSE( m.emplace( i, i.nKey, std::move( str )));
+                        EXPECT_TRUE( str.empty());
                     }
                     break;
                 }
 
-                ASSERT_TRUE( m.contains( i.nKey ));
-                ASSERT_TRUE( m.contains( i ));
-                ASSERT_TRUE( m.contains( other_item( i.nKey ), other_less()));
-                ASSERT_TRUE( m.find( i, []( map_pair const& v ) {
+                EXPECT_TRUE( m.contains( i.nKey ));
+                EXPECT_TRUE( m.contains( i ));
+                EXPECT_TRUE( m.contains( other_item( i.nKey ), other_less()));
+                EXPECT_TRUE( m.find( i, []( map_pair const& v ) {
                     EXPECT_EQ( v.first.nKey, v.second.nVal );
                     EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
                 } ));
-                ASSERT_TRUE( m.find( i.nKey, []( map_pair const& v ) {
+                EXPECT_TRUE( m.find( i.nKey, []( map_pair const& v ) {
                     EXPECT_EQ( v.first.nKey, v.second.nVal );
                     EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
                 } ));
-                ASSERT_TRUE( m.find_with( other_item( i.nKey ), other_less(), []( map_pair const& v ) {
+                EXPECT_TRUE( m.find_with( other_item( i.nKey ), other_less(), []( map_pair const& v ) {
                     EXPECT_EQ( v.first.nKey, v.second.nVal );
                     EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
                 } ));
             }
-            ASSERT_FALSE( m.empty() );
-            ASSERT_CONTAINER_SIZE( m, kSize );
-            ASSERT_FALSE( m.begin() == m.end() );
-            ASSERT_FALSE( m.cbegin() == m.cend() );
+            EXPECT_FALSE( m.empty());
+            EXPECT_CONTAINER_SIZE( m, kkSize );
+            EXPECT_FALSE( m.begin() == m.end());
+            EXPECT_FALSE( m.cbegin() == m.cend());
 
-            shuffle( arrKeys.begin(), arrKeys.end() );
+            shuffle( arrKeys.begin(), arrKeys.end());
 
             // erase/find
             for ( auto const& i : arrKeys ) {
-                value_type const& val( arrVals.at( i.nKey ) );
+                value_type const& val( arrVals.at( i.nKey ));
 
-                ASSERT_TRUE( m.contains( i.nKey ));
-                ASSERT_TRUE( m.contains( val.strVal ) );
-                ASSERT_TRUE( m.contains( i ));
-                ASSERT_TRUE( m.contains( other_item( i.nKey ), other_less()));
-                ASSERT_TRUE( m.find( i, []( map_pair const& v ) {
+                EXPECT_TRUE( m.contains( i.nKey ));
+                EXPECT_TRUE( m.contains( val.strVal ));
+                EXPECT_TRUE( m.contains( i ));
+                EXPECT_TRUE( m.contains( other_item( i.nKey ), other_less()));
+                EXPECT_TRUE( m.find( i, []( map_pair const& v ) {
                     EXPECT_EQ( v.first.nKey, v.second.nVal );
                     EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
                 } ));
-                ASSERT_TRUE( m.find( i.nKey, []( map_pair const& v ) {
+                EXPECT_TRUE( m.find( i.nKey, []( map_pair const& v ) {
                     EXPECT_EQ( v.first.nKey, v.second.nVal );
                     EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
                 } ));
-                ASSERT_TRUE( m.find_with( other_item( i.nKey ), other_less(), []( map_pair const& v ) {
+                EXPECT_TRUE( m.find_with( other_item( i.nKey ), other_less(), []( map_pair const& v ) {
                     EXPECT_EQ( v.first.nKey, v.second.nVal );
                     EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
                 } ));
@@ -482,90 +299,90 @@ namespace cds_test {
 
                 switch ( i.nKey % 8 ) {
                 case 0:
-                    ASSERT_TRUE( m.erase( i ));
-                    ASSERT_FALSE( m.erase( i ));
+                    EXPECT_TRUE( m.erase( i ));
+                    EXPECT_FALSE( m.erase( i ));
                     break;
                 case 1:
-                    ASSERT_TRUE( m.erase( i.nKey ));
-                    ASSERT_FALSE( m.erase( i.nKey ));
+                    EXPECT_TRUE( m.erase( i.nKey ));
+                    EXPECT_FALSE( m.erase( i.nKey ));
                     break;
                 case 2:
-                    ASSERT_TRUE( m.erase( val.strVal ));
-                    ASSERT_FALSE( m.erase( val.strVal ));
+                    EXPECT_TRUE( m.erase( val.strVal ));
+                    EXPECT_FALSE( m.erase( val.strVal ));
                     break;
                 case 3:
-                    ASSERT_TRUE( m.erase_with( other_item( i.nKey ), other_less()));
-                    ASSERT_FALSE( m.erase_with( other_item( i.nKey ), other_less()));
+                    EXPECT_TRUE( m.erase_with( other_item( i.nKey ), other_less()));
+                    EXPECT_FALSE( m.erase_with( other_item( i.nKey ), other_less()));
                     break;
                 case 4:
-                    ASSERT_TRUE( m.erase( i, []( map_pair& v ) {
+                    EXPECT_TRUE( m.erase( i, []( map_pair& v ) {
                         EXPECT_EQ( v.first.nKey, v.second.nVal );
                         EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
                     }));
-                    ASSERT_FALSE( m.erase( i, []( map_pair& ) {
+                    EXPECT_FALSE( m.erase( i, []( map_pair& ) {
                         EXPECT_TRUE( false );
                     }));
                     break;
                 case 5:
-                    ASSERT_TRUE( m.erase( i.nKey, []( map_pair& v ) {
+                    EXPECT_TRUE( m.erase( i.nKey, []( map_pair& v ) {
                         EXPECT_EQ( v.first.nKey, v.second.nVal );
                         EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
                     }));
-                    ASSERT_FALSE( m.erase( i.nKey, []( map_pair& ) {
+                    EXPECT_FALSE( m.erase( i.nKey, []( map_pair& ) {
                         EXPECT_TRUE( false );
                     }));
                     break;
                 case 6:
-                    ASSERT_TRUE( m.erase( val.strVal, []( map_pair& v ) {
+                    EXPECT_TRUE( m.erase( val.strVal, []( map_pair& v ) {
                         EXPECT_EQ( v.first.nKey, v.second.nVal );
                         EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
                     }));
-                    ASSERT_FALSE( m.erase( val.strVal, []( map_pair& ) {
+                    EXPECT_FALSE( m.erase( val.strVal, []( map_pair& ) {
                         EXPECT_TRUE( false );
                     }));
                     break;
                 case 7:
-                    ASSERT_TRUE( m.erase_with( other_item( i.nKey ), other_less(), []( map_pair& v ) {
+                    EXPECT_TRUE( m.erase_with( other_item( i.nKey ), other_less(), []( map_pair& v ) {
                         EXPECT_EQ( v.first.nKey, v.second.nVal );
                         EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal );
                     }));
-                    ASSERT_FALSE( m.erase_with( other_item( i.nKey ), other_less(), []( map_pair& ) {
+                    EXPECT_FALSE( m.erase_with( other_item( i.nKey ), other_less(), []( map_pair& ) {
                         EXPECT_TRUE( false );
                     }));
                     break;
                 }
 
-                ASSERT_FALSE( m.contains( i.nKey ));
-                ASSERT_FALSE( m.contains( i ));
-                ASSERT_FALSE( m.contains( val.strVal ));
-                ASSERT_FALSE( m.contains( other_item( i.nKey ), other_less()));
-                ASSERT_FALSE( m.find( i, []( map_pair const& ) {
-                    ASSERT_TRUE( false );
+                EXPECT_FALSE( m.contains( i.nKey ));
+                EXPECT_FALSE( m.contains( i ));
+                EXPECT_FALSE( m.contains( val.strVal ));
+                EXPECT_FALSE( m.contains( other_item( i.nKey ), other_less()));
+                EXPECT_FALSE( m.find( i, []( map_pair const& ) {
+                    EXPECT_TRUE( false );
                 } ));
-                ASSERT_FALSE( m.find( i.nKey, []( map_pair const& ) {
+                EXPECT_FALSE( m.find( i.nKey, []( map_pair const& ) {
                     EXPECT_TRUE( false );
                 } ));
-                ASSERT_FALSE( m.find_with( other_item( i.nKey ), other_less(), []( map_pair const& ) {
+                EXPECT_FALSE( m.find_with( other_item( i.nKey ), other_less(), []( map_pair const& ) {
                     EXPECT_TRUE( false );
                 } ));
             }
-            ASSERT_TRUE( m.empty() );
-            ASSERT_CONTAINER_SIZE( m, 0 );
+            EXPECT_TRUE( m.empty());
+            EXPECT_CONTAINER_SIZE( m, 0 );
 
-            ASSERT_TRUE( m.begin() == m.end());
-            ASSERT_TRUE( m.cbegin() == m.cend());
+            EXPECT_TRUE( m.begin() == m.end());
+            EXPECT_TRUE( m.cbegin() == m.cend());
 
             // clear
             for ( auto const& i : arrKeys )
-                ASSERT_TRUE( m.insert( i ));
+                EXPECT_TRUE( m.insert( i ));
 
-            ASSERT_FALSE( m.empty() );
-            ASSERT_CONTAINER_SIZE( m, kSize );
+            EXPECT_FALSE( m.empty());
+            EXPECT_CONTAINER_SIZE( m, kkSize );
 
             m.clear();
 
-            ASSERT_TRUE( m.empty() );
-            ASSERT_CONTAINER_SIZE( m, 0 );
+            EXPECT_TRUE( m.empty());
+            EXPECT_CONTAINER_SIZE( m, 0 );
         }
     };