Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: tests/FlateTest.cpp

Issue 805543002: DM warning-free on win64 (Closed) Base URL: https://skia.googlesource.com/skia.git@w64
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pdf/SkPDFPage.cpp ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "SkData.h" 8 #include "SkData.h"
9 #include "SkFlate.h" 9 #include "SkFlate.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 24
25 static const size_t kGetSizeKey = 0xDEADBEEF; 25 static const size_t kGetSizeKey = 0xDEADBEEF;
26 }; 26 };
27 27
28 // Returns a deterministic data of the given size that should be 28 // Returns a deterministic data of the given size that should be
29 // very compressible. 29 // very compressible.
30 static SkData* new_test_data(size_t dataSize) { 30 static SkData* new_test_data(size_t dataSize) {
31 SkAutoTMalloc<uint8_t> testBuffer(dataSize); 31 SkAutoTMalloc<uint8_t> testBuffer(dataSize);
32 for (size_t i = 0; i < dataSize; ++i) { 32 for (size_t i = 0; i < dataSize; ++i) {
33 testBuffer[i] = i % 64; 33 testBuffer[SkToInt(i)] = i % 64;
34 } 34 }
35 return SkData::NewFromMalloc(testBuffer.detach(), dataSize); 35 return SkData::NewFromMalloc(testBuffer.detach(), dataSize);
36 } 36 }
37 37
38 static void TestFlate(skiatest::Reporter* reporter, SkMemoryStream* testStream, 38 static void TestFlate(skiatest::Reporter* reporter, SkMemoryStream* testStream,
39 size_t dataSize) { 39 size_t dataSize) {
40 SkASSERT(testStream != NULL); 40 SkASSERT(testStream != NULL);
41 41
42 SkAutoDataUnref testData(new_test_data(dataSize)); 42 SkAutoDataUnref testData(new_test_data(dataSize));
43 SkASSERT(testData->size() == dataSize); 43 SkASSERT(testData->size() == dataSize);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 if (SkFlate::HaveFlate()) { 110 if (SkFlate::HaveFlate()) {
111 SkMemoryStream memStream; 111 SkMemoryStream memStream;
112 TestFlate(reporter, &memStream, 512); 112 TestFlate(reporter, &memStream, 512);
113 TestFlate(reporter, &memStream, 10240); 113 TestFlate(reporter, &memStream, 10240);
114 114
115 SkZeroSizeMemStream fileStream; 115 SkZeroSizeMemStream fileStream;
116 TestFlate(reporter, &fileStream, 512); 116 TestFlate(reporter, &fileStream, 512);
117 TestFlate(reporter, &fileStream, 10240); 117 TestFlate(reporter, &fileStream, 10240);
118 } 118 }
119 } 119 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFPage.cpp ('k') | tests/PDFPrimitivesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698