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

Side by Side Diff: tests/GrTRecorderTest.cpp

Issue 694703005: When running DM, write test failures to json. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use "" instead of NULL Created 6 years, 1 month 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 | « dm/DMTestTask.h ('k') | tests/Test.h » ('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 2014 Google Inc. 2 * Copyright 2014 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 #if SK_SUPPORT_GPU 8 #if SK_SUPPORT_GPU
9 9
10 #include "SkMatrix.h" 10 #include "SkMatrix.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 case kSubclassExtraData_ClassType: 208 case kSubclassExtraData_ClassType:
209 GrNEW_APPEND_WITH_DATA_TO_RECORDER(recorder, SubclassExtraData, (i), sizeof(int) * i); 209 GrNEW_APPEND_WITH_DATA_TO_RECORDER(recorder, SubclassExtraData, (i), sizeof(int) * i);
210 break; 210 break;
211 211
212 case kSubclassEmpty_ClassType: 212 case kSubclassEmpty_ClassType:
213 GrNEW_APPEND_TO_RECORDER(recorder, SubclassEmpty, ()); 213 GrNEW_APPEND_TO_RECORDER(recorder, SubclassEmpty, ());
214 break; 214 break;
215 215
216 default: 216 default:
217 reporter->reportFailed(SkString("Invalid class type")); 217 ERRORF(reporter, "Invalid class type");
218 break; 218 break;
219 } 219 }
220 } 220 }
221 REPORTER_ASSERT(reporter, 1000 == activeRecorderItems); 221 REPORTER_ASSERT(reporter, 1000 == activeRecorderItems);
222 222
223 order.reset(); 223 order.reset();
224 Base::Recorder::Iter iter(recorder); 224 Base::Recorder::Iter iter(recorder);
225 for (int i = 0; i < 1000; ++i) { 225 for (int i = 0; i < 1000; ++i) {
226 REPORTER_ASSERT(reporter, iter.next()); 226 REPORTER_ASSERT(reporter, iter.next());
227 REPORTER_ASSERT(reporter, order.next() == iter->getType()); 227 REPORTER_ASSERT(reporter, order.next() == iter->getType());
228 iter->validate(reporter); 228 iter->validate(reporter);
229 } 229 }
230 REPORTER_ASSERT(reporter, !iter.next()); 230 REPORTER_ASSERT(reporter, !iter.next());
231 231
232 // Don't reset the recorder. It should automatically destruct all its items. 232 // Don't reset the recorder. It should automatically destruct all its items.
233 } 233 }
234 234
235 DEF_GPUTEST(GrTRecorder, reporter, factory) { 235 DEF_GPUTEST(GrTRecorder, reporter, factory) {
236 test_empty_back(reporter); 236 test_empty_back(reporter);
237 237
238 test_extra_data(reporter); 238 test_extra_data(reporter);
239 REPORTER_ASSERT(reporter, 0 == activeRecorderItems); // test_extra_data shou ld call reset(). 239 REPORTER_ASSERT(reporter, 0 == activeRecorderItems); // test_extra_data shou ld call reset().
240 240
241 test_subclasses(reporter); 241 test_subclasses(reporter);
242 REPORTER_ASSERT(reporter, 0 == activeRecorderItems); // Ensure ~GrTRecorder invokes dtors. 242 REPORTER_ASSERT(reporter, 0 == activeRecorderItems); // Ensure ~GrTRecorder invokes dtors.
243 } 243 }
244 244
245 #endif 245 #endif
OLDNEW
« no previous file with comments | « dm/DMTestTask.h ('k') | tests/Test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698