[BronsonAVLTree] Fixed bug of counting of inserted items
authorkhizmax <libcds.dev@gmail.com>
Thu, 5 Nov 2015 20:14:44 +0000 (23:14 +0300)
committerkhizmax <libcds.dev@gmail.com>
Thu, 5 Nov 2015 20:14:44 +0000 (23:14 +0300)
Added more post-checks in MT-test

cds/container/details/bronson_avltree_base.h
cds/container/impl/bronson_avltree_map_rcu.h
tests/unit/map2/map_insdel_int.h
tests/unit/map2/map_insdel_string.h

index d24bb3e2899b98c26c3eba01b51f923aa40a726f..751a96feb1acd4be6bd76dcbe2b997d274cf5794 100644 (file)
@@ -340,7 +340,7 @@ namespace cds { namespace container {
             that can lead to lock contention.
 
             When this option is enabled, the new node is created before locking the parent node.
-            After that, the parent is locked and checked whether the new node may be attached to the parent.
+            After that, the parent is locked and checked whether the new node can be attached to the parent.
             In this case, false node creating can be performed, but locked section can be significantly small.
         */
         template <bool Enable>
index 4b362d3fd8c42ee38781c17ef0aef568c28ca052..f98febea9089819e1f1c1ed94d17111d8c1b5200 100644 (file)
@@ -1462,6 +1462,7 @@ namespace cds { namespace container {
             }
 
             if ( bInserted ) {
+                ++m_ItemCounter;
                 m_stat.onInsertSuccess();
                 return update_flags::result_inserted;
             }
index 20e3720f56fa840302c171c5ae8843ad252ef0b9..21a72974bf80ccb133a5ec663daa0d2d3eeacdfd 100644 (file)
@@ -210,7 +210,8 @@ namespace map2 {
                 testMap.erase( nItem );
             }
             CPPUNIT_MSG( "   Duration=" << timer.duration() );
-            CPPUNIT_ASSERT_EX( testMap.empty(), ((long long) testMap.size()) );
+            CPPUNIT_CHECK( testMap.empty());
+            CPPUNIT_CHECK_EX( testMap.size() == 0, "size() == " << testMap.size() );
 
             additional_check( testMap );
             print_stat( testMap );
index 294b92987861e88f0dbbdb49573c6eb2021bdbe2..5e860594e3d5bf5de6cca90a31c4cdf2663b8d86 100644 (file)
@@ -214,6 +214,7 @@ namespace map2 {
                 testMap.erase( (*m_parrString)[i] );
             CPPUNIT_MSG( "   Duration=" << timer.duration() );
             CPPUNIT_CHECK( testMap.empty() );
+            CPPUNIT_CHECK_EX( testMap.size() == 0, "size() == " << testMap.size() );
 
             additional_check( testMap );
             print_stat( testMap );