OLD | NEW |
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 } | 163 } |
164 return false; | 164 return false; |
165 } | 165 } |
166 | 166 |
167 bool RunTest() { | 167 bool RunTest() { |
168 SkAutoTDelete<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 SkDebugf("Expected: %s\n Result: %s\n", fExpected, stringResult.c_s
tr()); |
174 return false; | 174 return false; |
175 } | 175 } |
176 return true; | 176 return true; |
177 } | 177 } |
178 }; | 178 }; |
179 | 179 |
180 static void TestWArray(skiatest::Reporter* reporter) { | 180 static void TestWArray(skiatest::Reporter* reporter) { |
181 TestWData(reporter, data1, SK_ARRAY_COUNT(data1), NULL, 0, expected1); | 181 TestWData(reporter, data1, SK_ARRAY_COUNT(data1), NULL, 0, expected1); |
182 TestWData(reporter, data2, SK_ARRAY_COUNT(data2), NULL, 0, expected2); | 182 TestWData(reporter, data2, SK_ARRAY_COUNT(data2), NULL, 0, expected2); |
183 TestWData(reporter, data3, SK_ARRAY_COUNT(data3), NULL, 0, expected3); | 183 TestWData(reporter, data3, SK_ARRAY_COUNT(data3), NULL, 0, expected3); |
(...skipping 21 matching lines...) Expand all Loading... |
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) |
OLD | NEW |