Index: base/process/memory_unittest.cc |
diff --git a/base/process/memory_unittest.cc b/base/process/memory_unittest.cc |
index 50ba098d5f2cb6f5a54b3bb64b41917f187568fb..2e64fd7476602419181d3d0259cdbe90b1a1688a 100644 |
--- a/base/process/memory_unittest.cc |
+++ b/base/process/memory_unittest.cc |
@@ -26,6 +26,7 @@ |
#endif |
#if defined(OS_LINUX) |
#include <malloc.h> |
+#include "base/test/malloc_wrapper.h" |
#endif |
#if defined(OS_WIN) |
@@ -234,13 +235,11 @@ TEST_F(OutOfMemoryDeathTest, Memalign) { |
TEST_F(OutOfMemoryDeathTest, ViaSharedLibraries) { |
// This tests that the run-time symbol resolution is overriding malloc for |
- // shared libraries (including libc itself) as well as for our code. |
- std::string format = base::StringPrintf("%%%zud", test_size_); |
- char *value = NULL; |
+ // shared libraries as well as for our code. |
ASSERT_DEATH({ |
- SetUpInDeathAssert(); |
- EXPECT_EQ(-1, asprintf(&value, format.c_str(), 0)); |
- }, ""); |
+ SetUpInDeathAssert(); |
+ value_ = MallocWrapper(test_size_); |
+ }, ""); |
} |
#endif // OS_LINUX |