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_LIST_TEST_LIST_H
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;
}
template <typename Q>
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;
}
}
shuffle( arr, arr + nSize );
- ASSERT_TRUE( l.empty() );
+ ASSERT_TRUE( l.empty());
ASSERT_CONTAINER_SIZE( l, 0 );
// insert/find
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;
} ));
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
EXPECT_FALSE( l.find_with( other_item( i.nKey ), other_less(), []( value_type&, other_item const& ) {} ));
}
- 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
}
shuffle( arr, arr + nSize );
- ASSERT_TRUE( l.empty() );
+ ASSERT_TRUE( l.empty());
ASSERT_CONTAINER_SIZE( l, 0 );
for ( auto& i : arr )
EXPECT_EQ( static_cast<size_t>(key), nSize );
l.clear();
- ASSERT_TRUE( l.empty() );
+ ASSERT_TRUE( l.empty());
EXPECT_CONTAINER_SIZE( l, 0 );
}
};