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

Side by Side Diff: tests/VarAllocTest.cpp

Issue 1339093002: Have SkVarAlloc::alloc() use sk_malloc_throw. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: no, always throw Created 5 years, 3 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 | « src/gpu/GrBatchFontCache.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
1 #include "Test.h" 8 #include "Test.h"
2 #include "SkVarAlloc.h" 9 #include "SkVarAlloc.h"
3 10
4 DEF_TEST(VarAlloc, r) { 11 DEF_TEST(VarAlloc, r) {
5 SkVarAlloc va(4/*start allocating at 16B*/); 12 SkVarAlloc va(4/*start allocating at 16B*/);
6 char* p = va.alloc(128, SK_MALLOC_THROW); 13 char* p = va.alloc(128);
7 sk_bzero(p, 128); // Just checking this is safe. 14 sk_bzero(p, 128); // Just checking this is safe.
8 15
9 #if !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__) 16 #if !defined(SK_BUILD_FOR_ANDROID) && !defined(__UCLIBC__)
10 // This method will always return 0 on Android and UCLIBC platforms. 17 // This method will always return 0 on Android and UCLIBC platforms.
11 REPORTER_ASSERT(r, va.approxBytesAllocated() >= 128); 18 REPORTER_ASSERT(r, va.approxBytesAllocated() >= 128);
12 #endif 19 #endif
13 } 20 }
OLDNEW
« no previous file with comments | « src/gpu/GrBatchFontCache.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698