/*
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/
EXPECT_TRUE( m.empty());
EXPECT_CONTAINER_SIZE( m, 0 );
- typedef typename Map::value_type map_pair;
size_t const kkSize = base_class::kSize;
std::vector<key_type> arrKeys;
}
for ( auto const& i : arrKeys )
- EXPECT_TRUE( m.insert( i ) );
- EXPECT_FALSE( m.empty() );
+ EXPECT_TRUE( m.insert( i ));
+ EXPECT_FALSE( m.empty());
EXPECT_CONTAINER_SIZE( m, kkSize );
// iterators
ASSERT_TRUE( !gp );
gp = m.get( i );
ASSERT_TRUE( !gp );
- gp = m.get_with( other_item( i.nKey ), other_less() );
+ gp = m.get_with( other_item( i.nKey ), other_less());
ASSERT_TRUE( !gp );
}
- EXPECT_TRUE( m.empty() );
+ EXPECT_TRUE( m.empty());
+ EXPECT_CONTAINER_SIZE( m, 0u );
+
+ // erase_at()
+ for ( auto const& i : arrKeys )
+ EXPECT_TRUE( m.insert( i ));
+ EXPECT_FALSE( m.empty());
+ EXPECT_CONTAINER_SIZE( m, kkSize );
+
+ for ( auto it = m.begin(); it != m.end(); ++it ) {
+ EXPECT_TRUE( m.erase_at( it ));
+ EXPECT_FALSE( m.erase_at( it ));
+ }
+ EXPECT_TRUE( m.empty());
EXPECT_CONTAINER_SIZE( m, 0u );
}
};