diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/include/util/impl/shared_ptr.H | 5 | ||||
| -rw-r--r-- | src/usr/testcore/lib/shared_ptr.H | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/include/util/impl/shared_ptr.H b/src/include/util/impl/shared_ptr.H index 3be41e0ce..08cb6d044 100644 --- a/src/include/util/impl/shared_ptr.H +++ b/src/include/util/impl/shared_ptr.H @@ -83,6 +83,11 @@ namespace std return (pointer == r.pointer); } + bool operator!=(const shared_ptr &r) const + { + return (pointer != r.pointer); + } + shared_ptr& operator=(const shared_ptr& r) { _cleanup(); diff --git a/src/usr/testcore/lib/shared_ptr.H b/src/usr/testcore/lib/shared_ptr.H index 2e68c5774..6a9f4e76a 100644 --- a/src/usr/testcore/lib/shared_ptr.H +++ b/src/usr/testcore/lib/shared_ptr.H @@ -74,12 +74,16 @@ class STLSharedPtrTest : public CxxTest::TestSuite TS_FAIL("p3 is not unique."); } - if (!(p1 == p2)) + if (p1 == p2) { - TS_FAIL("p1 and p2 should be equal"); + TS_FAIL("p1 and p2 should not be equal pointers"); } shared_ptr<T1> p4 = static_pointer_cast<T1>(p3); + if (p3 != p4) + { + TS_FAIL("p3 and p4 should be equal pointers"); + } if (p3.use_count() != 2) { TS_FAIL("p3 is not shared now."); |

