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

Unified Diff: base/win/scoped_comptr_unittest.cc

Issue 719363002: Remove implicit conversions from scoped_refptr to T* in base/win/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert silly comparison rewrite Created 6 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 | « no previous file | no next file » | 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 d8d12be87df04656c99c322a7c3377882641e99b..711c52ff046062884d9c582d34971f8da08367c9 100644
--- a/base/win/scoped_comptr_unittest.cc
+++ b/base/win/scoped_comptr_unittest.cc
@@ -41,8 +41,8 @@ TEST(ScopedComPtrTest, ScopedComPtr) {
EXPECT_TRUE(SUCCEEDED(unk.CreateInstance(CLSID_ShellLink)));
ScopedComPtr<IUnknown> unk2;
unk2.Attach(unk.Detach());
- EXPECT_TRUE(unk == NULL);
- EXPECT_TRUE(unk2 != NULL);
+ EXPECT_TRUE(unk.get() == NULL);
+ EXPECT_TRUE(unk2.get() != NULL);
ScopedComPtr<IMalloc> mem_alloc;
EXPECT_TRUE(SUCCEEDED(CoGetMalloc(1, mem_alloc.Receive())));
@@ -55,26 +55,26 @@ TEST(ScopedComPtrTest, ScopedComPtr) {
// test ScopedComPtr& constructor
ScopedComPtr<IMalloc> copy1(mem_alloc);
- EXPECT_TRUE(copy1.IsSameObject(mem_alloc));
- EXPECT_FALSE(copy1.IsSameObject(unk2)); // unk2 is valid but different
- EXPECT_FALSE(copy1.IsSameObject(unk)); // unk is NULL
+ EXPECT_TRUE(copy1.IsSameObject(mem_alloc.get()));
+ EXPECT_FALSE(copy1.IsSameObject(unk2.get())); // unk2 is valid but different
+ EXPECT_FALSE(copy1.IsSameObject(unk.get())); // unk is NULL
IMalloc* naked_copy = copy1.Detach();
copy1 = naked_copy; // Test the =(T*) operator.
naked_copy->Release();
copy1.Release();
- EXPECT_FALSE(copy1.IsSameObject(unk2)); // unk2 is valid, copy1 is not
+ EXPECT_FALSE(copy1.IsSameObject(unk2.get())); // unk2 is valid, copy1 is not
// test Interface* constructor
- ScopedComPtr<IMalloc> copy2(static_cast<IMalloc*>(mem_alloc));
- EXPECT_TRUE(copy2.IsSameObject(mem_alloc));
+ ScopedComPtr<IMalloc> copy2(static_cast<IMalloc*>(mem_alloc.get()));
+ EXPECT_TRUE(copy2.IsSameObject(mem_alloc.get()));
- EXPECT_TRUE(SUCCEEDED(unk.QueryFrom(mem_alloc)));
- EXPECT_TRUE(unk != NULL);
+ EXPECT_TRUE(SUCCEEDED(unk.QueryFrom(mem_alloc.get())));
+ EXPECT_TRUE(unk.get() != NULL);
unk.Release();
- EXPECT_TRUE(unk == NULL);
- EXPECT_TRUE(unk.IsSameObject(copy1)); // both are NULL
+ EXPECT_TRUE(unk.get() == NULL);
+ EXPECT_TRUE(unk.IsSameObject(copy1.get())); // both are NULL
}
TEST(ScopedComPtrTest, ScopedComPtrVector) {
@@ -98,7 +98,7 @@ TEST(ScopedComPtrTest, ScopedComPtrVector) {
bleh.push_back(p2);
EXPECT_EQ(p->adds, 4);
EXPECT_EQ(p->releases, 1);
- EXPECT_EQ(bleh[0], p.get());
+ EXPECT_EQ(bleh[0].get(), p.get());
bleh.pop_back();
EXPECT_EQ(p->adds, 4);
EXPECT_EQ(p->releases, 2);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698