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 | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/include/util/impl/shared_ptr.H b/src/include/util/impl/shared_ptr.H index 0740d430d..3be41e0ce 100644 --- a/src/include/util/impl/shared_ptr.H +++ b/src/include/util/impl/shared_ptr.H @@ -78,6 +78,11 @@ namespace std ~shared_ptr() { _cleanup(); } + 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 17701b4f3..2e68c5774 100644 --- a/src/usr/testcore/lib/shared_ptr.H +++ b/src/usr/testcore/lib/shared_ptr.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -74,6 +74,11 @@ class STLSharedPtrTest : public CxxTest::TestSuite TS_FAIL("p3 is not unique."); } + if (!(p1 == p2)) + { + TS_FAIL("p1 and p2 should be equal"); + } + shared_ptr<T1> p4 = static_pointer_cast<T1>(p3); if (p3.use_count() != 2) { |

