| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkDeflateWStream.h" | |
| 9 #include "SkFlate.h" | 8 #include "SkFlate.h" |
| 10 #include "SkRandom.h" | 9 #include "SkRandom.h" |
| 11 #include "Test.h" | 10 #include "Test.h" |
| 12 | 11 |
| 13 #ifndef SK_NO_FLATE | 12 #ifndef SK_NO_FLATE |
| 14 | 13 |
| 15 DEF_TEST(SkDeflateWStream, r) { | 14 DEF_TEST(SkDeflateWStream, r) { |
| 16 SkRandom random(123456); | 15 SkRandom random(123456); |
| 17 for (int i = 0; i < 50; ++i) { | 16 for (int i = 0; i < 50; ++i) { |
| 18 uint32_t size = random.nextULessThan(10000); | 17 uint32_t size = random.nextULessThan(10000); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 SkDEBUGCODE(size_t rb =)decompressed->read(&c, sizeof(uint8_t)); | 66 SkDEBUGCODE(size_t rb =)decompressed->read(&c, sizeof(uint8_t)); |
| 68 SkASSERT(sizeof(uint8_t) == rb); | 67 SkASSERT(sizeof(uint8_t) == rb); |
| 69 if (buffer[i] != c) { | 68 if (buffer[i] != c) { |
| 70 ERRORF(r, "Decompression failed at byte %u.", (unsigned)i); | 69 ERRORF(r, "Decompression failed at byte %u.", (unsigned)i); |
| 71 break; | 70 break; |
| 72 } | 71 } |
| 73 } | 72 } |
| 74 } | 73 } |
| 75 } | 74 } |
| 76 #endif // SK_NO_FLATE | 75 #endif // SK_NO_FLATE |
| OLD | NEW |