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/MemsetTest.cpp

Issue 1842753002: Style bikeshed - remove extraneous whitespace (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « tests/MatrixTest.cpp ('k') | tests/PaintTest.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 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkChunkAlloc.h" 8 #include "SkChunkAlloc.h"
9 #include "SkUtils.h" 9 #include "SkUtils.h"
10 #include "Test.h" 10 #include "Test.h"
11 11
12 static void check_alloc(skiatest::Reporter* reporter, const SkChunkAlloc& alloc, 12 static void check_alloc(skiatest::Reporter* reporter, const SkChunkAlloc& alloc,
13 size_t capacity, size_t used, int numBlocks) { 13 size_t capacity, size_t used, int numBlocks) {
14 REPORTER_ASSERT(reporter, alloc.totalCapacity() >= capacity); 14 REPORTER_ASSERT(reporter, alloc.totalCapacity() >= capacity);
15 REPORTER_ASSERT(reporter, alloc.totalUsed() == used); 15 REPORTER_ASSERT(reporter, alloc.totalUsed() == used);
16 SkDEBUGCODE(REPORTER_ASSERT(reporter, alloc.blockCount() == numBlocks);) 16 SkDEBUGCODE(REPORTER_ASSERT(reporter, alloc.blockCount() == numBlocks);)
17 } 17 }
18 18
19 static void* simple_alloc(skiatest::Reporter* reporter, SkChunkAlloc* alloc, siz e_t size) { 19 static void* simple_alloc(skiatest::Reporter* reporter, SkChunkAlloc* alloc, siz e_t size) {
20 void* ptr = alloc->allocThrow(size); 20 void* ptr = alloc->allocThrow(size);
21 check_alloc(reporter, *alloc, size, size, 1); 21 check_alloc(reporter, *alloc, size, size, 1);
22 REPORTER_ASSERT(reporter, alloc->contains(ptr)); 22 REPORTER_ASSERT(reporter, alloc->contains(ptr));
23 return ptr; 23 return ptr;
24 } 24 }
25 25
26 static void test_chunkalloc(skiatest::Reporter* reporter) { 26 static void test_chunkalloc(skiatest::Reporter* reporter) {
27 static const size_t kMin = 1024; 27 static const size_t kMin = 1024;
28 SkChunkAlloc alloc(kMin); 28 SkChunkAlloc alloc(kMin);
29 29
30 //------------------------------------------------------------------------ 30 //------------------------------------------------------------------------
31 // check empty 31 // check empty
32 check_alloc(reporter, alloc, 0, 0, 0); 32 check_alloc(reporter, alloc, 0, 0, 0);
33 REPORTER_ASSERT(reporter, !alloc.contains(nullptr)); 33 REPORTER_ASSERT(reporter, !alloc.contains(nullptr));
34 REPORTER_ASSERT(reporter, !alloc.contains(reporter)); 34 REPORTER_ASSERT(reporter, !alloc.contains(reporter));
35 35
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 * Test sk_memset16 and sk_memset32. 153 * Test sk_memset16 and sk_memset32.
154 * For performance considerations, implementations may take different paths 154 * For performance considerations, implementations may take different paths
155 * depending on the alignment of the dst, and/or the size of the count. 155 * depending on the alignment of the dst, and/or the size of the count.
156 */ 156 */
157 DEF_TEST(Memset, reporter) { 157 DEF_TEST(Memset, reporter) {
158 test_16(reporter); 158 test_16(reporter);
159 test_32(reporter); 159 test_32(reporter);
160 160
161 test_chunkalloc(reporter); 161 test_chunkalloc(reporter);
162 } 162 }
OLDNEW
« no previous file with comments | « tests/MatrixTest.cpp ('k') | tests/PaintTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698