Test tuning
authorkhizmax <libcds.dev@gmail.com>
Wed, 9 Dec 2015 18:43:46 +0000 (21:43 +0300)
committerkhizmax <libcds.dev@gmail.com>
Wed, 9 Dec 2015 18:43:46 +0000 (21:43 +0300)
tests/unit/map2/map_insdel_func.h
tests/unit/map2/map_insdelfind.h
tests/unit/map2/map_type_bronson_avltree.h

index 76f59246407b829d5ca0de4158a251f091fecd7d..83d64b243fb375a9efdccaa854a02e8eb6e2b77d 100644 (file)
@@ -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<InserterThread *>( *it );
                 if ( pThread ) {
                     nInsertSuccess += pThread->m_nInsertSuccess;
                     nInsertFailed += pThread->m_nInsertFailed;
-                    nTestFunctorRef += pThread->m_nTestFunctorRef;
+                    nInsFuncCalled += pThread->m_nTestFunctorRef;
                 }
                 else {
                     DeleterThread * p = dynamic_cast<DeleterThread *>( *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 );
 
index 636b9ab6f2c4b364c4f30cf2b24fce5f47f57000..db0757f9c489fec2d50ef10a034c4d4089443f73 100644 (file)
@@ -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 );
index 77ee8734a8c4b037364eba5bdf84a8fec553f4d0..996047ed88e53d3bfc655848bbfb056a6a791205 100644 (file)
@@ -99,7 +99,7 @@ namespace map2 {
         struct BronsonAVLTreeMap_less_pool_lazy: public BronsonAVLTreeMap_less
         {
             typedef cds::sync::pool_monitor<BronsonAVLTreeMap_lazy_pool> 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<BronsonAVLTreeMap_lazy_pool, cds::opt::none, true > 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<BronsonAVLTreeMap_bounded_pool> 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<BronsonAVLTreeMap_bounded_pool, cds::opt::none, true > 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;