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

Unified Diff: base/memory/scoped_ptr_unittest.cc

Issue 663243003: Clean up final uses of scoped_ptr<T>::PassAs() and remove it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/scoped_ptr.h ('k') | cc/PRESUBMIT.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/scoped_ptr_unittest.cc
diff --git a/base/memory/scoped_ptr_unittest.cc b/base/memory/scoped_ptr_unittest.cc
index 3da8d3bd708ffebfafc178a8dad23ddb1b06c56b..c1e0e5622ad585ebc4ce4ae79533cbec7b5cbd56 100644
--- a/base/memory/scoped_ptr_unittest.cc
+++ b/base/memory/scoped_ptr_unittest.cc
@@ -91,11 +91,6 @@ scoped_ptr<ConDecLogger> TestReturnOfType(int* constructed) {
return scoped_ptr<ConDecLogger>(new ConDecLogger(constructed));
}
-scoped_ptr<ConDecLoggerParent> UpcastUsingPassAs(
- scoped_ptr<ConDecLogger> object) {
- return object.PassAs<ConDecLoggerParent>();
-}
-
} // namespace
TEST(ScopedPtrTest, ScopedPtr) {
@@ -459,22 +454,6 @@ TEST(ScopedPtrTest, ReturnTypeBehavior) {
EXPECT_EQ(0, constructed);
}
-TEST(ScopedPtrTest, PassAs) {
- int constructed = 0;
- {
- scoped_ptr<ConDecLogger> scoper(new ConDecLogger(&constructed));
- EXPECT_EQ(1, constructed);
- EXPECT_TRUE(scoper.get());
-
- scoped_ptr<ConDecLoggerParent> scoper_parent;
- scoper_parent = UpcastUsingPassAs(scoper.Pass());
- EXPECT_EQ(1, constructed);
- EXPECT_TRUE(scoper_parent.get());
- EXPECT_FALSE(scoper.get());
- }
- EXPECT_EQ(0, constructed);
-}
-
TEST(ScopedPtrTest, CustomDeleter) {
double dummy_value; // Custom deleter never touches this value.
int deletes = 0;
« no previous file with comments | « base/memory/scoped_ptr.h ('k') | cc/PRESUBMIT.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698