| OLD | NEW |
| 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" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 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(NULL)); | 33 REPORTER_ASSERT(reporter, !alloc.contains(nullptr)); |
| 34 REPORTER_ASSERT(reporter, !alloc.contains(reporter)); | 34 REPORTER_ASSERT(reporter, !alloc.contains(reporter)); |
| 35 | 35 |
| 36 // reset on empty allocator | 36 // reset on empty allocator |
| 37 alloc.reset(); | 37 alloc.reset(); |
| 38 check_alloc(reporter, alloc, 0, 0, 0); | 38 check_alloc(reporter, alloc, 0, 0, 0); |
| 39 | 39 |
| 40 // rewind on empty allocator | 40 // rewind on empty allocator |
| 41 alloc.rewind(); | 41 alloc.rewind(); |
| 42 check_alloc(reporter, alloc, 0, 0, 0); | 42 check_alloc(reporter, alloc, 0, 0, 0); |
| 43 | 43 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 * Test sk_memset16 and sk_memset32. | 155 * Test sk_memset16 and sk_memset32. |
| 156 * For performance considerations, implementations may take different paths | 156 * For performance considerations, implementations may take different paths |
| 157 * depending on the alignment of the dst, and/or the size of the count. | 157 * depending on the alignment of the dst, and/or the size of the count. |
| 158 */ | 158 */ |
| 159 DEF_TEST(Memset, reporter) { | 159 DEF_TEST(Memset, reporter) { |
| 160 test_16(reporter); | 160 test_16(reporter); |
| 161 test_32(reporter); | 161 test_32(reporter); |
| 162 | 162 |
| 163 test_chunkalloc(reporter); | 163 test_chunkalloc(reporter); |
| 164 } | 164 } |
| OLD | NEW |