X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2Funit%2Flist%2Ftest_iterable_list.h;h=e9e3e9c07e09f07970c01450bbe42ab1ae608014;hb=2402fb1beb25ec532cea91c8dfbb9425eb5bdf48;hp=40dbfe993604ef4845713238759f93f69a129797;hpb=f3d187182434846ab9608307037258421101feb9;p=libcds.git diff --git a/test/unit/list/test_iterable_list.h b/test/unit/list/test_iterable_list.h index 40dbfe99..e9e3e9c0 100644 --- a/test/unit/list/test_iterable_list.h +++ b/test/unit/list/test_iterable_list.h @@ -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: @@ -92,7 +92,7 @@ namespace cds_test { struct cmp { int operator ()( const T& v1, const T& v2 ) const { - if ( v1.key() < v2.key() ) + if ( v1.key() < v2.key()) return -1; return v1.key() > v2.key() ? 1 : 0; } @@ -108,7 +108,7 @@ namespace cds_test { template int operator ()( const Q& v1, const T& v2 ) const { - if ( v1 < v2.key() ) + if ( v1 < v2.key()) return -1; return v1 > v2.key() ? 1 : 0; } @@ -152,7 +152,7 @@ namespace cds_test { } shuffle( arr, arr + nSize ); - ASSERT_TRUE( l.empty() ); + ASSERT_TRUE( l.empty()); ASSERT_CONTAINER_SIZE( l, 0 ); // insert/find @@ -233,7 +233,7 @@ namespace cds_test { EXPECT_TRUE( l.contains( i )); EXPECT_TRUE( l.contains( i.nKey )); EXPECT_TRUE( l.contains( other_item( i.nKey ), other_less())); - EXPECT_TRUE( l.find( i, []( value_type& n, value_type const& arg ) { + EXPECT_TRUE( l.find( i, []( value_type& n, value_type const& arg ) { EXPECT_EQ( arg.nKey, n.nKey ); n.nVal = n.nKey; } )); @@ -246,10 +246,10 @@ namespace cds_test { EXPECT_EQ( key.nKey, n.nKey ); EXPECT_EQ( n.nKey * 5, n.nVal ); } )); - ASSERT_FALSE( l.find( i ) == l.end() ); + ASSERT_FALSE( l.find( i ) == l.end()); EXPECT_EQ( l.find( i.nKey )->nKey, i.nKey ); - ASSERT_FALSE( l.find_with( other_item( i.nKey ), other_less() ) == l.end() ); - EXPECT_EQ( l.find_with( other_item( i.nKey ), other_less() )->nKey, i.nKey ); + ASSERT_FALSE( l.find_with( other_item( i.nKey ), other_less()) == l.end()); + EXPECT_EQ( l.find_with( other_item( i.nKey ), other_less())->nKey, i.nKey ); auto pair = l.upsert( i.nKey, false ); EXPECT_TRUE( pair.first ); @@ -264,18 +264,18 @@ namespace cds_test { EXPECT_TRUE( pair.first ); EXPECT_FALSE( pair.second ); - EXPECT_FALSE( l.empty() ); + EXPECT_FALSE( l.empty()); } - ASSERT_FALSE( l.empty() ); + ASSERT_FALSE( l.empty()); EXPECT_CONTAINER_SIZE( l, nSize ); // erase for ( auto const&i : arr ) { - ASSERT_FALSE( l.find( i.nKey ) == l.end() ); + ASSERT_FALSE( l.find( i.nKey ) == l.end()); EXPECT_EQ( l.find( i.nKey )->nKey, i.nKey ); - ASSERT_FALSE( l.find_with( other_item( i.nKey ), other_less() ) == l.end() ); - EXPECT_EQ( l.find_with( other_item( i.nKey ), other_less() )->nKey, i.nKey ); + ASSERT_FALSE( l.find_with( other_item( i.nKey ), other_less()) == l.end()); + EXPECT_EQ( l.find_with( other_item( i.nKey ), other_less())->nKey, i.nKey ); switch ( i.nKey % 4 ) { case 0: @@ -303,24 +303,24 @@ namespace cds_test { EXPECT_FALSE( l.find( i, []( value_type&, value_type const&) {} )); EXPECT_FALSE( l.find( i.nKey, []( value_type&, int ) {} )); EXPECT_FALSE( l.find_with( other_item( i.nKey ), other_less(), []( value_type&, other_item const& ) {} )); - EXPECT_TRUE( l.find( i ) == l.end() ); - EXPECT_TRUE( l.find( i.nKey ) == l.end() ); - EXPECT_TRUE( l.find_with( other_item( i.nKey ), other_less() ) == l.end() ); + EXPECT_TRUE( l.find( i ) == l.end()); + EXPECT_TRUE( l.find( i.nKey ) == l.end()); + EXPECT_TRUE( l.find_with( other_item( i.nKey ), other_less()) == l.end()); } - ASSERT_TRUE( l.empty() ); + ASSERT_TRUE( l.empty()); EXPECT_CONTAINER_SIZE( l, 0 ); // clear test - for ( auto& i : arr ) + for ( auto& i : arr ) EXPECT_TRUE( l.insert( i )); - ASSERT_FALSE( l.empty() ); + ASSERT_FALSE( l.empty()); EXPECT_CONTAINER_SIZE( l, nSize ); l.clear(); - ASSERT_TRUE( l.empty() ); + ASSERT_TRUE( l.empty()); EXPECT_CONTAINER_SIZE( l, 0 ); // empty list iterator test @@ -350,7 +350,7 @@ namespace cds_test { } shuffle( arr, arr + nSize ); - ASSERT_TRUE( l.empty() ); + ASSERT_TRUE( l.empty()); ASSERT_CONTAINER_SIZE( l, 0 ); for ( auto& i : arr ) @@ -395,7 +395,7 @@ namespace cds_test { EXPECT_EQ( static_cast(key), nSize ); l.clear(); - ASSERT_TRUE( l.empty() ); + ASSERT_TRUE( l.empty()); EXPECT_CONTAINER_SIZE( l, 0 ); } };