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

Unified Diff: syzygy/agent/asan/rtl_unittest.cc

Issue 2350133002: Minor changes in the RTL unittest. (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: syzygy/agent/asan/rtl_unittest.cc
diff --git a/syzygy/agent/asan/rtl_unittest.cc b/syzygy/agent/asan/rtl_unittest.cc
index ec0d883b564f72ec56db9561f37a75c48d623fa1..45d2a15ad211eb46dcd48b2699d1debdbcb4aecc 100644
--- a/syzygy/agent/asan/rtl_unittest.cc
+++ b/syzygy/agent/asan/rtl_unittest.cc
@@ -194,9 +194,15 @@ TEST_F(AsanRtlTest, AsanCheckWildAccess) {
::GetProcAddress(asan_rtl_, "asan_check_4_byte_read_access");
ASSERT_TRUE(check_access_fn != NULL);
+#ifndef _WIN64
+ void* addr = reinterpret_cast<void*>(0x80000000);
+#else
+ void* addr = reinterpret_cast<void*>(1ULL << 63);
+#endif
+
MemoryAccessorTester tester;
tester.AssertMemoryErrorIsDetected(
- check_access_fn, reinterpret_cast<void*>(0x80000000), WILD_ACCESS);
+ check_access_fn, addr, WILD_ACCESS);
EXPECT_TRUE(LogContains(kWildAccess));
}
@@ -223,10 +229,10 @@ TEST_F(AsanRtlTest, AsanReportInvalidAccess) {
MemoryAccessorTester tester;
agent::asan::AsanRuntime* runtime = GetActiveRuntimeFunction();
- ASSERT_NE(reinterpret_cast<agent::asan::AsanRuntime*>(NULL), runtime);
+ ASSERT_NE(static_cast<agent::asan::AsanRuntime*>(nullptr), runtime);
runtime->params().report_invalid_accesses = true;
tester.AssertMemoryErrorIsDetected(
- check_access_fn, reinterpret_cast<void*>(0x00000000), INVALID_ADDRESS);
+ check_access_fn, static_cast<void*>(nullptr), INVALID_ADDRESS);
EXPECT_TRUE(LogContains(kInvalidAddress));
}
@@ -244,7 +250,7 @@ TEST_F(AsanRtlTest, AsanCheckCorruptBlock) {
TEST_F(AsanRtlTest, AsanCheckCorruptHeap) {
FARPROC check_access_fn =
::GetProcAddress(asan_rtl_, "asan_check_4_byte_read_access");
- ASSERT_TRUE(check_access_fn != NULL);
+ ASSERT_TRUE(check_access_fn != nullptr);
agent::asan::AsanRuntime* runtime = GetActiveRuntimeFunction();
ASSERT_NE(reinterpret_cast<agent::asan::AsanRuntime*>(NULL), runtime);
@@ -304,6 +310,7 @@ TEST_F(AsanRtlTest, AsanCheckCorruptHeap) {
}
}
+#ifndef _WIN64
TEST_F(AsanRtlTest, AsanSingleSpecial1byteInstructionCheckGoodAccess) {
static const char* function_names[] = {
"asan_check_1_byte_movs_access",
@@ -630,6 +637,7 @@ TEST_F(AsanRtlTest, AllocationFilterFlag) {
SetAllocationFilterFlagFunction();
EXPECT_TRUE(runtime->allocation_filter_flag());
}
+#endif
namespace {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698