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

Side by Side Diff: tests/StreamTest.cpp

Issue 132843002: Add REPORTF test macro. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: factor 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') | tests/Test.h » ('J')
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 REPORTF(reporter,
49 msg.printf("Failed to create tmp file %s\n", path.c_str()); 49 ("Failed to create tmp file %s\n", path.c_str()));
50 reporter->reportFailed(msg);
51 return; 50 return;
52 } 51 }
53 52
54 for (int i = 0; i < 100; ++i) { 53 for (int i = 0; i < 100; ++i) {
55 writer.write(s, 26); 54 writer.write(s, 26);
56 } 55 }
57 } 56 }
58 57
59 { 58 {
60 SkFILEStream stream(path.c_str()); 59 SkFILEStream stream(path.c_str());
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 memStream.setData(nullData); 185 memStream.setData(nullData);
187 TestDereferencingData(&memStream); 186 TestDereferencingData(&memStream);
188 187
189 } 188 }
190 189
191 DEF_TEST(Stream, reporter) { 190 DEF_TEST(Stream, reporter) {
192 TestWStream(reporter); 191 TestWStream(reporter);
193 TestPackedUInt(reporter); 192 TestPackedUInt(reporter);
194 TestNullData(); 193 TestNullData();
195 } 194 }
OLDNEW
« no previous file with comments | « tests/SortTest.cpp ('k') | tests/Test.h » ('j') | tests/Test.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698