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

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

Issue 2792173003: Remove ScopedComPtr::iid() (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « base/win/scoped_comptr.h ('k') | chrome/browser/google/google_update_win.cc » ('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 <objbase.h> 7 #include <objbase.h>
8 #include <shlobj.h> 8 #include <shlobj.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 17 matching lines...) Expand all
28 28
29 extern const IID dummy_iid; 29 extern const IID dummy_iid;
30 const IID dummy_iid = {0x12345678u, 30 const IID dummy_iid = {0x12345678u,
31 0x1234u, 31 0x1234u,
32 0x5678u, 32 0x5678u,
33 {01, 23, 45, 67, 89, 01, 23, 45}}; 33 {01, 23, 45, 67, 89, 01, 23, 45}};
34 34
35 } // namespace 35 } // namespace
36 36
37 TEST(ScopedComPtrTest, ScopedComPtr) { 37 TEST(ScopedComPtrTest, ScopedComPtr) {
38 EXPECT_EQ(memcmp(&ScopedComPtr<IUnknown>::iid(), &IID_IUnknown, sizeof(IID)),
39 0);
40
41 base::win::ScopedCOMInitializer com_initializer; 38 base::win::ScopedCOMInitializer com_initializer;
42 EXPECT_TRUE(com_initializer.succeeded()); 39 EXPECT_TRUE(com_initializer.succeeded());
43 40
44 ScopedComPtr<IUnknown> unk; 41 ScopedComPtr<IUnknown> unk;
45 EXPECT_TRUE(SUCCEEDED(unk.CreateInstance(CLSID_ShellLink))); 42 EXPECT_TRUE(SUCCEEDED(unk.CreateInstance(CLSID_ShellLink)));
46 ScopedComPtr<IUnknown> unk2; 43 ScopedComPtr<IUnknown> unk2;
47 unk2.Attach(unk.Detach()); 44 unk2.Attach(unk.Detach());
48 EXPECT_TRUE(unk.get() == NULL); 45 EXPECT_TRUE(unk.get() == NULL);
49 EXPECT_TRUE(unk2.get() != NULL); 46 EXPECT_TRUE(unk2.get() != NULL);
50 47
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 bleh.pop_back(); 102 bleh.pop_back();
106 EXPECT_EQ(p->adds, 4); 103 EXPECT_EQ(p->adds, 4);
107 EXPECT_EQ(p->releases, 2); 104 EXPECT_EQ(p->releases, 2);
108 } 105 }
109 EXPECT_EQ(p->adds, 4); 106 EXPECT_EQ(p->adds, 4);
110 EXPECT_EQ(p->releases, 4); 107 EXPECT_EQ(p->releases, 4);
111 } 108 }
112 109
113 } // namespace win 110 } // namespace win
114 } // namespace base 111 } // namespace base
OLDNEW
« no previous file with comments | « base/win/scoped_comptr.h ('k') | chrome/browser/google/google_update_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698