Index: base/process_util_unittest.cc |
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc |
index 3b05d03a0661a5e1b62c51bda81c7f513b6fa5b6..8a653d4c04c14540590ec21365c8f18cbecc58dd 100644 |
--- a/base/process_util_unittest.cc |
+++ b/base/process_util_unittest.cc |
@@ -397,6 +397,21 @@ TEST_F(ProcessUtilTest, LaunchAsUser) { |
#endif // defined(OS_WIN) |
+#if defined(OS_MACOSX) |
+ |
+TEST_F(ProcessUtilTest, MacTerminateOnHeapCorruption) { |
+ // Note that base::EnableTerminationOnHeapCorruption() is called as part of |
+ // test suite setup and does not need to be done again, else mach_override |
+ // will fail. |
+ |
+ char buf[3]; |
+ 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"); |
+} |
+ |
+#endif // defined(OS_MACOSX) |
+ |
#if defined(OS_POSIX) |
namespace { |