From a546ba81a7773b539c096266fbd1baf2e7afa927 Mon Sep 17 00:00:00 2001 From: khizmax Date: Wed, 9 Dec 2015 21:43:46 +0300 Subject: [PATCH] Test tuning --- tests/unit/map2/map_insdel_func.h | 8 ++++---- tests/unit/map2/map_insdelfind.h | 2 +- tests/unit/map2/map_type_bronson_avltree.h | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/unit/map2/map_insdel_func.h b/tests/unit/map2/map_insdel_func.h index 76f59246..83d64b24 100644 --- a/tests/unit/map2/map_insdel_func.h +++ b/tests/unit/map2/map_insdel_func.h @@ -454,14 +454,14 @@ namespace map2 { size_t nUpdateModified = 0; size_t nEnsFuncCreated = 0; size_t nEnsFuncModified = 0; - size_t nTestFunctorRef = 0; + size_t nInsFuncCalled = 0; for ( CppUnitMini::ThreadPool::iterator it = pool.begin(); it != pool.end(); ++it ) { InserterThread * pThread = dynamic_cast( *it ); if ( pThread ) { nInsertSuccess += pThread->m_nInsertSuccess; nInsertFailed += pThread->m_nInsertFailed; - nTestFunctorRef += pThread->m_nTestFunctorRef; + nInsFuncCalled += pThread->m_nTestFunctorRef; } else { DeleterThread * p = dynamic_cast( *it ); @@ -499,8 +499,8 @@ namespace map2 { CPPUNIT_CHECK_EX( nUpdateCreated == nEnsFuncCreated, "Update created=" << nUpdateCreated << " functor=" << nEnsFuncCreated ); CPPUNIT_CHECK_EX( nUpdateModified == nEnsFuncModified, "Update modified=" << nUpdateModified << " functor=" << nEnsFuncModified ); - // nTestFunctorRef is call count of insert functor - CPPUNIT_CHECK_EX( nTestFunctorRef == nInsertSuccess, "nInsertSuccess=" << nInsertSuccess << " functor nTestFunctorRef=" << nTestFunctorRef ); + // nInsFuncCalled is call count of insert functor + CPPUNIT_CHECK_EX( nInsFuncCalled == nInsertSuccess, "nInsertSuccess=" << nInsertSuccess << " functor nInsFuncCalled=" << nInsFuncCalled ); check_before_cleanup( testMap ); diff --git a/tests/unit/map2/map_insdelfind.h b/tests/unit/map2/map_insdelfind.h index 636b9ab6..db0757f9 100644 --- a/tests/unit/map2/map_insdelfind.h +++ b/tests/unit/map2/map_insdelfind.h @@ -213,7 +213,7 @@ namespace map2 { timer.reset(); testMap.clear(); CPPUNIT_MSG( " Duration=" << timer.duration() ); - CPPUNIT_ASSERT_EX( testMap.empty(), ((long long) testMap.size()) ); + CPPUNIT_CHECK_EX( testMap.empty(), "size=" << ((long long) testMap.size()) ); additional_check( testMap ); print_stat( testMap ); diff --git a/tests/unit/map2/map_type_bronson_avltree.h b/tests/unit/map2/map_type_bronson_avltree.h index 77ee8734..996047ed 100644 --- a/tests/unit/map2/map_type_bronson_avltree.h +++ b/tests/unit/map2/map_type_bronson_avltree.h @@ -99,7 +99,7 @@ namespace map2 { struct BronsonAVLTreeMap_less_pool_lazy: public BronsonAVLTreeMap_less { typedef cds::sync::pool_monitor sync_monitor; - static CDS_CONSTEXPR bool const relaxed_insert = true; + static CDS_CONSTEXPR bool const relaxed_insert = false; // relaxed insert can lead to test assert triggering }; typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_gpi_less_pool_lazy; typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_lazy > BronsonAVLTreeMap_rcu_gpb_less_pool_lazy; @@ -112,7 +112,7 @@ namespace map2 { { typedef cc::bronson_avltree::stat<> stat; typedef cds::sync::pool_monitor sync_monitor; - static CDS_CONSTEXPR bool const relaxed_insert = true; + static CDS_CONSTEXPR bool const relaxed_insert = false; // relaxed insert can lead to test assert triggering }; typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_gpi_less_pool_lazy_stat; typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_lazy_stat > BronsonAVLTreeMap_rcu_gpb_less_pool_lazy_stat; @@ -124,7 +124,7 @@ namespace map2 { struct BronsonAVLTreeMap_less_pool_bounded: public BronsonAVLTreeMap_less { typedef cds::sync::pool_monitor sync_monitor; - static CDS_CONSTEXPR bool const relaxed_insert = true; + static CDS_CONSTEXPR bool const relaxed_insert = false; // relaxed insert can lead to test assert triggering }; typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_gpi_less_pool_bounded; typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_bounded > BronsonAVLTreeMap_rcu_gpb_less_pool_bounded; @@ -137,7 +137,7 @@ namespace map2 { { typedef cc::bronson_avltree::stat<> stat; typedef cds::sync::pool_monitor sync_monitor; - static CDS_CONSTEXPR bool const relaxed_insert = true; + static CDS_CONSTEXPR bool const relaxed_insert = false; // relaxed insert can lead to test assert triggering }; typedef BronsonAVLTreeMap< rcu_gpi, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_gpi_less_pool_bounded_stat; typedef BronsonAVLTreeMap< rcu_gpb, Key, Value, BronsonAVLTreeMap_less_pool_bounded_stat > BronsonAVLTreeMap_rcu_gpb_less_pool_bounded_stat; -- 2.34.1