From 1a757d56e19365b35dc0c0eafce3e49e161bd322 Mon Sep 17 00:00:00 2001
From: khizmax <khizmax@gmail.com>
Date: Mon, 24 Nov 2014 13:27:34 +0300
Subject: [PATCH] fix tests for guarded_ptr and exempt_ptr

---
 tests/test-hdr/map/hdr_map.h                        |  6 ++++++
 tests/test-hdr/map/hdr_skiplist_map.h               |  6 +++++-
 tests/test-hdr/map/hdr_skiplist_map_rcu.h           |  4 ++++
 tests/test-hdr/ordered_list/hdr_lazy.h              |  4 ++++
 tests/test-hdr/ordered_list/hdr_lazy_kv.h           |  5 ++++-
 tests/test-hdr/ordered_list/hdr_michael.h           |  4 ++++
 tests/test-hdr/ordered_list/hdr_michael_kv.h        |  5 +++++
 tests/test-hdr/set/hdr_intrusive_set.h              |  4 ++++
 tests/test-hdr/set/hdr_intrusive_skiplist_set.h     |  8 ++++++++
 tests/test-hdr/set/hdr_intrusive_skiplist_set_rcu.h | 12 ++++++------
 tests/test-hdr/set/hdr_set.h                        |  7 ++++++-
 tests/test-hdr/set/hdr_skiplist_set.h               | 12 ++++++++++++
 tests/test-hdr/set/hdr_skiplist_set_rcu.h           |  4 ++++
 13 files changed, 72 insertions(+), 9 deletions(-)

diff --git a/tests/test-hdr/map/hdr_map.h b/tests/test-hdr/map/hdr_map.h
index 81462dd4..1441b46c 100644
--- a/tests/test-hdr/map/hdr_map.h
+++ b/tests/test-hdr/map/hdr_map.h
@@ -214,12 +214,15 @@ namespace map {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey );
+                    gp.release();
 
                     gp = m.extract( nKey );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey );
+                    gp.release();
+
                     gp = m.get( nKey );
                     CPPUNIT_CHECK( !gp );
 
@@ -238,12 +241,15 @@ namespace map {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey );
+                    gp.release();
 
                     gp = m.extract_with( other_item( nKey ), other_less() );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey );
+                    gp.release();
+
                     gp = m.get_with( other_item( nKey ), other_less() );
                     CPPUNIT_CHECK( !gp );
 
