Merge branch 'master' into dev
[libcds.git] / test / unit / set / test_michael_iterable_hp.h
index 4810ed77a1f5ae620e7f243c23c17b5c09210f18..20be60ba5b9ff9787e034e458c27c7b49513c946 100644 (file)
@@ -1,7 +1,7 @@
 /*
     This file is a part of libcds - Concurrent Data Structures library
 
-    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
 
     Source code repo: http://github.com/khizmax/libcds/
     Download: http://sourceforge.net/projects/libcds/files/
@@ -145,6 +145,21 @@ namespace cds_test {
 
             EXPECT_TRUE( s.empty());
             EXPECT_CONTAINER_SIZE( s, 0 );
+
+            // erase_at()
+            for ( auto& i : data ) {
+                EXPECT_TRUE( s.insert( i ));
+            }
+            EXPECT_FALSE( s.empty());
+            EXPECT_CONTAINER_SIZE( s, nSetSize );
+
+            for ( auto it = s.begin(); it != s.end(); ++it ) {
+                EXPECT_TRUE( s.erase_at( it ));
+                EXPECT_FALSE( s.erase_at( it ));
+            }
+
+            EXPECT_TRUE( s.empty());
+            EXPECT_CONTAINER_SIZE( s, 0 );
         }
 
     };