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 "SkData.h" | 8 #include "SkData.h" |
10 #include "SkDataTable.h" | 9 #include "SkDataTable.h" |
| 10 #include "SkOSFile.h" |
11 #include "SkOrderedReadBuffer.h" | 11 #include "SkOrderedReadBuffer.h" |
12 #include "SkOrderedWriteBuffer.h" | 12 #include "SkOrderedWriteBuffer.h" |
13 #include "SkOSFile.h" | |
14 #include "SkStream.h" | 13 #include "SkStream.h" |
| 14 #include "Test.h" |
15 | 15 |
16 static void test_is_equal(skiatest::Reporter* reporter, | 16 static void test_is_equal(skiatest::Reporter* reporter, |
17 const SkDataTable* a, const SkDataTable* b) { | 17 const SkDataTable* a, const SkDataTable* b) { |
18 REPORTER_ASSERT(reporter, a->count() == b->count()); | 18 REPORTER_ASSERT(reporter, a->count() == b->count()); |
19 for (int i = 0; i < a->count(); ++i) { | 19 for (int i = 0; i < a->count(); ++i) { |
20 size_t sizea, sizeb; | 20 size_t sizea, sizeb; |
21 const void* mema = a->at(i, &sizea); | 21 const void* mema = a->at(i, &sizea); |
22 const void* memb = b->at(i, &sizeb); | 22 const void* memb = b->at(i, &sizeb); |
23 REPORTER_ASSERT(reporter, sizea == sizeb); | 23 REPORTER_ASSERT(reporter, sizea == sizeb); |
24 REPORTER_ASSERT(reporter, !memcmp(mema, memb, sizea)); | 24 REPORTER_ASSERT(reporter, !memcmp(mema, memb, sizea)); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 SkData* tmp = SkData::NewSubset(r1, strlen(str), 10); | 225 SkData* tmp = SkData::NewSubset(r1, strlen(str), 10); |
226 assert_len(reporter, tmp, 0); | 226 assert_len(reporter, tmp, 0); |
227 tmp->unref(); | 227 tmp->unref(); |
228 tmp = SkData::NewSubset(r1, 0, 0); | 228 tmp = SkData::NewSubset(r1, 0, 0); |
229 assert_len(reporter, tmp, 0); | 229 assert_len(reporter, tmp, 0); |
230 tmp->unref(); | 230 tmp->unref(); |
231 | 231 |
232 test_cstring(reporter); | 232 test_cstring(reporter); |
233 test_files(reporter); | 233 test_files(reporter); |
234 } | 234 } |
OLD | NEW |