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

Side by Side Diff: tests/FrontBufferedStreamTest.cpp

Issue 145313004: Cleanup: Sanitize the order of includes under tests/ (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: more two fixes Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « tests/FontNamesTest.cpp ('k') | tests/GLProgramsTest.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 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 "Test.h"
9 #include "SkFrontBufferedStream.h" 8 #include "SkFrontBufferedStream.h"
10 #include "SkRefCnt.h" 9 #include "SkRefCnt.h"
11 #include "SkStream.h" 10 #include "SkStream.h"
12 #include "SkTypes.h" 11 #include "SkTypes.h"
12 #include "Test.h"
13 13
14 static void test_read(skiatest::Reporter* reporter, SkStream* bufferedStream, 14 static void test_read(skiatest::Reporter* reporter, SkStream* bufferedStream,
15 const void* expectations, size_t bytesToRead) { 15 const void* expectations, size_t bytesToRead) {
16 // output for reading bufferedStream. 16 // output for reading bufferedStream.
17 SkAutoMalloc storage(bytesToRead); 17 SkAutoMalloc storage(bytesToRead);
18 18
19 size_t bytesRead = bufferedStream->read(storage.get(), bytesToRead); 19 size_t bytesRead = bufferedStream->read(storage.get(), bytesToRead);
20 REPORTER_ASSERT(reporter, bytesRead == bytesToRead || bufferedStream->isAtEn d()); 20 REPORTER_ASSERT(reporter, bytesRead == bytesToRead || bufferedStream->isAtEn d());
21 REPORTER_ASSERT(reporter, memcmp(storage.get(), expectations, bytesRead) == 0); 21 REPORTER_ASSERT(reporter, memcmp(storage.get(), expectations, bytesRead) == 0);
22 } 22 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 test_skipping(reporter, bufferSize); 149 test_skipping(reporter, bufferSize);
150 test_read_beyond_buffer(reporter, bufferSize); 150 test_read_beyond_buffer(reporter, bufferSize);
151 } 151 }
152 152
153 DEF_TEST(FrontBufferedStream, reporter) { 153 DEF_TEST(FrontBufferedStream, reporter) {
154 // Test 6 and 64, which are used by Android, as well as another arbitrary le ngth. 154 // Test 6 and 64, which are used by Android, as well as another arbitrary le ngth.
155 test_buffers(reporter, 6); 155 test_buffers(reporter, 6);
156 test_buffers(reporter, 15); 156 test_buffers(reporter, 15);
157 test_buffers(reporter, 64); 157 test_buffers(reporter, 64);
158 } 158 }
OLDNEW
« no previous file with comments | « tests/FontNamesTest.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698