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

Side by Side Diff: tests/StreamTest.cpp

Issue 830513004: Simplify skiatest framework. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Another Patch Set Created 5 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
« no previous file with comments | « tests/MetaDataTest.cpp ('k') | tests/Test.h » ('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 "SkOSFile.h" 9 #include "SkOSFile.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // Test that this works after a copyToData. 123 // Test that this works after a copyToData.
124 SkAutoTUnref<SkStreamAsset> stream(ds.detachAsStream()); 124 SkAutoTUnref<SkStreamAsset> stream(ds.detachAsStream());
125 REPORTER_ASSERT(reporter, ds.getOffset() == 0); 125 REPORTER_ASSERT(reporter, ds.getOffset() == 0);
126 test_loop_stream(reporter, stream.get(), s, 26, 100); 126 test_loop_stream(reporter, stream.get(), s, 26, 100);
127 127
128 SkAutoTUnref<SkStreamAsset> stream2(stream->duplicate()); 128 SkAutoTUnref<SkStreamAsset> stream2(stream->duplicate());
129 test_loop_stream(reporter, stream2.get(), s, 26, 100); 129 test_loop_stream(reporter, stream2.get(), s, 26, 100);
130 } 130 }
131 delete[] dst; 131 delete[] dst;
132 132
133 SkString tmpDir = skiatest::Test::GetTmpDir(); 133 SkString tmpDir = skiatest::GetTmpDir();
134 if (!tmpDir.isEmpty()) { 134 if (!tmpDir.isEmpty()) {
135 test_filestreams(reporter, tmpDir.c_str()); 135 test_filestreams(reporter, tmpDir.c_str());
136 } 136 }
137 } 137 }
138 138
139 static void TestPackedUInt(skiatest::Reporter* reporter) { 139 static void TestPackedUInt(skiatest::Reporter* reporter) {
140 // we know that packeduint tries to write 1, 2 or 4 bytes for the length, 140 // we know that packeduint tries to write 1, 2 or 4 bytes for the length,
141 // so we test values around each of those transitions (and a few others) 141 // so we test values around each of those transitions (and a few others)
142 const size_t sizes[] = { 142 const size_t sizes[] = {
143 0, 1, 2, 0xFC, 0xFD, 0xFE, 0xFF, 0x100, 0x101, 32767, 32768, 32769, 143 0, 1, 2, 0xFC, 0xFD, 0xFE, 0xFF, 0x100, 0x101, 32767, 32768, 32769,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 memStream.setData(nullData); 183 memStream.setData(nullData);
184 TestDereferencingData(&memStream); 184 TestDereferencingData(&memStream);
185 185
186 } 186 }
187 187
188 DEF_TEST(Stream, reporter) { 188 DEF_TEST(Stream, reporter) {
189 TestWStream(reporter); 189 TestWStream(reporter);
190 TestPackedUInt(reporter); 190 TestPackedUInt(reporter);
191 TestNullData(); 191 TestNullData();
192 } 192 }
OLDNEW
« no previous file with comments | « tests/MetaDataTest.cpp ('k') | tests/Test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698