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

Side by Side Diff: base/win/scoped_comptr_unittest.cc

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « base/win/scoped_bstr.h ('k') | base/win/scoped_handle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/win/scoped_comptr.h" 5 #include "base/win/scoped_comptr.h"
6 6
7 #include <shlobj.h> 7 #include <shlobj.h>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/win/scoped_com_initializer.h" 10 #include "base/win/scoped_com_initializer.h"
(...skipping 13 matching lines...) Expand all
24 int releases; 24 int releases;
25 }; 25 };
26 26
27 extern const IID dummy_iid; 27 extern const IID dummy_iid;
28 const IID dummy_iid = { 0x12345678u, 0x1234u, 0x5678u, 01, 23, 45, 67, 89, 28 const IID dummy_iid = { 0x12345678u, 0x1234u, 0x5678u, 01, 23, 45, 67, 89,
29 01, 23, 45 }; 29 01, 23, 45 };
30 30
31 } // namespace 31 } // namespace
32 32
33 TEST(ScopedComPtrTest, ScopedComPtr) { 33 TEST(ScopedComPtrTest, ScopedComPtr) {
34 EXPECT_TRUE(memcmp(&ScopedComPtr<IUnknown>::iid(), &IID_IUnknown, 34 EXPECT_EQ(memcmp(&ScopedComPtr<IUnknown>::iid(), &IID_IUnknown, sizeof(IID)),
35 sizeof(IID)) == 0); 35 0);
36 36
37 base::win::ScopedCOMInitializer com_initializer; 37 base::win::ScopedCOMInitializer com_initializer;
38 EXPECT_TRUE(com_initializer.succeeded()); 38 EXPECT_TRUE(com_initializer.succeeded());
39 39
40 ScopedComPtr<IUnknown> unk; 40 ScopedComPtr<IUnknown> unk;
41 EXPECT_TRUE(SUCCEEDED(unk.CreateInstance(CLSID_ShellLink))); 41 EXPECT_TRUE(SUCCEEDED(unk.CreateInstance(CLSID_ShellLink)));
42 ScopedComPtr<IUnknown> unk2; 42 ScopedComPtr<IUnknown> unk2;
43 unk2.Attach(unk.Detach()); 43 unk2.Attach(unk.Detach());
44 EXPECT_TRUE(unk.get() == NULL); 44 EXPECT_TRUE(unk.get() == NULL);
45 EXPECT_TRUE(unk2.get() != NULL); 45 EXPECT_TRUE(unk2.get() != NULL);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 bleh.pop_back(); 102 bleh.pop_back();
103 EXPECT_EQ(p->adds, 4); 103 EXPECT_EQ(p->adds, 4);
104 EXPECT_EQ(p->releases, 2); 104 EXPECT_EQ(p->releases, 2);
105 } 105 }
106 EXPECT_EQ(p->adds, 4); 106 EXPECT_EQ(p->adds, 4);
107 EXPECT_EQ(p->releases, 4); 107 EXPECT_EQ(p->releases, 4);
108 } 108 }
109 109
110 } // namespace win 110 } // namespace win
111 } // namespace base 111 } // namespace base
OLDNEW
« no previous file with comments | « base/win/scoped_bstr.h ('k') | base/win/scoped_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698