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

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

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/pe_image.cc ('k') | build/all.gyp » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/win/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
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 FARPROC address1 = pe.GetProcAddress("RegEnumKeyExW"); 261 FARPROC address1 = pe.GetProcAddress("RegEnumKeyExW");
262 FARPROC address2 = pe.GetProcAddress(reinterpret_cast<char*>(ordinal)); 262 FARPROC address2 = pe.GetProcAddress(reinterpret_cast<char*>(ordinal));
263 EXPECT_TRUE(address1 != NULL); 263 EXPECT_TRUE(address1 != NULL);
264 EXPECT_TRUE(address2 != NULL); 264 EXPECT_TRUE(address2 != NULL);
265 EXPECT_TRUE(address1 == address2); 265 EXPECT_TRUE(address1 == address2);
266 266
267 FreeLibrary(module); 267 FreeLibrary(module);
268 } 268 }
269 269
270 // Test that we can get debug id out of a module.
271 TEST(PEImageTest, GetDebugId) {
272 HMODULE module = LoadLibrary(L"advapi32.dll");
273 ASSERT_TRUE(NULL != module);
274
275 PEImage pe(module);
276 GUID guid = {0};
277 DWORD age = 0;
278 EXPECT_TRUE(pe.GetDebugId(&guid, &age));
279
280 GUID empty_guid = {0};
281 EXPECT_TRUE(!IsEqualGUID(empty_guid, guid));
282 EXPECT_NE(0U, age);
283 FreeLibrary(module);
284 }
285
286 } // namespace win 270 } // namespace win
287 } // namespace base 271 } // namespace base
OLDNEW
« no previous file with comments | « base/win/pe_image.cc ('k') | build/all.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698