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

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

Issue 3836005: Move pe_image and registry from base to base/win and use the namespace. It re... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/win/pe_image.cc ('k') | base/win/registry.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // This file contains unit tests for PEImage. 5 // This file contains unit tests for PEImage.
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "base/pe_image.h" 8 #include "base/win/pe_image.h"
9 #include "base/win/windows_version.h" 9 #include "base/win/windows_version.h"
10 10
11 namespace base {
12 namespace win {
13
11 // Just counts the number of invocations. 14 // Just counts the number of invocations.
12 bool ExportsCallback(const PEImage &image, 15 bool ExportsCallback(const PEImage &image,
13 DWORD ordinal, 16 DWORD ordinal,
14 DWORD hint, 17 DWORD hint,
15 LPCSTR name, 18 LPCSTR name,
16 PVOID function, 19 PVOID function,
17 LPCSTR forward, 20 LPCSTR forward,
18 PVOID cookie) { 21 PVOID cookie) {
19 int* count = reinterpret_cast<int*>(cookie); 22 int* count = reinterpret_cast<int*>(cookie);
20 (*count)++; 23 (*count)++;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 EXPECT_TRUE(pe.GetProcOrdinal("RegEnumKeyExW", &ordinal)); 207 EXPECT_TRUE(pe.GetProcOrdinal("RegEnumKeyExW", &ordinal));
205 208
206 FARPROC address1 = pe.GetProcAddress("RegEnumKeyExW"); 209 FARPROC address1 = pe.GetProcAddress("RegEnumKeyExW");
207 FARPROC address2 = pe.GetProcAddress(reinterpret_cast<char*>(ordinal)); 210 FARPROC address2 = pe.GetProcAddress(reinterpret_cast<char*>(ordinal));
208 EXPECT_TRUE(address1 != NULL); 211 EXPECT_TRUE(address1 != NULL);
209 EXPECT_TRUE(address2 != NULL); 212 EXPECT_TRUE(address2 != NULL);
210 EXPECT_TRUE(address1 == address2); 213 EXPECT_TRUE(address1 == address2);
211 214
212 FreeLibrary(module); 215 FreeLibrary(module);
213 } 216 }
217
218 } // namespace win
219 } // namespace base
OLDNEW
« no previous file with comments | « base/win/pe_image.cc ('k') | base/win/registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698