Chromium Code Reviews| Index: base/process_util_unittest.cc |
| diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc |
| index ef383b6175a04614e4572599fb3b61d304c87e7b..1080de76b724ed9713606538dff6c0b1cfec0925 100644 |
| --- a/base/process_util_unittest.cc |
| +++ b/base/process_util_unittest.cc |
| @@ -543,17 +543,17 @@ TEST_F(ProcessUtilTest, LaunchAsUser) { |
| // 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(); |
| - |
| // Test that ENOMEM doesn't crash via CrMallocErrorBreak two ways: the exit |
| // code and lack of the error string. The number of bytes is one less than |
| // MALLOC_ABSOLUTE_MAX_SIZE, more than which the system early-returns NULL and |
| // does not call through malloc_error_break(). See the comment at |
| // EnableTerminationOnOutOfMemory() for more information. |
| void* buf = NULL; |
| - ASSERT_EXIT( |
| - buf = malloc(std::numeric_limits<size_t>::max() - (2 * PAGE_SIZE) - 1), |
| + ASSERT_EXIT({ |
| + // Install the OOM killer. |
| + base::EnableTerminationOnOutOfMemory(); |
| + |
| + buf = malloc(std::numeric_limits<size_t>::max() - (2 * PAGE_SIZE) - 1);}, |
|
Robert Sesek
2013/04/05 18:13:22
nit: I'd balance the } on a new line indented 4 sp
|
| testing::KilledBySignal(SIGTRAP), |
| "\\*\\*\\* error: can't allocate region.*" |
| "(Terminating process due to a potential for future heap " |