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

Unified Diff: base/win/scoped_comptr_unittest.cc

Issue 2792383003: Rename ScopedComPtr::Release() to ScopedComPtr::Reset() (Closed)
Patch Set: Fix New Callers Created 3 years, 8 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/win/scoped_comptr.h ('k') | base/win/shortcut.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/scoped_comptr_unittest.cc
diff --git a/base/win/scoped_comptr_unittest.cc b/base/win/scoped_comptr_unittest.cc
index 18bdc4ccb1905d31e92941c41fe788aac243d07d..3cde3145217cbabef13a752c05e44e70baeb932a 100644
--- a/base/win/scoped_comptr_unittest.cc
+++ b/base/win/scoped_comptr_unittest.cc
@@ -19,8 +19,8 @@ namespace {
struct Dummy {
Dummy() : adds(0), releases(0) { }
- void AddRef() { ++adds; }
- void Release() { ++releases; }
+ unsigned long AddRef() { return ++adds; }
+ unsigned long Release() { return ++releases; }
int adds;
int releases;
@@ -51,7 +51,7 @@ TEST(ScopedComPtrTest, ScopedComPtr) {
ScopedComPtr<IUnknown> qi_test;
EXPECT_HRESULT_SUCCEEDED(mem_alloc.QueryInterface(IID_PPV_ARGS(&qi_test)));
EXPECT_TRUE(qi_test.get() != NULL);
- qi_test.Release();
+ qi_test.Reset();
// test ScopedComPtr& constructor
ScopedComPtr<IMalloc> copy1(mem_alloc);
@@ -63,7 +63,7 @@ TEST(ScopedComPtrTest, ScopedComPtr) {
copy1 = naked_copy; // Test the =(T*) operator.
naked_copy->Release();
- copy1.Release();
+ copy1.Reset();
EXPECT_FALSE(copy1.IsSameObject(unk2.get())); // unk2 is valid, copy1 is not
// test Interface* constructor
@@ -72,7 +72,7 @@ TEST(ScopedComPtrTest, ScopedComPtr) {
EXPECT_TRUE(SUCCEEDED(unk.QueryFrom(mem_alloc.get())));
EXPECT_TRUE(unk.get() != NULL);
- unk.Release();
+ unk.Reset();
EXPECT_TRUE(unk.get() == NULL);
EXPECT_TRUE(unk.IsSameObject(copy1.get())); // both are NULL
}
« no previous file with comments | « base/win/scoped_comptr.h ('k') | base/win/shortcut.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698