OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "Test.h" | 8 #include "Test.h" |
9 #include "SkRandom.h" | 9 #include "SkRandom.h" |
10 #include "SkOSFile.h" | 10 #include "SkOSFile.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 static void test_filestreams(skiatest::Reporter* reporter, const char* tmpDir) { | 37 static void test_filestreams(skiatest::Reporter* reporter, const char* tmpDir) { |
38 SkString path = SkOSPath::SkPathJoin(tmpDir, "wstream_test"); | 38 SkString path = SkOSPath::SkPathJoin(tmpDir, "wstream_test"); |
39 | 39 |
40 const char s[] = "abcdefghijklmnopqrstuvwxyz"; | 40 const char s[] = "abcdefghijklmnopqrstuvwxyz"; |
41 | 41 |
42 { | 42 { |
43 SkFILEWStream writer(path.c_str()); | 43 SkFILEWStream writer(path.c_str()); |
44 if (!writer.isValid()) { | 44 if (!writer.isValid()) { |
45 SkString msg; | 45 SkString msg; |
46 msg.printf("Failed to create tmp file %s\n", path.c_str()); | 46 msg.printf("Failed to create tmp file %s\n", path.c_str()); |
47 reporter->reportFailed(msg.c_str()); | 47 reporter->reportFailed(msg); |
48 return; | 48 return; |
49 } | 49 } |
50 | 50 |
51 for (int i = 0; i < 100; ++i) { | 51 for (int i = 0; i < 100; ++i) { |
52 writer.write(s, 26); | 52 writer.write(s, 26); |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 { | 56 { |
57 SkFILEStream stream(path.c_str()); | 57 SkFILEStream stream(path.c_str()); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 } | 153 } |
154 | 154 |
155 static void TestStreams(skiatest::Reporter* reporter) { | 155 static void TestStreams(skiatest::Reporter* reporter) { |
156 TestWStream(reporter); | 156 TestWStream(reporter); |
157 TestPackedUInt(reporter); | 157 TestPackedUInt(reporter); |
158 TestNullData(); | 158 TestNullData(); |
159 } | 159 } |
160 | 160 |
161 #include "TestClassDef.h" | 161 #include "TestClassDef.h" |
162 DEFINE_TESTCLASS("Stream", StreamTestClass, TestStreams) | 162 DEFINE_TESTCLASS("Stream", StreamTestClass, TestStreams) |
OLD | NEW |