Added CDS_VERIFY_EQ debug macro
authorkhizmax <khizmax@gmail.com>
Fri, 22 Sep 2017 20:07:34 +0000 (23:07 +0300)
committerkhizmax <khizmax@gmail.com>
Fri, 22 Sep 2017 20:07:34 +0000 (23:07 +0300)
cds/details/defs.h
cds/intrusive/cuckoo_set.h

index 21a9184..4d382ae 100644 (file)
@@ -348,10 +348,12 @@ namespace cds {}
 #   define CDS_VERIFY( _expr )       assert( _expr )
 #   define CDS_VERIFY_FALSE( _expr ) assert( !( _expr ))
 #   define CDS_DEBUG_ONLY( _expr )        _expr
+#   define CDS_VERIFY_EQ( expr, val )   assert( expr == val )
 #else
 #   define CDS_VERIFY( _expr )    _expr
 #   define CDS_VERIFY_FALSE( _expr ) _expr
 #   define CDS_DEBUG_ONLY( _expr )
+#   define CDS_VERIFY_EQ( expr, val )   expr
 #endif
 
 #ifdef CDS_STRICT
index 9508c24..9e7d794 100644 (file)
@@ -2184,7 +2184,7 @@ namespace cds { namespace intrusive {
 
                             value_type& val = *node_traits::to_value_ptr( *it );
                             copy_hash( arrHash, val );
-                            contains( arrPos, arrHash, val, key_predicate()) ; // must return c_nUndefTable
+                            CDS_VERIFY_EQ( contains( arrPos, arrHash, val, key_predicate()), c_nUndefTable );
 
                             for ( unsigned int i = 0; i < c_nArity; ++i ) {
                                 bucket_entry& refBucket = bucket( i, arrHash[i] );