namespace map2 {
- template <typename Map>
- static inline void check_before_clear( Map& /*s*/ )
- {}
-
- template <typename GC, typename Key, typename T, typename Traits>
- static inline void check_before_clear( cds::container::EllenBinTreeMap<GC, Key, T, Traits>& s )
- {
- CPPUNIT_CHECK_CURRENT( s.check_consistency() );
- }
-
class Map_DelOdd: public CppUnitMini::TestCase
{
std::vector<size_t> m_arrData;
CPPUNIT_CHECK_EX( nErrorCount == 0, "Totals: " << nErrorCount << " keys is not found");
}
- check_before_clear( testMap );
+ check_before_cleanup( testMap );
CPPUNIT_MSG( " Clear map (single-threaded)..." );
timer.reset();
CPPUNIT_ASSERT( pThread->m_KeyNotExists.nSuccess == (m_Arr.size() - m_nRealMapSize) * c_nPassCount );
}
+ check_before_cleanup( testMap );
+
testMap.clear();
additional_check( testMap );
print_stat( testMap );
CPPUNIT_ASSERT( pThread->m_KeyNotExists.nFailed == 0 );
}
+ check_before_cleanup( testMap );
+
testMap.clear();
additional_check( testMap );
print_stat( testMap );
// nTestFunctorRef is call count of insert functor
CPPUNIT_CHECK_EX( nTestFunctorRef == nInsertSuccess, "nInsertSuccess=" << nInsertSuccess << " functor nTestFunctorRef=" << nTestFunctorRef );
+ check_before_cleanup( testMap );
+
CPPUNIT_MSG( " Clear map (single-threaded)..." );
timer.reset();
for ( size_t nItem = 0; nItem < c_nMapSize; ++nItem ) {
<< " Map size=" << testMap.size()
);
+ check_before_cleanup( testMap );
CPPUNIT_MSG( " Clear map (single-threaded)..." );
timer.reset();
}
CPPUNIT_MSG( " Duration=" << timer.duration() );
+ check_before_cleanup( testMap );
+
testMap.clear();
additional_check( testMap );
print_stat( testMap );
}
CPPUNIT_MSG( " Duration=" << timer.duration() );
+ check_before_cleanup( testMap );
+
testMap.clear();
additional_check( testMap );
print_stat( testMap );
<< " Map size=" << testMap.size()
);
+ check_before_cleanup( testMap );
CPPUNIT_MSG( " Clear map (single-threaded)..." );
timer.reset();
);
+ check_before_cleanup( testMap );
+
CPPUNIT_MSG( " Clear map (single-threaded)..." );
timer.reset();
testMap.clear();
CPPUNIT_ASSERT( nInsertFailed == 0 );
CPPUNIT_ASSERT( nFindFailed == 0 );
+ check_before_cleanup( testMap );
+
testMap.clear();
additional_check( testMap );
print_stat( testMap );
static inline void print_stat( Map const& /*m*/ )
{}
+ template <typename Map>
+ static inline void check_before_cleanup( Map& /*m*/ )
+ {}
+
template <typename Map>
static inline void additional_cleanup( Map& /*m*/ )
{}
ellen_bintree_check::check_stat( s.statistics() );
}
+ template <typename GC, typename Key, typename T, typename Traits>
+ static inline void check_before_cleanup( cc::EllenBinTreeMap<GC, Key, T, Traits>& m )
+ {
+ CPPUNIT_MSG( " Check internal consistency (single-threaded)..." );
+ CPPUNIT_CHECK_CURRENT( m.check_consistency() );
+ }
+
+
// BronsonAVLTreeMap
template <typename GC, typename Key, typename T, typename Traits>
- static inline void print_stat( cc::BronsonAVLTreeMap<GC, Key, T, Traits> const& s )
+ static inline void print_stat( cc::BronsonAVLTreeMap<GC, Key, T, Traits> const& m )
{
- CPPUNIT_MSG( s.statistics() );
+ CPPUNIT_MSG( m.statistics() );
}
template <typename GC, typename Key, typename T, typename Traits>
- static inline void additional_check( cc::BronsonAVLTreeMap<GC, Key, T, Traits>& m )
+ static inline void check_before_cleanup( cc::BronsonAVLTreeMap<GC, Key, T, Traits>& m )
{
+ CPPUNIT_MSG( " Check internal consistency (single-threaded)..." );
m.check_consistency([]( size_t nLevel, size_t hLeft, size_t hRight )
{
CPPUNIT_MSG( "Tree violation on level=" << nLevel << ": hLeft=" << hLeft << ", hRight=" << hRight )