Removed redundant spaces
[libcds.git] / test / unit / set / test_set.h
index 31f1e5e34ba5db40a948c0746572090e0fee16a5..946e605afb0c8c3ca1078235785a40f8e87f94e5 100644 (file)
@@ -46,7 +46,7 @@ namespace cds_test {
             // Precondition: set is empty
             // Postcondition: set is empty
 
-            ASSERT_TRUE( s.empty() );
+            ASSERT_TRUE( s.empty());
             ASSERT_CONTAINER_SIZE( s, 0 );
             size_t const nSetSize = kSize;
 
@@ -57,18 +57,18 @@ namespace cds_test {
             data.reserve( kSize );
             indices.reserve( kSize );
             for ( size_t key = 0; key < kSize; ++key ) {
-                data.push_back( value_type( static_cast<int>(key) ) );
+                data.push_back( value_type( static_cast<int>(key)) );
                 indices.push_back( key );
             }
-            shuffle( indices.begin(), indices.end() );
+            shuffle( indices.begin(), indices.end());
 
             // insert/find
             for ( auto idx : indices ) {
                 auto& i = data[idx];
 
-                ASSERT_FALSE( s.contains( i.nKey ) );
-                ASSERT_FALSE( s.contains( i ) );
-                ASSERT_FALSE( s.contains( other_item( i.key() ), other_less()));
+                ASSERT_FALSE( s.contains( i.nKey ));
+                ASSERT_FALSE( s.contains( i ));
+                ASSERT_FALSE( s.contains( other_item( i.key()), other_less()));
                 ASSERT_FALSE( s.find( i.nKey, []( value_type&, int ) {} ));
                 ASSERT_FALSE( s.find( i, []( value_type&, value_type const& ) {} ));
                 ASSERT_FALSE( s.find_with( other_item( i.key()), other_less(), []( value_type&, other_item const& ) {} ));
@@ -90,14 +90,14 @@ namespace cds_test {
                     updResult = s.update( i, []( bool bNew, value_type& val, value_type const& arg)
                         {
                             EXPECT_FALSE( bNew );
-                            EXPECT_EQ( val.key(), arg.key() );
+                            EXPECT_EQ( val.key(), arg.key());
                         }, false );
                     EXPECT_TRUE( updResult.first );
                     EXPECT_FALSE( updResult.second );
                     break;
                 case 1:
-                    ASSERT_TRUE( s.insert( i.key() ));
-                    ASSERT_FALSE( s.insert( i.key() ));
+                    ASSERT_TRUE( s.insert( i.key()));
+                    ASSERT_FALSE( s.insert( i.key()));
                     updResult = s.update( i.key(), []( bool bNew, value_type& val, int arg)
                         {
                             EXPECT_FALSE( bNew );
@@ -128,7 +128,7 @@ namespace cds_test {
                     updResult = s.update( i, []( bool bNew, value_type& v, value_type const& arg )
                         {
                             EXPECT_TRUE( bNew );
-                            EXPECT_EQ( v.key(), arg.key() );
+                            EXPECT_EQ( v.key(), arg.key());
                             ++v.nUpdateNewCount;
                         });
                     EXPECT_TRUE( updResult.first );
@@ -137,7 +137,7 @@ namespace cds_test {
                     updResult = s.update( i, []( bool bNew, value_type& v, value_type const& arg )
                         {
                             EXPECT_FALSE( bNew );
-                            EXPECT_EQ( v.key(), arg.key() );
+                            EXPECT_EQ( v.key(), arg.key());
                             ++v.nUpdateNewCount;
                         }, false );
                     EXPECT_TRUE( updResult.first );
@@ -170,7 +170,7 @@ namespace cds_test {
 
                     ASSERT_TRUE( s.find( i, []( value_type const& v, value_type const& arg )
                         {
-                            EXPECT_EQ( v.key(), arg.key() );
+                            EXPECT_EQ( v.key(), arg.key());
                             EXPECT_EQ( v.nUpdateNewCount, 2u );
                         }));
                     break;
@@ -178,7 +178,7 @@ namespace cds_test {
                     ASSERT_TRUE( s.emplace( i.key()));
                     ASSERT_TRUE( s.find( i, []( value_type const& v, value_type const& arg )
                         {
-                            EXPECT_EQ( v.key(), arg.key() );
+                            EXPECT_EQ( v.key(), arg.key());
                             EXPECT_EQ( v.nVal, arg.nVal );
                         }));
                     break;
@@ -188,35 +188,35 @@ namespace cds_test {
                     EXPECT_TRUE( str.empty());
                     ASSERT_TRUE( s.find( i, []( value_type const& v, value_type const& arg )
                         {
-                            EXPECT_EQ( v.key(), arg.key() );
+                            EXPECT_EQ( v.key(), arg.key());
                             EXPECT_EQ( v.nVal, arg.nVal );
                             EXPECT_EQ( v.strVal, std::string( "Hello!" ));
-                        } ) );
+                        } ));
                     break;
                 default:
                     // forgot anything?..
                     ASSERT_TRUE( false );
                 }
 
-                ASSERT_TRUE( s.contains( i.nKey ) );
-                ASSERT_TRUE( s.contains( i ) );
-                ASSERT_TRUE( s.contains( other_item( i.key() ), other_less() ) );
-                ASSERT_TRUE( s.find( i.nKey, []( value_type&, int ) {} ) );
-                ASSERT_TRUE( s.find( i, []( value_type&, value_type const& ) {} ) );
-                ASSERT_TRUE( s.find_with( other_item( i.key() ), other_less(), []( value_type&, other_item const& ) {} ) );
+                ASSERT_TRUE( s.contains( i.nKey ));
+                ASSERT_TRUE( s.contains( i ));
+                ASSERT_TRUE( s.contains( other_item( i.key()), other_less()) );
+                ASSERT_TRUE( s.find( i.nKey, []( value_type&, int ) {} ));
+                ASSERT_TRUE( s.find( i, []( value_type&, value_type const& ) {} ));
+                ASSERT_TRUE( s.find_with( other_item( i.key()), other_less(), []( value_type&, other_item const& ) {} ));
             }
 
-            ASSERT_FALSE( s.empty() );
+            ASSERT_FALSE( s.empty());
             ASSERT_CONTAINER_SIZE( s, nSetSize );
 
             // erase
-            shuffle( indices.begin(), indices.end() );
+            shuffle( indices.begin(), indices.end());
             for ( auto idx : indices ) {
                 auto& i = data[idx];
 
-                ASSERT_TRUE( s.contains( i.nKey ) );
-                ASSERT_TRUE( s.contains( i ) );
-                ASSERT_TRUE( s.contains( other_item( i.key() ), other_less() ) );
+                ASSERT_TRUE( s.contains( i.nKey ));
+                ASSERT_TRUE( s.contains( i ));
+                ASSERT_TRUE( s.contains( other_item( i.key()), other_less()) );
                 ASSERT_TRUE( s.find( i.nKey, []( value_type& v, int )
                     {
                         v.nFindCount = 1;
@@ -225,7 +225,7 @@ namespace cds_test {
                     {
                         EXPECT_EQ( ++v.nFindCount, 2u );
                     }));
-                ASSERT_TRUE( s.find_with( other_item( i.key() ), other_less(), []( value_type& v, other_item const& )
+                ASSERT_TRUE( s.find_with( other_item( i.key()), other_less(), []( value_type& v, other_item const& )
                     {
                         EXPECT_EQ( ++v.nFindCount, 3u );
                     }));
@@ -242,7 +242,7 @@ namespace cds_test {
                     break;
                 case 2:
                     ASSERT_TRUE( s.erase_with( other_item( i.key()), other_less()));
-                    ASSERT_FALSE( s.erase_with( other_item( i.key() ), other_less() ) );
+                    ASSERT_FALSE( s.erase_with( other_item( i.key()), other_less()) );
                     break;
                 case 3:
                     ASSERT_TRUE( s.erase( i.key(), [&nKey]( value_type const& v )
@@ -288,32 +288,32 @@ namespace cds_test {
                     break;
                 }
 
-                ASSERT_FALSE( s.contains( i.nKey ) );
-                ASSERT_FALSE( s.contains( i ) );
-                ASSERT_FALSE( s.contains( other_item( i.key() ), other_less()));
+                ASSERT_FALSE( s.contains( i.nKey ));
+                ASSERT_FALSE( s.contains( i ));
+                ASSERT_FALSE( s.contains( other_item( i.key()), other_less()));
                 ASSERT_FALSE( s.find( i.nKey, []( value_type&, int ) {} ));
                 ASSERT_FALSE( s.find( i, []( value_type&, value_type const& ) {} ));
                 ASSERT_FALSE( s.find_with( other_item( i.key()), other_less(), []( value_type&, other_item const& ) {} ));
             }
-            ASSERT_TRUE( s.empty() );
+            ASSERT_TRUE( s.empty());
             ASSERT_CONTAINER_SIZE( s, 0u );
 
 
             // clear
             for ( auto& i : data ) {
-                ASSERT_TRUE( s.insert( i ) );
+                ASSERT_TRUE( s.insert( i ));
             }
 
-            ASSERT_FALSE( s.empty() );
+            ASSERT_FALSE( s.empty());
             ASSERT_CONTAINER_SIZE( s, nSetSize );
 
             s.clear();
 
-            ASSERT_TRUE( s.empty() );
+            ASSERT_TRUE( s.empty());
             ASSERT_CONTAINER_SIZE( s, 0u );
 
-            ASSERT_TRUE( s.begin() == s.end() );
-            ASSERT_TRUE( s.cbegin() == s.cend() );
+            ASSERT_TRUE( s.begin() == s.end());
+            ASSERT_TRUE( s.cbegin() == s.cend());
         }
     };