Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Unified Diff: base/mac/scoped_nsobject_unittest.mm

Issue 2485463002: Fix scoped_nsobject move constructor. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/mac/scoped_nsobject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/scoped_nsobject_unittest.mm
diff --git a/base/mac/scoped_nsobject_unittest.mm b/base/mac/scoped_nsobject_unittest.mm
index 5694e6862f607c32c3918315ad93953df437aa42..457962d94189b40bb4345aa66dfc82580ed6c789 100644
--- a/base/mac/scoped_nsobject_unittest.mm
+++ b/base/mac/scoped_nsobject_unittest.mm
@@ -61,6 +61,12 @@ TEST(ScopedNSObjectTest, ScopedNSObject) {
ASSERT_EQ(3u, [p1 retainCount]);
}
ASSERT_EQ(2u, [p1 retainCount]);
+
+ base::scoped_nsobject<NSObject> p7([NSObject new]);
+ base::scoped_nsobject<NSObject> p8(std::move(p7));
+ ASSERT_TRUE(p8);
+ ASSERT_EQ(1u, [p8 retainCount]);
+ ASSERT_FALSE(p7.get());
}
// Instantiating scoped_nsobject<> with T=NSAutoreleasePool should trip a
« no previous file with comments | « base/mac/scoped_nsobject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698