Removed redundant spaces
[libcds.git] / test / unit / set / test_split_iterable.h
index 09c688c9436663e4b934c66e49795f76affef9a4..635682dea2206b22c17414ae38cb2a0d2eeacd58 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,25 +57,25 @@ 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];
 
-                EXPECT_FALSE( s.contains( i.nKey ) );
-                EXPECT_FALSE( s.contains( i ) );
-                EXPECT_FALSE( s.contains( other_item( i.key() ), other_less()));
+                EXPECT_FALSE( s.contains( i.nKey ));
+                EXPECT_FALSE( s.contains( i ));
+                EXPECT_FALSE( s.contains( other_item( i.key()), other_less()));
                 EXPECT_FALSE( s.find( i.nKey, []( value_type&, int ) {} ));
                 EXPECT_FALSE( s.find( i, []( value_type&, value_type const& ) {} ));
                 EXPECT_FALSE( s.find_with( other_item( i.key()), other_less(), []( value_type&, other_item const& ) {} ));
 
-                EXPECT_TRUE( s.find( i.nKey ) == s.end() );
-                EXPECT_TRUE( s.find( i ) == s.end() );
-                EXPECT_TRUE( s.find_with( other_item( i.key() ), other_less() ) == s.end() );
+                EXPECT_TRUE( s.find( i.nKey ) == s.end());
+                EXPECT_TRUE( s.find( i ) == s.end());
+                EXPECT_TRUE( s.find_with( other_item( i.key()), other_less()) == s.end());
 
                 std::pair<bool, bool> updResult;
 
