| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #define _CRT_SECURE_NO_WARNINGS | 5 #define _CRT_SECURE_NO_WARNINGS |
| 6 | 6 |
| 7 #include "base/process/memory.h" | 7 #include "base/process/memory.h" |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 } | 236 } |
| 237 | 237 |
| 238 TEST_F(OutOfMemoryDeathTest, Valloc) { | 238 TEST_F(OutOfMemoryDeathTest, Valloc) { |
| 239 ASSERT_DEATH({ | 239 ASSERT_DEATH({ |
| 240 SetUpInDeathAssert(); | 240 SetUpInDeathAssert(); |
| 241 value_ = valloc(test_size_); | 241 value_ = valloc(test_size_); |
| 242 }, ""); | 242 }, ""); |
| 243 } | 243 } |
| 244 | 244 |
| 245 #if defined(OS_LINUX) | 245 #if defined(OS_LINUX) |
| 246 |
| 247 #if PVALLOC_AVAILABLE == 1 |
| 246 TEST_F(OutOfMemoryDeathTest, Pvalloc) { | 248 TEST_F(OutOfMemoryDeathTest, Pvalloc) { |
| 247 ASSERT_DEATH({ | 249 ASSERT_DEATH({ |
| 248 SetUpInDeathAssert(); | 250 SetUpInDeathAssert(); |
| 249 value_ = pvalloc(test_size_); | 251 value_ = pvalloc(test_size_); |
| 250 }, ""); | 252 }, ""); |
| 251 } | 253 } |
| 254 #endif // PVALLOC_AVAILABLE == 1 |
| 252 | 255 |
| 253 TEST_F(OutOfMemoryDeathTest, Memalign) { | 256 TEST_F(OutOfMemoryDeathTest, Memalign) { |
| 254 ASSERT_DEATH({ | 257 ASSERT_DEATH({ |
| 255 SetUpInDeathAssert(); | 258 SetUpInDeathAssert(); |
| 256 value_ = memalign(4, test_size_); | 259 value_ = memalign(4, test_size_); |
| 257 }, ""); | 260 }, ""); |
| 258 } | 261 } |
| 259 | 262 |
| 260 TEST_F(OutOfMemoryDeathTest, ViaSharedLibraries) { | 263 TEST_F(OutOfMemoryDeathTest, ViaSharedLibraries) { |
| 261 // This tests that the run-time symbol resolution is overriding malloc for | 264 // This tests that the run-time symbol resolution is overriding malloc for |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 SetUpInDeathAssert(); | 370 SetUpInDeathAssert(); |
| 368 while ((value_ = base::AllocatePsychoticallyBigObjCObject())) {} | 371 while ((value_ = base::AllocatePsychoticallyBigObjCObject())) {} |
| 369 }, ""); | 372 }, ""); |
| 370 } | 373 } |
| 371 | 374 |
| 372 #endif // !ARCH_CPU_64_BITS | 375 #endif // !ARCH_CPU_64_BITS |
| 373 #endif // OS_MACOSX | 376 #endif // OS_MACOSX |
| 374 | 377 |
| 375 #endif // !defined(OS_ANDROID) && !defined(OS_OPENBSD) && | 378 #endif // !defined(OS_ANDROID) && !defined(OS_OPENBSD) && |
| 376 // !defined(OS_WIN) && !defined(ADDRESS_SANITIZER) | 379 // !defined(OS_WIN) && !defined(ADDRESS_SANITIZER) |
| OLD | NEW |