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

Side by Side Diff: tests/WArrayTest.cpp

Issue 23621005: Replace SkTScopedPtr with SkAutoTDelete in Skia. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: port class comment Created 7 years, 3 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 | « src/pdf/SkPDFDevice.cpp ('k') | no next file » | 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 9
10 // Include the implementation so we can make an appropriate template instance. 10 // Include the implementation so we can make an appropriate template instance.
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 static bool getAdvance(void* tc, int gId, int16_t* advance) { 158 static bool getAdvance(void* tc, int gId, int16_t* advance) {
159 TestWData* testCase = (TestWData*)tc; 159 TestWData* testCase = (TestWData*)tc;
160 if (gId >= 0 && gId < testCase->fAdvancesLen) { 160 if (gId >= 0 && gId < testCase->fAdvancesLen) {
161 *advance = testCase->fAdvances[gId]; 161 *advance = testCase->fAdvances[gId];
162 return true; 162 return true;
163 } 163 }
164 return false; 164 return false;
165 } 165 }
166 166
167 bool RunTest() { 167 bool RunTest() {
168 SkTScopedPtr<SkAdvancedTypefaceMetrics::AdvanceMetric<int16_t> > result; 168 SkAutoTDelete<SkAdvancedTypefaceMetrics::AdvanceMetric<int16_t> > result ;
169 result.reset(getAdvanceData((void*)this, fAdvancesLen, fSubset, fSubsetL en, getAdvance)); 169 result.reset(getAdvanceData((void*)this, fAdvancesLen, fSubset, fSubsetL en, getAdvance));
170 170
171 SkString stringResult = stringify_advance_data(result.get()); 171 SkString stringResult = stringify_advance_data(result.get());
172 if (!stringResult.equals(fExpected)) { 172 if (!stringResult.equals(fExpected)) {
173 printf("Expected: %s\n Result: %s\n", fExpected, stringResult.c_str ()); 173 printf("Expected: %s\n Result: %s\n", fExpected, stringResult.c_str ());
174 return false; 174 return false;
175 } 175 }
176 return true; 176 return true;
177 } 177 }
178 }; 178 };
(...skipping 26 matching lines...) Expand all
205 TestWData(reporter, data13, SK_ARRAY_COUNT(data13), NULL, 0, expected13); 205 TestWData(reporter, data13, SK_ARRAY_COUNT(data13), NULL, 0, expected13);
206 TestWData(reporter, data13, SK_ARRAY_COUNT(data13), subset13, 206 TestWData(reporter, data13, SK_ARRAY_COUNT(data13), subset13,
207 SK_ARRAY_COUNT(subset13), expectedSubset13); 207 SK_ARRAY_COUNT(subset13), expectedSubset13);
208 TestWData(reporter, data14, SK_ARRAY_COUNT(data14), NULL, 0, expected14); 208 TestWData(reporter, data14, SK_ARRAY_COUNT(data14), NULL, 0, expected14);
209 TestWData(reporter, data14, SK_ARRAY_COUNT(data14), subset14, 209 TestWData(reporter, data14, SK_ARRAY_COUNT(data14), subset14,
210 SK_ARRAY_COUNT(subset14), expectedSubset14); 210 SK_ARRAY_COUNT(subset14), expectedSubset14);
211 } 211 }
212 212
213 #include "TestClassDef.h" 213 #include "TestClassDef.h"
214 DEFINE_TESTCLASS("WArray", WArrayTest, TestWArray) 214 DEFINE_TESTCLASS("WArray", WArrayTest, TestWArray)
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698