diff --git a/tests/test-hdr/map/hdr_skiplist_map.h b/tests/test-hdr/map/hdr_skiplist_map.h
index 16145294..7d5db329 100644
--- a/tests/test-hdr/map/hdr_skiplist_map.h
+++ b/tests/test-hdr/map/hdr_skiplist_map.h
@@ -152,12 +152,14 @@ namespace map {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
+                    gp.release();
 
                     gp = m.extract( nKey );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
+                    gp.release();
 
                     gp = m.get( nKey );
                     CPPUNIT_CHECK( !gp );
@@ -177,12 +179,14 @@ namespace map {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
+                    gp.release();
                     
                     gp = m.extract_with( wrapped_item( nKey ), wrapped_less());
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
+                    gp.release();
 
                     gp = m.get_with( wrapped_item( nKey ), wrapped_less() );
                     CPPUNIT_CHECK( !gp );
@@ -219,7 +223,7 @@ namespace map {
                     gp.release();
                     CPPUNIT_CHECK( gp.empty());
                 }
-                CPPUNIT_CHECK( m.extract_max());
+                CPPUNIT_CHECK( !m.extract_max());
                 CPPUNIT_CHECK( gp.empty());
                 CPPUNIT_ASSERT( m.empty());
             }
diff --git a/tests/test-hdr/map/hdr_skiplist_map_rcu.h b/tests/test-hdr/map/hdr_skiplist_map_rcu.h
index c3a5d436..adff9d5f 100644
--- a/tests/test-hdr/map/hdr_skiplist_map_rcu.h
+++ b/tests/test-hdr/map/hdr_skiplist_map_rcu.h
@@ -179,6 +179,7 @@ namespace map {
                     CPPUNIT_ASSERT( !ep.empty() );
                     CPPUNIT_CHECK( ep->first == nKey );
                     CPPUNIT_CHECK( ep->second.m_val == nKey * 2 );
+                    ep.release();
 
                     {
                         rcu_lock l;
@@ -208,6 +209,7 @@ namespace map {
                     CPPUNIT_ASSERT( !ep.empty() );
                     CPPUNIT_CHECK( ep->first == nKey );
                     CPPUNIT_CHECK( ep->second.m_val == nKey * 2 );
+                    ep.release();
 
                     {
                         rcu_lock l;
@@ -227,6 +229,7 @@ namespace map {
                     CPPUNIT_ASSERT( !ep.empty() );
                     CPPUNIT_CHECK( ep->first == i );
                     CPPUNIT_CHECK( ep->second.m_val == i * 2 );
+                    ep.release();
                 }
                 CPPUNIT_ASSERT( m.empty() );
                 ep = m.extract_min();
@@ -241,6 +244,7 @@ namespace map {
                     CPPUNIT_ASSERT( !ep.empty() );
                     CPPUNIT_CHECK( ep->first == i );
                     CPPUNIT_CHECK( ep->second.m_val == i * 2 );
+                    ep.release();
                 }
                 CPPUNIT_ASSERT( m.empty() );
                 ep = m.extract_max();
diff --git a/tests/test-hdr/ordered_list/hdr_lazy.h b/tests/test-hdr/ordered_list/hdr_lazy.h
index b472bdb6..0b6bde9d 100644
--- a/tests/test-hdr/ordered_list/hdr_lazy.h
+++ b/tests/test-hdr/ordered_list/hdr_lazy.h
@@ -474,12 +474,14 @@ namespace ordlist {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey * 2 );
+                    gp.release();
 
                     gp = l.extract( nKey );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey*2 );
+                    gp.release();
 
                     gp = l.get( nKey );
                     CPPUNIT_CHECK( !gp );
@@ -508,12 +510,14 @@ namespace ordlist {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey * 2 );
+                    gp.release();
 
                     gp = l.extract_with( key, other_less() );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey*2 );
+                    gp.release();
 
                     gp = l.get_with( key, other_less() );
                     CPPUNIT_CHECK( !gp );
diff --git a/tests/test-hdr/ordered_list/hdr_lazy_kv.h b/tests/test-hdr/ordered_list/hdr_lazy_kv.h
index 27f63969..3a8509a2 100644
--- a/tests/test-hdr/ordered_list/hdr_lazy_kv.h
+++ b/tests/test-hdr/ordered_list/hdr_lazy_kv.h
@@ -302,12 +302,14 @@ namespace ordlist {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
+                    gp.release();
 
                     gp = l.extract( nKey );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey*2 );
+                    gp.release();
 
                     gp = l.get( nKey );
                     CPPUNIT_CHECK( !gp );
@@ -336,12 +338,14 @@ namespace ordlist {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
+                    gp.release();
 
                     gp = l.extract_with( key, other_less() );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey*2 );
+                    gp.release();
 
                     gp = l.get_with( key, other_less() );
                     CPPUNIT_CHECK( !gp );
@@ -410,7 +414,6 @@ namespace ordlist {
                     rcu_lock lock;
                     CPPUNIT_CHECK( l.get( a[0] ) == nullptr );
                     CPPUNIT_CHECK( !l.extract( a[0] ) );
-                    //CPPUNIT_CHECK( ep.empty() );
                 }
 
                 // extract_with/get_with
diff --git a/tests/test-hdr/ordered_list/hdr_michael.h b/tests/test-hdr/ordered_list/hdr_michael.h
index 8d3fb9a3..4672e971 100644
--- a/tests/test-hdr/ordered_list/hdr_michael.h
+++ b/tests/test-hdr/ordered_list/hdr_michael.h
@@ -475,12 +475,14 @@ namespace ordlist {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey * 2 );
+                    gp.release();
 
                     gp = l.extract( nKey );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey*2 );
+                    gp.release();
 
                     gp = l.get( nKey );
                     CPPUNIT_CHECK( !gp );
@@ -509,12 +511,14 @@ namespace ordlist {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey * 2 );
+                    gp.release();
 
                     gp = l.extract_with( key, other_less() );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey*2 );
+                    gp.release();
 
                     gp = l.get_with( key, other_less() );
                     CPPUNIT_CHECK( !gp );
diff --git a/tests/test-hdr/ordered_list/hdr_michael_kv.h b/tests/test-hdr/ordered_list/hdr_michael_kv.h
index c2b12e33..e4acdf8b 100644
--- a/tests/test-hdr/ordered_list/hdr_michael_kv.h
+++ b/tests/test-hdr/ordered_list/hdr_michael_kv.h
@@ -312,12 +312,15 @@ namespace ordlist {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
+                    gp.release();
+                    CPPUNIT_CHECK( gp.empty() );
 
                     gp = l.extract( nKey );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey*2 );
+                    gp.release();
 
                     gp = l.get( nKey );
                     CPPUNIT_CHECK( !gp );
@@ -346,12 +349,14 @@ namespace ordlist {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey * 2 );
+                    gp.release();
 
                     gp = l.extract_with( key, other_less() );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->first == nKey );
                     CPPUNIT_CHECK( gp->second.m_val == nKey*2 );
