From e6f1aa44c93f4157459d3ddd55382c4ce533e4c7 Mon Sep 17 00:00:00 2001 From: "glider@chromium.org" Date: Fri, 6 Apr 2012 14:32:00 +0000 Subject: Do not run ProcessUtilTest.MacMallocFailureDoesNotTerminate under ASan. BUG=122140 TBR=willchan Review URL: https://chromiumcodereview.appspot.com/10012036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131124 0039d316-1c4b-4281-b951-d872f2087c98 --- base/process_util_unittest.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'base/process_util_unittest.cc') diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc index b74a3fb..45ecdbb 100644 --- a/base/process_util_unittest.cc +++ b/base/process_util_unittest.cc @@ -455,6 +455,9 @@ TEST_F(ProcessUtilTest, LaunchAsUser) { // test suite setup and does not need to be done again, else mach_override // will fail. +#if !defined(ADDRESS_SANITIZER) +// The following code tests the system implementation of malloc() thus no need +// to test it under AddressSanitizer. TEST_F(ProcessUtilTest, MacMallocFailureDoesNotTerminate) { // Install the OOM killer. base::EnableTerminationOnOutOfMemory(); @@ -474,11 +477,12 @@ TEST_F(ProcessUtilTest, MacMallocFailureDoesNotTerminate) { base::debug::Alias(buf); } +#endif // !defined(ADDRESS_SANITIZER) TEST_F(ProcessUtilTest, MacTerminateOnHeapCorruption) { // Assert that freeing an unallocated pointer will crash the process. char buf[3]; -#ifndef ADDRESS_SANITIZER +#if !defined(ADDRESS_SANITIZER) ASSERT_DEATH(free(buf), "being freed.*" "\\*\\*\\* set a breakpoint in malloc_error_break to debug.*" "Terminating process due to a potential for future heap corruption"); @@ -487,7 +491,7 @@ TEST_F(ProcessUtilTest, MacTerminateOnHeapCorruption) { // heap corruption. ASSERT_DEATH(free(buf), "attempting free on address which " "was not malloc\\(\\)-ed"); -#endif +#endif // !defined(ADDRESS_SANITIZER) } #endif // defined(OS_MACOSX) -- cgit v1.1