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

Side by Side Diff: tests/DataRefTest.cpp

Issue 428443002: Cleanup: Rename SkOSPath functions. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix Created 6 years, 4 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 | « src/utils/SkOSFile.cpp ('k') | tests/DocumentTest.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 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 "SkDataTable.h" 9 #include "SkDataTable.h"
10 #include "SkOSFile.h" 10 #include "SkOSFile.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 REPORTER_ASSERT(reporter, 1 == r2->size()); 172 REPORTER_ASSERT(reporter, 1 == r2->size());
173 REPORTER_ASSERT(reporter, 0 == *r2->bytes()); 173 REPORTER_ASSERT(reporter, 0 == *r2->bytes());
174 } 174 }
175 175
176 static void test_files(skiatest::Reporter* reporter) { 176 static void test_files(skiatest::Reporter* reporter) {
177 SkString tmpDir = skiatest::Test::GetTmpDir(); 177 SkString tmpDir = skiatest::Test::GetTmpDir();
178 if (tmpDir.isEmpty()) { 178 if (tmpDir.isEmpty()) {
179 return; 179 return;
180 } 180 }
181 181
182 SkString path = SkOSPath::SkPathJoin(tmpDir.c_str(), "data_test"); 182 SkString path = SkOSPath::Join(tmpDir.c_str(), "data_test");
183 183
184 const char s[] = "abcdefghijklmnopqrstuvwxyz"; 184 const char s[] = "abcdefghijklmnopqrstuvwxyz";
185 { 185 {
186 SkFILEWStream writer(path.c_str()); 186 SkFILEWStream writer(path.c_str());
187 if (!writer.isValid()) { 187 if (!writer.isValid()) {
188 ERRORF(reporter, "Failed to create tmp file %s\n", path.c_str()); 188 ERRORF(reporter, "Failed to create tmp file %s\n", path.c_str());
189 return; 189 return;
190 } 190 }
191 writer.write(s, 26); 191 writer.write(s, 26);
192 } 192 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 SkData* tmp = SkData::NewSubset(r1, strlen(str), 10); 225 SkData* tmp = SkData::NewSubset(r1, strlen(str), 10);
226 assert_len(reporter, tmp, 0); 226 assert_len(reporter, tmp, 0);
227 tmp->unref(); 227 tmp->unref();
228 tmp = SkData::NewSubset(r1, 0, 0); 228 tmp = SkData::NewSubset(r1, 0, 0);
229 assert_len(reporter, tmp, 0); 229 assert_len(reporter, tmp, 0);
230 tmp->unref(); 230 tmp->unref();
231 231
232 test_cstring(reporter); 232 test_cstring(reporter);
233 test_files(reporter); 233 test_files(reporter);
234 } 234 }
OLDNEW
« no previous file with comments | « src/utils/SkOSFile.cpp ('k') | tests/DocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698