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

Unified Diff: base/memory/weak_ptr_unittest.cc

Issue 9455086: Make WeakPtr::operator* return reference instead of pointer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 8 years, 10 months 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/memory/weak_ptr.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/weak_ptr_unittest.cc
diff --git a/base/memory/weak_ptr_unittest.cc b/base/memory/weak_ptr_unittest.cc
index be28e526e1cf22c1083ea8acf639213e7e97444e..8f42664ee244a486b433b70837d2722d477a87ec 100644
--- a/base/memory/weak_ptr_unittest.cc
+++ b/base/memory/weak_ptr_unittest.cc
@@ -34,7 +34,7 @@ class OffThreadObjectCreator {
}
};
-struct Base {};
+struct Base { std::string member; };
struct Derived : Base {};
struct Producer : SupportsWeakPtr<Producer> {};
@@ -337,10 +337,12 @@ TEST(WeakPtrTest, OwnerThreadDeletesObject) {
TEST(WeakPtrTest, Dereference) {
Base data;
+ data.member = "123456";
WeakPtrFactory<Base> factory(&data);
WeakPtr<Base> ptr = factory.GetWeakPtr();
EXPECT_EQ(&data, ptr.get());
- EXPECT_EQ(&data, *ptr);
+ EXPECT_EQ(data.member, (*ptr).member);
+ EXPECT_EQ(data.member, ptr->member);
}
} // namespace base
« no previous file with comments | « base/memory/weak_ptr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698