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_TREE_TEST_TREE_MAP_HP_H
ASSERT_TRUE( m.empty());
ASSERT_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 )
- ASSERT_TRUE( m.insert( i ) );
- ASSERT_FALSE( m.empty() );
+ ASSERT_TRUE( m.insert( i ));
+ ASSERT_FALSE( m.empty());
ASSERT_CONTAINER_SIZE( m, kkSize );
// get/extract
gp = m.get_with( other_item( i.nKey ), other_less());
ASSERT_TRUE( !gp );
}
- ASSERT_TRUE( m.empty() );
+ ASSERT_TRUE( m.empty());
ASSERT_CONTAINER_SIZE( m, 0 );
gp = m.extract_min();
EXPECT_TRUE( !gp );
for ( auto const& i : arrKeys )
- ASSERT_TRUE( m.insert( i ) );
- ASSERT_FALSE( m.empty() );
+ ASSERT_TRUE( m.insert( i ));
+ ASSERT_FALSE( m.empty());
ASSERT_CONTAINER_SIZE( m, kkSize );
// extract_min
int nKey = -1;
size_t nCount = 0;
- while ( !m.empty() ) {
+ while ( !m.empty()) {
gp = m.extract_min();
ASSERT_FALSE( !gp );
EXPECT_EQ( gp->first.nKey, nKey + 1 );
nKey = gp->first.nKey;
++nCount;
}
- ASSERT_TRUE( m.empty() );
+ ASSERT_TRUE( m.empty());
ASSERT_CONTAINER_SIZE( m, 0 );
EXPECT_EQ( nCount, kkSize );
// extract_max
for ( auto const& i : arrKeys )
- ASSERT_TRUE( m.insert( i ) );
- ASSERT_FALSE( m.empty() );
+ ASSERT_TRUE( m.insert( i ));
+ ASSERT_FALSE( m.empty());
ASSERT_CONTAINER_SIZE( m, kkSize );
nKey = kkSize;
nCount = 0;
- while ( !m.empty() ) {
+ while ( !m.empty()) {
gp = m.extract_max();
ASSERT_FALSE( !gp );
EXPECT_EQ( gp->first.nKey, nKey - 1 );
nKey = gp->first.nKey;
++nCount;
}
- ASSERT_TRUE( m.empty() );
+ ASSERT_TRUE( m.empty());
ASSERT_CONTAINER_SIZE( m, 0 );
EXPECT_EQ( nCount, kkSize );