| 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 "Test.h" | |
| 9 #include "SkChunkAlloc.h" | 8 #include "SkChunkAlloc.h" |
| 10 #include "SkUtils.h" | 9 #include "SkUtils.h" |
| 10 #include "Test.h" |
| 11 | 11 |
| 12 static void test_chunkalloc(skiatest::Reporter* reporter) { | 12 static void test_chunkalloc(skiatest::Reporter* reporter) { |
| 13 size_t min = 256; | 13 size_t min = 256; |
| 14 SkChunkAlloc alloc(min); | 14 SkChunkAlloc alloc(min); |
| 15 | 15 |
| 16 REPORTER_ASSERT(reporter, 0 == alloc.totalCapacity()); | 16 REPORTER_ASSERT(reporter, 0 == alloc.totalCapacity()); |
| 17 REPORTER_ASSERT(reporter, 0 == alloc.totalUsed()); | 17 REPORTER_ASSERT(reporter, 0 == alloc.totalUsed()); |
| 18 REPORTER_ASSERT(reporter, 0 == alloc.blockCount()); | 18 REPORTER_ASSERT(reporter, 0 == alloc.blockCount()); |
| 19 REPORTER_ASSERT(reporter, !alloc.contains(NULL)); | 19 REPORTER_ASSERT(reporter, !alloc.contains(NULL)); |
| 20 REPORTER_ASSERT(reporter, !alloc.contains(reporter)); | 20 REPORTER_ASSERT(reporter, !alloc.contains(reporter)); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 * Test sk_memset16 and sk_memset32. | 114 * Test sk_memset16 and sk_memset32. |
| 115 * For performance considerations, implementations may take different paths | 115 * For performance considerations, implementations may take different paths |
| 116 * depending on the alignment of the dst, and/or the size of the count. | 116 * depending on the alignment of the dst, and/or the size of the count. |
| 117 */ | 117 */ |
| 118 DEF_TEST(Memset, reporter) { | 118 DEF_TEST(Memset, reporter) { |
| 119 test_16(reporter); | 119 test_16(reporter); |
| 120 test_32(reporter); | 120 test_32(reporter); |
| 121 | 121 |
| 122 test_chunkalloc(reporter); | 122 test_chunkalloc(reporter); |
| 123 } | 123 } |
| OLD | NEW |