@@ -94,18 +94,18 @@ namespace cds_test {
                     updResult = s.update( i, []( value_type& cur, value_type* old )
                         {
                             EXPECT_FALSE( old == nullptr );
-                            EXPECT_EQ( cur.key(), old->key() );
+                            EXPECT_EQ( cur.key(), old->key());
                         }, false );
                     EXPECT_TRUE( updResult.first );
                     EXPECT_FALSE( updResult.second );
                     break;
                 case 1:
-                    EXPECT_TRUE( s.insert( i.key() ));
-                    EXPECT_FALSE( s.insert( i.key() ));
+                    EXPECT_TRUE( s.insert( i.key()));
+                    EXPECT_FALSE( s.insert( i.key()));
                     updResult = s.update( i.key(), []( value_type& cur, value_type* old )
                         {
                             EXPECT_FALSE( old == nullptr );
-                            EXPECT_EQ( cur.key(), old->key() );
+                            EXPECT_EQ( cur.key(), old->key());
                         }, false );
                     EXPECT_TRUE( updResult.first );
                     EXPECT_FALSE( updResult.second );
@@ -140,7 +140,7 @@ namespace cds_test {
                     updResult = s.update( i, []( value_type& v, value_type* old )
                         {
                             EXPECT_FALSE( old == nullptr );
-                            EXPECT_EQ( v.key(), old->key() );
+                            EXPECT_EQ( v.key(), old->key());
                             v.nUpdateNewCount = old->nUpdateNewCount + 1;
                         }, false );
                     EXPECT_TRUE( updResult.first );
@@ -156,7 +156,7 @@ namespace cds_test {
                     updResult = s.update( i.key(), [&i]( value_type& v, value_type* old )
                         {
                             EXPECT_TRUE( old == nullptr );
-                            EXPECT_EQ( i.key(), v.key() );
+                            EXPECT_EQ( i.key(), v.key());
                             ++v.nUpdateNewCount;
                         });
                     EXPECT_TRUE( updResult.first );
@@ -165,7 +165,7 @@ namespace cds_test {
                     updResult = s.update( i.key(), []( value_type& v, value_type* old )
                         {
                             EXPECT_FALSE( old == nullptr );
-                            EXPECT_EQ( v.key(), old->key() );
+                            EXPECT_EQ( v.key(), old->key());
                             v.nUpdateNewCount = old->nUpdateNewCount + 1;
                         }, false );
                     EXPECT_TRUE( updResult.first );
@@ -173,7 +173,7 @@ namespace cds_test {
 
                     EXPECT_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;
@@ -181,7 +181,7 @@ namespace cds_test {
                     EXPECT_TRUE( s.emplace( i.key()));
                     EXPECT_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;
@@ -191,25 +191,25 @@ namespace cds_test {
                     EXPECT_TRUE( str.empty());
                     EXPECT_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;
                 case 8:
                     {
                         updResult = s.upsert( i.key(), false );
                         EXPECT_FALSE( updResult.first );
                         EXPECT_FALSE( updResult.second );
-                        EXPECT_TRUE( s.find( i.key() ) == s.end() );
+                        EXPECT_TRUE( s.find( i.key()) == s.end());
 
-                        updResult = s.upsert( i.key() );
+                        updResult = s.upsert( i.key());
                         EXPECT_TRUE( updResult.first );
                         EXPECT_TRUE( updResult.second );
 
-                        auto it = s.find( i.key() );
-                        ASSERT_FALSE( it == s.end() );
-                        EXPECT_EQ( it->key(), i.key() );
+                        auto it = s.find( i.key());
+                        ASSERT_FALSE( it == s.end());
+                        EXPECT_EQ( it->key(), i.key());
 
                         updResult = s.upsert( i.key(), false );
                         EXPECT_TRUE( updResult.first );
@@ -217,7 +217,7 @@ namespace cds_test {
 
                         EXPECT_TRUE( s.find( i, []( value_type const& v, value_type const& arg )
                         {
-                            EXPECT_EQ( v.key(), arg.key() );
+                            EXPECT_EQ( v.key(), arg.key());
                         } ));
                     }
                     break;
@@ -226,15 +226,15 @@ namespace cds_test {
                         updResult = s.upsert( i, false );
                         EXPECT_FALSE( updResult.first );
                         EXPECT_FALSE( updResult.second );
-                        EXPECT_TRUE( s.find( i ) == s.end() );
+                        EXPECT_TRUE( s.find( i ) == s.end());
 
                         updResult = s.upsert( i );
                         EXPECT_TRUE( updResult.first );
                         EXPECT_TRUE( updResult.second );
 
                         auto it = s.find( i );
-                        ASSERT_FALSE( it == s.end() );
-                        EXPECT_EQ( it->key(), i.key() );
+                        ASSERT_FALSE( it == s.end());
+                        EXPECT_EQ( it->key(), i.key());
 
                         updResult = s.upsert( i, false );
                         EXPECT_TRUE( updResult.first );
@@ -242,7 +242,7 @@ namespace cds_test {
 
                         EXPECT_TRUE( s.find( i, []( value_type const& v, value_type const& arg )
                         {
-                            EXPECT_EQ( v.key(), arg.key() );
+                            EXPECT_EQ( v.key(), arg.key());
                         } ));
                     }
                     break;
@@ -252,33 +252,33 @@ namespace cds_test {
                     ASSERT_TRUE( false );
                 }
 
-                EXPECT_TRUE( s.contains( i.nKey ) );
-                EXPECT_TRUE( s.contains( i ) );
-                EXPECT_TRUE( s.contains( other_item( i.key() ), other_less() ) );
-                EXPECT_TRUE( s.find( i.nKey, []( value_type&, int ) {} ) );
-                EXPECT_TRUE( s.find( i, []( value_type&, value_type const& ) {} ) );
-                EXPECT_TRUE( s.find_with( other_item( i.key() ), other_less(), []( value_type&, other_item const& ) {} ) );
+                EXPECT_TRUE( s.contains( i.nKey ));
+                EXPECT_TRUE( s.contains( i ));
+                EXPECT_TRUE( s.contains( other_item( i.key()), other_less()) );
+                EXPECT_TRUE( s.find( i.nKey, []( value_type&, int ) {} ));
+                EXPECT_TRUE( s.find( i, []( value_type&, value_type const& ) {} ));
+                EXPECT_TRUE( s.find_with( other_item( i.key()), other_less(), []( value_type&, other_item const& ) {} ));
 
                 auto it = s.find( i );
-                ASSERT_FALSE( it == s.end() );
-                EXPECT_EQ( it->key(), i.key() );
+                ASSERT_FALSE( it == s.end());
+                EXPECT_EQ( it->key(), i.key());
 
-                it = s.find_with( other_item( i.key() ), other_less() );
-                ASSERT_FALSE( it == s.end() );
-                EXPECT_EQ( it->key(), i.key() );
+                it = s.find_with( other_item( i.key()), other_less());
+                ASSERT_FALSE( it == s.end());
+                EXPECT_EQ( it->key(), i.key());
            }
 
-           EXPECT_FALSE( s.empty() );
+           EXPECT_FALSE( s.empty());
            EXPECT_CONTAINER_SIZE( s, nSetSize );
 
             // erase
-            shuffle( indices.begin(), indices.end() );
+            shuffle( indices.begin(), indices.end());
             for ( auto idx : indices ) {
                 auto& i = data[idx];
 
-                EXPECT_TRUE( s.contains( i.nKey ) );
-                EXPECT_TRUE( s.contains( i ) );
-                EXPECT_TRUE( s.contains( other_item( i.key() ), other_less() ) );
+                EXPECT_TRUE( s.contains( i.nKey ));
+                EXPECT_TRUE( s.contains( i ));
+                EXPECT_TRUE( s.contains( other_item( i.key()), other_less()) );
                 EXPECT_TRUE( s.find( i.nKey, []( value_type& v, int )
                     {
                         v.nFindCount = 1;
@@ -287,17 +287,17 @@ namespace cds_test {
                     {
                         EXPECT_EQ( ++v.nFindCount, 2u );
                     }));
-                EXPECT_TRUE( s.find_with( other_item( i.key() ), other_less(), []( value_type& v, other_item const& )
+                EXPECT_TRUE( s.find_with( other_item( i.key()), other_less(), []( value_type& v, other_item const& )
                     {
                         EXPECT_EQ( ++v.nFindCount, 3u );
                     }));
 
                 auto it = s.find( i );
-                ASSERT_FALSE( it == s.end() );
-                EXPECT_EQ( it->key(), i.key() );
-                it = s.find_with( other_item( i.key() ), other_less() );
-                ASSERT_FALSE( it == s.end() );
-                EXPECT_EQ( it->key(), i.key() );
+                ASSERT_FALSE( it == s.end());
+                EXPECT_EQ( it->key(), i.key());
+                it = s.find_with( other_item( i.key()), other_less());
+                ASSERT_FALSE( it == s.end());
+                EXPECT_EQ( it->key(), i.key());
 
 
                 int nKey = i.key() - 1;
@@ -312,7 +312,7 @@ namespace cds_test {
                     break;
                 case 2:
                     EXPECT_TRUE( s.erase_with( other_item( i.key()), other_less()));
-                    EXPECT_FALSE( s.erase_with( other_item( i.key() ), other_less() ) );
+                    EXPECT_FALSE( s.erase_with( other_item( i.key()), other_less()) );
                     break;
                 case 3:
                     EXPECT_TRUE( s.erase( i.key(), [&nKey]( value_type const& v )
@@ -358,35 +358,35 @@ namespace cds_test {
                     break;
                 }
 
-                EXPECT_FALSE( s.contains( i.nKey ) );
-                EXPECT_FALSE( s.contains( i ) );
-                EXPECT_FALSE( s.contains( other_item( i.key() ), other_less()));
+                EXPECT_FALSE( s.contains( i.nKey ));
+                EXPECT_FALSE( s.contains( i ));
+                EXPECT_FALSE( s.contains( other_item( i.key()), other_less()));
                 EXPECT_FALSE( s.find( i.nKey, []( value_type&, int ) {} ));
                 EXPECT_FALSE( s.find( i, []( value_type&, value_type const& ) {} ));
                 EXPECT_FALSE( s.find_with( other_item( i.key()), other_less(), []( value_type&, other_item const& ) {} ));
 
-                EXPECT_TRUE( s.find( i.nKey ) == s.end() );
-                EXPECT_TRUE( s.find( i ) == s.end() );
-                EXPECT_TRUE( s.find_with( other_item( i.key() ), other_less() ) == s.end() );
+                EXPECT_TRUE( s.find( i.nKey ) == s.end());
+                EXPECT_TRUE( s.find( i ) == s.end());
+                EXPECT_TRUE( s.find_with( other_item( i.key()), other_less()) == s.end());
             }
-            EXPECT_TRUE( s.empty() );
+            EXPECT_TRUE( s.empty());
             EXPECT_CONTAINER_SIZE( s, 0u );
 
             // clear
             for ( auto& i : data ) {
-                EXPECT_TRUE( s.insert( i ) );
+                EXPECT_TRUE( s.insert( i ));
             }
 
-            EXPECT_FALSE( s.empty() );
+            EXPECT_FALSE( s.empty());
             EXPECT_CONTAINER_SIZE( s, nSetSize );
 
             s.clear();
 
-            EXPECT_TRUE( s.empty() );
+            EXPECT_TRUE( s.empty());
             EXPECT_CONTAINER_SIZE( s, 0u );
 
-            EXPECT_TRUE( s.begin() == s.end() );
-            EXPECT_TRUE( s.cbegin() == s.cend() );
+            EXPECT_TRUE( s.begin() == s.end());
+            EXPECT_TRUE( s.cbegin() == s.cend());
         }
     };