Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Unified Diff: base/process/memory_unittest.cc

Issue 1064793002: Fix OutOfMemoryDeathTest.ViaSharedLibraries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed CL to avoid target enumeration on unsupported OS Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/base_unittests.isolate ('k') | base/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « base/base_unittests.isolate ('k') | base/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698