| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include <stdio.h> | 5 #include <stdio.h> |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 TEST(SecurityTest, ALLOC_TEST(MemoryAllocationRestrictionsNew)) { | 89 TEST(SecurityTest, ALLOC_TEST(MemoryAllocationRestrictionsNew)) { |
| 90 if (!IsTcMallocBypassed()) { | 90 if (!IsTcMallocBypassed()) { |
| 91 scoped_ptr<VeryLargeStruct> ptr(new (nothrow) VeryLargeStruct); | 91 scoped_ptr<VeryLargeStruct> ptr(new (nothrow) VeryLargeStruct); |
| 92 ASSERT_TRUE(ptr == NULL); | 92 ASSERT_TRUE(ptr == NULL); |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 | 95 |
| 96 TEST(SecurityTest, ALLOC_TEST(MemoryAllocationRestrictionsNewArray)) { | 96 TEST(SecurityTest, ALLOC_TEST(MemoryAllocationRestrictionsNewArray)) { |
| 97 if (!IsTcMallocBypassed()) { | 97 if (!IsTcMallocBypassed()) { |
| 98 scoped_array<char> ptr(new (nothrow) char[kTooBigAllocSize]); | 98 scoped_ptr<char[]> ptr(new (nothrow) char[kTooBigAllocSize]); |
| 99 ASSERT_TRUE(ptr == NULL); | 99 ASSERT_TRUE(ptr == NULL); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace | 103 } // namespace |
| OLD | NEW |