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

Side by Side Diff: core/fxcrt/fx_basic_memmgr_unittest.cpp

Issue 2382723003: Move core/fxcrt/include to core/fxcrt (Closed)
Patch Set: Rebase to master Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « core/fxcrt/fx_basic_memmgr.cpp ('k') | core/fxcrt/fx_basic_plex.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 PDFium Authors. All rights reserved. 1 // Copyright 2015 PDFium 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 <limits> 5 #include <limits>
6 6
7 #include "core/fxcrt/include/fx_memory.h" 7 #include "core/fxcrt/fx_memory.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace { 10 namespace {
11 11
12 const size_t kMaxByteAlloc = std::numeric_limits<size_t>::max(); 12 const size_t kMaxByteAlloc = std::numeric_limits<size_t>::max();
13 const size_t kMaxIntAlloc = kMaxByteAlloc / sizeof(int); 13 const size_t kMaxIntAlloc = kMaxByteAlloc / sizeof(int);
14 const size_t kOverflowIntAlloc = kMaxIntAlloc + 100; 14 const size_t kOverflowIntAlloc = kMaxIntAlloc + 100;
15 const size_t kWidth = 640; 15 const size_t kWidth = 640;
16 const size_t kOverflowIntAlloc2D = kMaxIntAlloc / kWidth + 10; 16 const size_t kOverflowIntAlloc2D = kMaxIntAlloc / kWidth + 10;
17 17
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 TEST(fxcrt, DISABLED_FXMEM_DefaultOOM) { 73 TEST(fxcrt, DISABLED_FXMEM_DefaultOOM) {
74 EXPECT_FALSE(FXMEM_DefaultAlloc(kMaxByteAlloc, 0)); 74 EXPECT_FALSE(FXMEM_DefaultAlloc(kMaxByteAlloc, 0));
75 75
76 void* ptr = FXMEM_DefaultAlloc(1, 0); 76 void* ptr = FXMEM_DefaultAlloc(1, 0);
77 EXPECT_TRUE(ptr); 77 EXPECT_TRUE(ptr);
78 EXPECT_FALSE(FXMEM_DefaultRealloc(ptr, kMaxByteAlloc, 0)); 78 EXPECT_FALSE(FXMEM_DefaultRealloc(ptr, kMaxByteAlloc, 0));
79 FXMEM_DefaultFree(ptr, 0); 79 FXMEM_DefaultFree(ptr, 0);
80 } 80 }
OLDNEW
« no previous file with comments | « core/fxcrt/fx_basic_memmgr.cpp ('k') | core/fxcrt/fx_basic_plex.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698