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

Unified Diff: chrome_elf/ntdll_cache_unittest.cc

Issue 85403005: Cache ntdll exports in ELF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: x64 fix and a test Created 7 years 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
« chrome_elf/ntdll_cache.cc ('K') | « chrome_elf/ntdll_cache.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_elf/ntdll_cache_unittest.cc
diff --git a/chrome_elf/ntdll_cache_unittest.cc b/chrome_elf/ntdll_cache_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..887fdf6179d84ba5eae6f9ec2e3239a4f16d58b1
--- /dev/null
+++ b/chrome_elf/ntdll_cache_unittest.cc
@@ -0,0 +1,34 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <windows.h>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "chrome_elf/ntdll_cache.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+// Test fixtures -------------------------------------------------------------
+
+class NTDLLCacheTest : public testing::Test {
+ protected:
+ virtual void SetUp() OVERRIDE {
+ InitCache();
+ }
+
+};
robertshield 2013/12/06 22:08:50 nit: feels like there should be a extra blank line
+// Tests ---------------------------------------------------------------------
+TEST_F(NTDLLCacheTest, NtDLLCacheSanityCheck) {
+ HMODULE ntdll_handle = ::GetModuleHandle(L"ntdll.dll");
+ // Grab a couple random entries from the cache and make sure they match the
+ // addresses exported by ntdll.
+ EXPECT_EQ(::GetProcAddress(ntdll_handle, "A_SHAFinal"),
+ g_ntdll_lookup["A_SHAFinal"]);
+ EXPECT_EQ(::GetProcAddress(ntdll_handle, "ZwTraceControl"),
+ g_ntdll_lookup["ZwTraceControl"]);
+}
+
+} // namespace
robertshield 2013/12/06 22:08:50 nit: two spaces before //
« chrome_elf/ntdll_cache.cc ('K') | « chrome_elf/ntdll_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698