X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2Funit%2Fstriped-map%2Ftest_striped_map.h;h=5fe5e2c64e9b83763f827b00429ac5cb69fadae7;hb=056d289619d45ccf1055c18d63cb3bad072a71a0;hp=b5ad0c056d6923097c9d0d0845657f606ccd055e;hpb=7448008aa977fe42a83738fbbc63ce11d8ab86f9;p=libcds.git diff --git a/test/unit/striped-map/test_striped_map.h b/test/unit/striped-map/test_striped_map.h index b5ad0c05..5fe5e2c6 100644 --- a/test/unit/striped-map/test_striped_map.h +++ b/test/unit/striped-map/test_striped_map.h @@ -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_STRIPED_MAP_TEST_STRIPED_MAP_H @@ -43,7 +43,7 @@ namespace { { bool operator()( Map& m, int key ) const { - return m.contains( cds_test::striped_map_fixture::other_item( key ), cds_test::striped_map_fixture::other_less() ); + return m.contains( cds_test::striped_map_fixture::other_item( key ), cds_test::striped_map_fixture::other_less()); } }; @@ -81,7 +81,7 @@ namespace { { bool operator()( Map& m, int key ) const { - return m.erase_with( cds_test::striped_map_fixture::other_item( key ), cds_test::striped_map_fixture::other_less() ); + return m.erase_with( cds_test::striped_map_fixture::other_item( key ), cds_test::striped_map_fixture::other_less()); } template @@ -157,7 +157,7 @@ namespace { ASSERT_FALSE( m.contains( i.nKey )); ASSERT_FALSE( m.contains( i )); - ASSERT_FALSE(( call_contains_with()( m, i.nKey ) )); + ASSERT_FALSE(( call_contains_with()( m, i.nKey ))); ASSERT_FALSE( m.find( i, []( map_pair const& ) { ASSERT_TRUE( false ); } )); @@ -212,7 +212,7 @@ namespace { v.second.nVal = v.first.nKey; v.second.strVal = std::to_string( v.first.nKey ); } )); - ASSERT_FALSE( m.insert_with( i, []( map_pair& v ) { + ASSERT_FALSE( m.insert_with( i, []( map_pair& ) { EXPECT_TRUE( false ); } )); break; @@ -221,7 +221,7 @@ namespace { 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 ) { + ASSERT_FALSE( m.insert_with( i.nKey, []( map_pair& ) { EXPECT_TRUE( false ); } )); break; @@ -230,7 +230,7 @@ namespace { 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 ) { + ASSERT_FALSE( m.insert_with( val.strVal, []( map_pair& ) { EXPECT_TRUE( false ); } )); break; @@ -334,7 +334,7 @@ namespace { ASSERT_TRUE( m.contains( i.nKey )); ASSERT_TRUE( m.contains( i )); - ASSERT_TRUE(( call_contains_with()( m, i.nKey ) )); + ASSERT_TRUE(( call_contains_with()( m, i.nKey ))); ASSERT_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 ); @@ -348,17 +348,17 @@ namespace { EXPECT_EQ( std::to_string( v.first.nKey ), v.second.strVal ); } ))); } - ASSERT_FALSE( m.empty() ); + ASSERT_FALSE( m.empty()); ASSERT_CONTAINER_SIZE( m, kkSize ); - 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( val.strVal )); ASSERT_TRUE( m.contains( i )); ASSERT_TRUE(( call_contains_with()( m, i.nKey ))); ASSERT_TRUE( m.find( i, []( map_pair const& v ) { @@ -444,19 +444,19 @@ namespace { EXPECT_TRUE( false ); } ))); } - ASSERT_TRUE( m.empty() ); + ASSERT_TRUE( m.empty()); ASSERT_CONTAINER_SIZE( m, 0 ); // clear for ( auto const& i : arrKeys ) ASSERT_TRUE( m.insert( i )); - ASSERT_FALSE( m.empty() ); + ASSERT_FALSE( m.empty()); ASSERT_CONTAINER_SIZE( m, kkSize ); m.clear(); - ASSERT_TRUE( m.empty() ); + ASSERT_TRUE( m.empty()); ASSERT_CONTAINER_SIZE( m, 0 ); } }; @@ -548,7 +548,7 @@ namespace { cds::opt::resizing_policy< cc::striped_set::load_factor_resizing<0>> > map_type; - map_type m( 30, cc::striped_set::load_factor_resizing<0>( 8 ) ); + map_type m( 30, cc::striped_set::load_factor_resizing<0>( 8 )); this->test( m ); } @@ -604,7 +604,7 @@ namespace { cds::opt::copy_policy< cc::striped_set::move_item > > map_type; - map_type m( 30, cc::striped_set::load_factor_resizing<0>( 8 ) ); + map_type m( 30, cc::striped_set::load_factor_resizing<0>( 8 )); this->test( m ); } @@ -721,7 +721,7 @@ namespace { cds::opt::resizing_policy< cc::striped_set::load_factor_resizing<0>> > map_type; - map_type m( 30, cc::striped_set::load_factor_resizing<0>( 8 ) ); + map_type m( 30, cc::striped_set::load_factor_resizing<0>( 8 )); this->test( m ); } @@ -781,7 +781,7 @@ namespace { cds::opt::copy_policy< cc::striped_set::move_item > > map_type; - map_type m( 30, cc::striped_set::load_factor_resizing<0>( 8 ) ); + map_type m( 30, cc::striped_set::load_factor_resizing<0>( 8 )); this->test( m ); }