RCU<signal_handler_threaded> suppressed for usual run
[libcds.git] / test / stress / map / map_type.h
index f5c996f58a26a3df1b086482df65f71785b442a5..a2006f2ff35095282a04c917da5983ab1871be31 100644 (file)
@@ -1,11 +1,11 @@
 /*
     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/
-    
+
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions are met:
 
@@ -25,7 +25,7 @@
     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
     CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
 #ifndef CDSUNIT_MAP_TYPE_H
@@ -43,7 +43,6 @@
 
 #include <cds_test/stress_test.h>
 #include <cds_test/check_size.h>
-#include "framework/michael_alloc.h"
 
 namespace map {
     namespace cc = cds::container;
@@ -64,7 +63,7 @@ namespace map {
     struct cmp {
         int operator ()(Key const& k1, Key const& k2) const
         {
-            if ( less<Key>( k1, k2 ) )
+            if ( less<Key>( k1, k2 ))
                 return -1;
             return less<Key>( k2, k1 ) ? 1 : 0;
         }
@@ -73,7 +72,7 @@ namespace map {
     template <typename Key>
     struct hash;
 
-#define CDSUNIT_INT_COMPARE(t)  template <> struct cmp<t> { int operator()( t k1, t k2 ){ return (int)(k1 - k2); } }
+#define CDSUNIT_INT_COMPARE(t)  template <> struct cmp<t> { int operator()( t k1, t k2 ) const { return (int)(k1 - k2); } }
     CDSUNIT_INT_COMPARE(char);
     CDSUNIT_INT_COMPARE(unsigned char);
     CDSUNIT_INT_COMPARE(int);
@@ -84,7 +83,7 @@ namespace map {
     CDSUNIT_INT_COMPARE(unsigned long long);
 #undef CDSUNIT_INT_COMPARE
 
-#define CDSUNIT_INT_LESS(t)  template <> struct less<t> { bool operator()( t k1, t k2 ){ return k1 < k2; } }
+#define CDSUNIT_INT_LESS(t)  template <> struct less<t> { bool operator()( t k1, t k2 ) const { return k1 < k2; } }
     CDSUNIT_INT_LESS( char );
     CDSUNIT_INT_LESS( unsigned char );
     CDSUNIT_INT_LESS( int );
@@ -206,12 +205,20 @@ namespace map {
                 return seed;
             }
         };
-
     };
 
+    struct empty_stat {};
+    static inline cds_test::property_stream& operator <<( cds_test::property_stream& o, empty_stat const& )
+    {
+        return o;
+    }
+
     template <typename Map>
-    static inline void print_stat( cds_test::property_stream&, Map const& /*m*/ )
-    {}
+    static inline void print_stat( cds_test::property_stream& o, Map const& m )
+    {
+        o << m.statistics();
+    }
+
 
     template <typename Map>
     static inline void check_before_cleanup( Map& /*m*/ )