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 <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
11 #include "Test.h" | 11 #include "Test.h" |
12 #include "TestClassDef.h" | |
13 #include "SkData.h" | 12 #include "SkData.h" |
14 #include "SkFlate.h" | 13 #include "SkFlate.h" |
15 #include "SkStream.h" | 14 #include "SkStream.h" |
16 | 15 |
17 // A memory stream that reports zero size with the standard call, like | 16 // A memory stream that reports zero size with the standard call, like |
18 // an unseekable file stream would. | 17 // an unseekable file stream would. |
19 class SkZeroSizeMemStream : public SkMemoryStream { | 18 class SkZeroSizeMemStream : public SkMemoryStream { |
20 public: | 19 public: |
21 virtual size_t read(void* buffer, size_t size) { | 20 virtual size_t read(void* buffer, size_t size) { |
22 if (buffer == NULL && size == 0) | 21 if (buffer == NULL && size == 0) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 90 |
92 SkMemoryStream memStream; | 91 SkMemoryStream memStream; |
93 TestFlate(reporter, &memStream, 512); | 92 TestFlate(reporter, &memStream, 512); |
94 TestFlate(reporter, &memStream, 10240); | 93 TestFlate(reporter, &memStream, 10240); |
95 | 94 |
96 SkZeroSizeMemStream fileStream; | 95 SkZeroSizeMemStream fileStream; |
97 TestFlate(reporter, &fileStream, 512); | 96 TestFlate(reporter, &fileStream, 512); |
98 TestFlate(reporter, &fileStream, 10240); | 97 TestFlate(reporter, &fileStream, 10240); |
99 #endif | 98 #endif |
100 } | 99 } |
OLD | NEW |