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

Side by Side Diff: tests/StreamTest.cpp

Issue 132843002: Add REPORTF test macro. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: final rebase 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/SortTest.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 "Test.h" 8 #include "Test.h"
9 #include "TestClassDef.h" 9 #include "TestClassDef.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 27 matching lines...) Expand all
38 } 38 }
39 39
40 static void test_filestreams(skiatest::Reporter* reporter, const char* tmpDir) { 40 static void test_filestreams(skiatest::Reporter* reporter, const char* tmpDir) {
41 SkString path = SkOSPath::SkPathJoin(tmpDir, "wstream_test"); 41 SkString path = SkOSPath::SkPathJoin(tmpDir, "wstream_test");
42 42
43 const char s[] = "abcdefghijklmnopqrstuvwxyz"; 43 const char s[] = "abcdefghijklmnopqrstuvwxyz";
44 44
45 { 45 {
46 SkFILEWStream writer(path.c_str()); 46 SkFILEWStream writer(path.c_str());
47 if (!writer.isValid()) { 47 if (!writer.isValid()) {
48 SkString msg; 48 ERRORF(reporter, "Failed to create tmp file %s\n", path.c_str());
49 msg.printf("Failed to create tmp file %s\n", path.c_str());
50 reporter->reportFailed(msg);
51 return; 49 return;
52 } 50 }
53 51
54 for (int i = 0; i < 100; ++i) { 52 for (int i = 0; i < 100; ++i) {
55 writer.write(s, 26); 53 writer.write(s, 26);
56 } 54 }
57 } 55 }
58 56
59 { 57 {
60 SkFILEStream stream(path.c_str()); 58 SkFILEStream stream(path.c_str());
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 memStream.setData(nullData); 184 memStream.setData(nullData);
187 TestDereferencingData(&memStream); 185 TestDereferencingData(&memStream);
188 186
189 } 187 }
190 188
191 DEF_TEST(Stream, reporter) { 189 DEF_TEST(Stream, reporter) {
192 TestWStream(reporter); 190 TestWStream(reporter);
193 TestPackedUInt(reporter); 191 TestPackedUInt(reporter);
194 TestNullData(); 192 TestNullData();
195 } 193 }
OLDNEW
« no previous file with comments | « tests/SortTest.cpp ('k') | tests/Test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698