+                    gp.release();
 
                     gp = l.get_with( key, other_less() );
                     CPPUNIT_CHECK( !gp );
diff --git a/tests/test-hdr/set/hdr_intrusive_set.h b/tests/test-hdr/set/hdr_intrusive_set.h
index 5c69aff2..23636f89 100644
--- a/tests/test-hdr/set/hdr_intrusive_set.h
+++ b/tests/test-hdr/set/hdr_intrusive_set.h
@@ -508,12 +508,14 @@ namespace set {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey * 2 );
+                    gp.release();
 
                     gp = s.extract( nKey );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty() );
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey * 2 );
+                    gp.release();
 
                     gp = s.get( nKey );
                     CPPUNIT_CHECK( !gp );
@@ -526,12 +528,14 @@ namespace set {
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey * 2 );
+                    gp.release();
 
                     gp = s.extract_with( nKey, less<value_type>() );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty() );
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey * 2 );
+                    gp.release();
 
                     gp = s.get_with( nKey, less<value_type>() );
                     CPPUNIT_CHECK( !gp );
diff --git a/tests/test-hdr/set/hdr_intrusive_skiplist_set.h b/tests/test-hdr/set/hdr_intrusive_skiplist_set.h
index 349b2a25..87395540 100644
--- a/tests/test-hdr/set/hdr_intrusive_skiplist_set.h
+++ b/tests/test-hdr/set/hdr_intrusive_skiplist_set.h
@@ -235,11 +235,14 @@ namespace set {
                     CPPUNIT_CHECK( gp->nKey == i );
                     CPPUNIT_CHECK( gp->nVal == i * 2 );
                     gp->nVal *= 2;
+                    gp.release();
 
                     gp = s.extract( i );
                     CPPUNIT_CHECK( gp );
                     CPPUNIT_CHECK_EX( gp->nKey == i, "i=" << i << ", gp->nKey=" << gp->nKey);
                     CPPUNIT_CHECK_EX( (*gp).nVal == i * 4, "i=" << i << ", gp->nVal=" << gp->nVal );
+                    gp.release();
+
                     gp = s.extract( i );
                     CPPUNIT_CHECK( !gp );
                     CPPUNIT_CHECK( !s.get( i ));
@@ -255,11 +258,14 @@ namespace set {
                     CPPUNIT_CHECK( gp->nKey == i );
                     CPPUNIT_CHECK( (*gp).nVal == i * 2 );
                     gp->nVal *= 2;
+                    gp.release();
 
                     gp = s.extract_with( other_key( i ), other_key_less<typename Set::value_type>() );
                     CPPUNIT_CHECK( gp );
                     CPPUNIT_CHECK_EX( gp->nKey == i, "i=" << i << ", gp->nKey=" << gp->nKey);
                     CPPUNIT_CHECK_EX( (*gp).nVal == i * 4, "i=" << i << ", gp->nVal=" << gp->nVal );
+                    gp.release();
+
                     gp = s.extract_with( other_key( i ), other_key_less<typename Set::value_type>() );
                     CPPUNIT_CHECK( !gp );
                     CPPUNIT_CHECK( !s.get_with( other_key(i), other_key_less<typename Set::value_type>() ));
@@ -281,6 +287,7 @@ namespace set {
                         CPPUNIT_CHECK( gp->nKey == nPrevKey + 1 );
                         CPPUNIT_CHECK( (*gp).nVal == (nPrevKey + 1) * 2 );
                         nPrevKey = gp->nKey;
+                        gp.release();
                     }
                     gp.release();
                     CPPUNIT_CHECK( !s.extract_min());
@@ -302,6 +309,7 @@ namespace set {
                         CPPUNIT_CHECK( gp->nKey == nPrevKey - 1 );
                         CPPUNIT_CHECK( (*gp).nVal == (nPrevKey - 1) * 2 );
                         nPrevKey = gp->nKey;
+                        gp.release();
                     }
                     gp.release();
                     CPPUNIT_CHECK( !s.extract_min());
diff --git a/tests/test-hdr/set/hdr_intrusive_skiplist_set_rcu.h b/tests/test-hdr/set/hdr_intrusive_skiplist_set_rcu.h
index cd7d0ffd..1b4fd925 100644
--- a/tests/test-hdr/set/hdr_intrusive_skiplist_set_rcu.h
+++ b/tests/test-hdr/set/hdr_intrusive_skiplist_set_rcu.h
@@ -273,7 +273,7 @@ namespace set {
                         CPPUNIT_ASSERT( !ep.empty() );
                         CPPUNIT_CHECK( ep->nKey == i );
                         CPPUNIT_CHECK( ep->nVal == i * 4 );
-                        //ep.release();
+                        ep.release();
 
                         {
                             rcu_lock l;
@@ -305,7 +305,7 @@ namespace set {
                         CPPUNIT_ASSERT( !ep.empty() );
                         CPPUNIT_CHECK( ep->nKey == i );
                         CPPUNIT_CHECK( ep->nVal == i * 4 );
-                        //ep.release();
+                        ep.release();
 
                         {
                             rcu_lock l;
@@ -327,7 +327,7 @@ namespace set {
                     CPPUNIT_ASSERT( ep );
                     CPPUNIT_ASSERT( !ep.empty());
                     nPrevKey = ep->nKey;
-                    //ep.release();
+                    ep.release();
 
                     while ( !s.empty() ) {
                         ep = s.extract_min();
@@ -336,7 +336,7 @@ namespace set {
                         CPPUNIT_CHECK( ep->nKey == nPrevKey + 1 );
                         CPPUNIT_CHECK( ep->nVal == (nPrevKey + 1) * 2 );
                         nPrevKey = ep->nKey;
-                        //ep.release();
+                        ep.release();
                     }
                     ep = s.extract_min();
                     CPPUNIT_CHECK( !ep );
@@ -353,7 +353,7 @@ namespace set {
                     CPPUNIT_ASSERT( ep );
                     CPPUNIT_ASSERT( !ep.empty());
                     nPrevKey = ep->nKey;
-                    //ep.release();
+                    ep.release();
 
                     while ( !s.empty() ) {
                         ep = s.extract_max();
@@ -362,7 +362,7 @@ namespace set {
                         CPPUNIT_CHECK( ep->nKey == nPrevKey - 1 );
                         CPPUNIT_CHECK( ep->nVal == (nPrevKey - 1) * 2 );
                         nPrevKey = ep->nKey;
-                        //ep.release();
+                        ep.release();
                     }
                     ep = s.extract_min();
                     CPPUNIT_CHECK( !ep );
diff --git a/tests/test-hdr/set/hdr_set.h b/tests/test-hdr/set/hdr_set.h
index 261f1bf4..4e2281e7 100644
--- a/tests/test-hdr/set/hdr_set.h
+++ b/tests/test-hdr/set/hdr_set.h
@@ -365,13 +365,15 @@ namespace set {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey );
+                    gp.release();
 
                     gp = s.extract( nKey );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey );
-                    CPPUNIT_CHECK( !s.get(nKey));
+                    gp.release();
+                    CPPUNIT_CHECK( !s.get( nKey ) );
 
                     gp = s.extract( nKey );
                     CPPUNIT_CHECK( !gp );
@@ -390,12 +392,15 @@ namespace set {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey );
+                    gp.release();
 
                     gp = s.extract_with( other_item( nKey ), other_less() );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey );
+                    gp.release();
+
                     gp = s.get_with( other_item( nKey ), other_less() );
                     CPPUNIT_CHECK( !gp );
 
diff --git a/tests/test-hdr/set/hdr_skiplist_set.h b/tests/test-hdr/set/hdr_skiplist_set.h
index f8805cce..da528d3b 100644
--- a/tests/test-hdr/set/hdr_skiplist_set.h
+++ b/tests/test-hdr/set/hdr_skiplist_set.h
@@ -47,6 +47,7 @@ namespace set {
                 CPPUNIT_ASSERT( !gp.empty());
                 CPPUNIT_CHECK( gp->nKey == i );
                 CPPUNIT_CHECK( gp->nVal == i );
+                gp.release();
             }
             CPPUNIT_MSG( PrintStat()(s, "Iterator test, ascending insert order") );
 
@@ -68,6 +69,7 @@ namespace set {
                 CPPUNIT_ASSERT( !gp.empty() );
                 CPPUNIT_CHECK( gp->nKey == it->nKey );
                 CPPUNIT_CHECK( gp->nVal == it->nKey * 2 );
+                gp.release();
             }
             CPPUNIT_ASSERT( nCount == nLimit );
 
@@ -99,6 +101,7 @@ namespace set {
                 CPPUNIT_ASSERT( !gp.empty());
                 CPPUNIT_CHECK( gp->nKey == i-1 );
                 CPPUNIT_CHECK( gp->nVal == (i-1) * 2 );
+                gp.release();
             }
             CPPUNIT_MSG( PrintStat()(s, "Iterator test, descending insert order") );
 
@@ -174,12 +177,14 @@ namespace set {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey * 2);
+                    gp.release();
 
                     gp = s.extract( nKey );
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey * 2);
+                    gp.release();
 
                     gp = s.get( nKey );
                     CPPUNIT_CHECK( !gp );
@@ -199,12 +204,15 @@ namespace set {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey );
+                    gp.release();
 
                     gp = s.extract_with( wrapped_item( nKey ), wrapped_less());
                     CPPUNIT_ASSERT( gp );
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == nKey );
                     CPPUNIT_CHECK( gp->nVal == nKey );
+                    gp.release();
+
                     gp = s.get_with( wrapped_item( nKey ), wrapped_less());
                     CPPUNIT_CHECK( !gp );
                     CPPUNIT_ASSERT( !s.extract_with( wrapped_item(nKey), wrapped_less() ));
@@ -221,6 +229,8 @@ namespace set {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == i );
                     CPPUNIT_CHECK( gp->nVal == i );
+                    gp.release();
+
                     gp = s.get( i );
                     CPPUNIT_CHECK( !gp );
                 }
@@ -238,6 +248,8 @@ namespace set {
                     CPPUNIT_ASSERT( !gp.empty());
                     CPPUNIT_CHECK( gp->nKey == i );
                     CPPUNIT_CHECK( gp->nVal == i );
+                    gp.release();
+
                     gp = s.get( i );
                     CPPUNIT_CHECK( !gp );
                 }
diff --git a/tests/test-hdr/set/hdr_skiplist_set_rcu.h b/tests/test-hdr/set/hdr_skiplist_set_rcu.h
index ad10c40d..027ee0a5 100644
--- a/tests/test-hdr/set/hdr_skiplist_set_rcu.h
+++ b/tests/test-hdr/set/hdr_skiplist_set_rcu.h
@@ -173,6 +173,7 @@ namespace set {
                     CPPUNIT_ASSERT( !ep.empty() );
                     CPPUNIT_CHECK( ep->nKey == nKey );
                     CPPUNIT_CHECK( ep->nVal == nKey * 2 );
+                    ep.release();
 
                     {
                         rcu_lock l;
@@ -202,6 +203,7 @@ namespace set {
                     CPPUNIT_ASSERT( !ep.empty() );
                     CPPUNIT_CHECK( ep->nKey == nKey );
                     CPPUNIT_CHECK( ep->nVal == nKey );
+                    ep.release();
 
                     {
                         rcu_lock l;
@@ -223,6 +225,7 @@ namespace set {
                     CPPUNIT_CHECK( ep->nKey == i );
                     CPPUNIT_CHECK( ep->nVal == i );
                     CPPUNIT_CHECK( !s.find(i) );
+                    ep.release();
                 }
                 CPPUNIT_CHECK( s.empty());
 
@@ -237,6 +240,7 @@ namespace set {
                     CPPUNIT_CHECK( ep->nKey == i );
                     CPPUNIT_CHECK( ep->nVal == i );
                     CPPUNIT_CHECK( !s.find(i) );
+                    ep.release();
                 }
                 CPPUNIT_CHECK( s.empty());
                 ep = s.extract_min();
-- 
2.34.1