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

Side by Side Diff: tests/DataRefTest.cpp

Issue 17414003: Refactor: clean up some unused or mostly-unused API I saw here. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: bungeman Created 7 years, 6 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 | « no previous file | tests/EmptyPathTest.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 /* 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 "SkData.h" 9 #include "SkData.h"
10 #include "SkDataSet.h" 10 #include "SkDataSet.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 } 266 }
267 267
268 SkString path = SkOSPath::SkPathJoin(tmpDir.c_str(), "data_test"); 268 SkString path = SkOSPath::SkPathJoin(tmpDir.c_str(), "data_test");
269 269
270 const char s[] = "abcdefghijklmnopqrstuvwxyz"; 270 const char s[] = "abcdefghijklmnopqrstuvwxyz";
271 { 271 {
272 SkFILEWStream writer(path.c_str()); 272 SkFILEWStream writer(path.c_str());
273 if (!writer.isValid()) { 273 if (!writer.isValid()) {
274 SkString msg; 274 SkString msg;
275 msg.printf("Failed to create tmp file %s\n", path.c_str()); 275 msg.printf("Failed to create tmp file %s\n", path.c_str());
276 reporter->reportFailed(msg.c_str()); 276 reporter->reportFailed(msg);
277 return; 277 return;
278 } 278 }
279 writer.write(s, 26); 279 writer.write(s, 26);
280 } 280 }
281 281
282 SkFILE* file = sk_fopen(path.c_str(), kRead_SkFILE_Flag); 282 SkFILE* file = sk_fopen(path.c_str(), kRead_SkFILE_Flag);
283 SkAutoTUnref<SkData> r1(SkData::NewFromFILE(file)); 283 SkAutoTUnref<SkData> r1(SkData::NewFromFILE(file));
284 REPORTER_ASSERT(reporter, r1.get() != NULL); 284 REPORTER_ASSERT(reporter, r1.get() != NULL);
285 REPORTER_ASSERT(reporter, r1->size() == 26); 285 REPORTER_ASSERT(reporter, r1->size() == 26);
286 REPORTER_ASSERT(reporter, strncmp(static_cast<const char*>(r1->data()), s, 2 6) == 0); 286 REPORTER_ASSERT(reporter, strncmp(static_cast<const char*>(r1->data()), s, 2 6) == 0);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 tmp->unref(); 318 tmp->unref();
319 319
320 test_cstring(reporter); 320 test_cstring(reporter);
321 test_dataset(reporter); 321 test_dataset(reporter);
322 test_files(reporter); 322 test_files(reporter);
323 } 323 }
324 324
325 #include "TestClassDef.h" 325 #include "TestClassDef.h"
326 DEFINE_TESTCLASS("Data", DataTestClass, TestData) 326 DEFINE_TESTCLASS("Data", DataTestClass, TestData)
327 DEFINE_TESTCLASS("DataTable", DataTableTestClass, TestDataTable) 327 DEFINE_TESTCLASS("DataTable", DataTableTestClass, TestDataTable)
OLDNEW
« no previous file with comments | « no previous file | tests/EmptyPathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698