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

Side by Side Diff: tests/FrontBufferedStreamTest.cpp

Issue 159333002: Use SkToBool to fix a warning. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 months 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 | « no previous file | no next file » | 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 2013 Google Inc. 2 * Copyright 2013 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 "SkFrontBufferedStream.h" 8 #include "SkFrontBufferedStream.h"
9 #include "SkRefCnt.h" 9 #include "SkRefCnt.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 private: 189 private:
190 const bool fHasLength; 190 const bool fHasLength;
191 const bool fHasPosition; 191 const bool fHasPosition;
192 }; 192 };
193 193
194 // Test all possible combinations of the wrapped stream having a length and a po sition. 194 // Test all possible combinations of the wrapped stream having a length and a po sition.
195 static void test_length_combos(skiatest::Reporter* reporter, size_t bufferSize) { 195 static void test_length_combos(skiatest::Reporter* reporter, size_t bufferSize) {
196 for (int hasLen = 0; hasLen <= 1; hasLen++) { 196 for (int hasLen = 0; hasLen <= 1; hasLen++) {
197 for (int hasPos = 0; hasPos <= 1; hasPos++) { 197 for (int hasPos = 0; hasPos <= 1; hasPos++) {
198 LengthOptionalStream stream((bool) hasLen, (bool) hasPos); 198 LengthOptionalStream stream(SkToBool(hasLen), SkToBool(hasPos));
199 SkAutoTUnref<SkStream> buffered(SkFrontBufferedStream::Create(&strea m, bufferSize)); 199 SkAutoTUnref<SkStream> buffered(SkFrontBufferedStream::Create(&strea m, bufferSize));
200 test_hasLength(reporter, *buffered.get(), stream); 200 test_hasLength(reporter, *buffered.get(), stream);
201 } 201 }
202 } 202 }
203 } 203 }
204 204
205 // Test using a stream with an initial offset. 205 // Test using a stream with an initial offset.
206 static void test_initial_offset(skiatest::Reporter* reporter, size_t bufferSize) { 206 static void test_initial_offset(skiatest::Reporter* reporter, size_t bufferSize) {
207 SkMemoryStream memStream(gAbcs, strlen(gAbcs), false); 207 SkMemoryStream memStream(gAbcs, strlen(gAbcs), false);
208 208
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 test_length_combos(reporter, bufferSize); 242 test_length_combos(reporter, bufferSize);
243 test_initial_offset(reporter, bufferSize); 243 test_initial_offset(reporter, bufferSize);
244 } 244 }
245 245
246 DEF_TEST(FrontBufferedStream, reporter) { 246 DEF_TEST(FrontBufferedStream, reporter) {
247 // Test 6 and 64, which are used by Android, as well as another arbitrary le ngth. 247 // Test 6 and 64, which are used by Android, as well as another arbitrary le ngth.
248 test_buffers(reporter, 6); 248 test_buffers(reporter, 6);
249 test_buffers(reporter, 15); 249 test_buffers(reporter, 15);
250 test_buffers(reporter, 64); 250 test_buffers(reporter, 64);
251 } 251 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698