Chromium Code Reviews| Index: base/process/memory_unittest.cc |
| diff --git a/base/process/memory_unittest.cc b/base/process/memory_unittest.cc |
| index 52777165a374d4cb1162ed4ef3a1e125c07fe2fa..ab0d220da5422c54660fe1b4f604ce691f8c1bea 100644 |
| --- a/base/process/memory_unittest.cc |
| +++ b/base/process/memory_unittest.cc |
| @@ -82,13 +82,11 @@ TEST(MemoryTest, AllocatorShimWorking) { |
| ASSERT_TRUE(base::allocator::IsAllocatorInitialized()); |
| } |
| -// Android doesn't implement set_new_handler, so we can't use the |
| -// OutOfMemoryTest cases. OpenBSD does not support these tests either. |
| -// Don't test these on ASan/TSan/MSan configurations: only test the real |
| -// allocator. |
| +// OpenBSD does not support these tests. Don't test these on ASan/TSan/MSan |
| +// configurations: only test the real allocator. |
| // Windows only supports these tests with the allocator shim in place. |
| -#if !defined(OS_ANDROID) && !defined(OS_OPENBSD) && \ |
| - BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) && \ |
| +#if !defined(OS_OPENBSD) && \ |
| + BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) && \ |
| !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) |
| namespace { |
| @@ -189,7 +187,7 @@ TEST_F(OutOfMemoryDeathTest, AlignedRealloc) { |
| // OS X has no 2Gb allocation limit. |
| // See https://crbug.com/169327. |
| -#if !defined(OS_MACOSX) |
| +#if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
|
Nico
2016/08/03 14:13:20
Why ifdef out these tests? Maybe update the commen
Primiano Tucci (use gerrit)
2016/08/03 15:04:48
So the thing is that, as things stands today, Andr
Nico
2016/08/03 15:06:52
Doesn't this test run on linux as well? Or am I mi
Primiano Tucci (use gerrit)
2016/08/03 15:21:45
Yes, it does. See logdog output for this CL in htt
|
| TEST_F(OutOfMemoryDeathTest, SecurityNew) { |
| ASSERT_EXIT({ |
| SetUpInDeathAssert(); |
| @@ -241,7 +239,7 @@ TEST_F(OutOfMemoryDeathTest, SecurityAlignedRealloc) { |
| }, testing::ExitedWithCode(kExitCode), kOomRegex); |
| } |
| #endif // defined(OS_WIN) |
| -#endif // !defined(OS_MACOSX) |
| +#endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| #if defined(OS_LINUX) |
| @@ -413,9 +411,6 @@ class OutOfMemoryHandledTest : public OutOfMemoryTest { |
| // TODO(b.kelemen): make UncheckedMalloc and UncheckedCalloc work |
| // on Windows as well. |
| -// UncheckedMalloc() and UncheckedCalloc() work as regular malloc()/calloc() |
| -// under sanitizer tools. |
| -#if !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) |
| TEST_F(OutOfMemoryHandledTest, UncheckedMalloc) { |
| EXPECT_TRUE(base::UncheckedMalloc(kSafeMallocSize, &value_)); |
| EXPECT_TRUE(value_ != NULL); |
| @@ -444,6 +439,5 @@ TEST_F(OutOfMemoryHandledTest, UncheckedCalloc) { |
| EXPECT_FALSE(base::UncheckedCalloc(1, test_size_, &value_)); |
| EXPECT_TRUE(value_ == NULL); |
| } |
| -#endif // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) |
| -#endif // !defined(OS_ANDROID) && !defined(OS_OPENBSD) && !(defined(OS_WIN) && |
| - // !defined(ALLOCATOR_SHIM)) && !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) |
| +#endif // !defined(OS_OPENBSD) && BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) && |
| + // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) |