OLD | NEW |
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 #include "SkMatrix.h" | 8 #include "SkMatrix.h" |
9 #include "SkRandom.h" | 9 #include "SkRandom.h" |
10 #include "SkString.h" | 10 #include "SkString.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 // Do this with different starting sizes to have different alignment bet
ween blocks and pops. | 33 // Do this with different starting sizes to have different alignment bet
ween blocks and pops. |
34 // pops. We want to test poping the first guy off, guys in the middle of
the block, and the | 34 // pops. We want to test poping the first guy off, guys in the middle of
the block, and the |
35 // first guy on a non-head block. | 35 // first guy on a non-head block. |
36 for (int j = 0; j < 8; ++j) { | 36 for (int j = 0; j < 8; ++j) { |
37 GrTRecorder<IntWrapper, int> recorder(j); | 37 GrTRecorder<IntWrapper, int> recorder(j); |
38 | 38 |
39 REPORTER_ASSERT(reporter, recorder.empty()); | 39 REPORTER_ASSERT(reporter, recorder.empty()); |
40 | 40 |
41 for (int i = 0; i < 100; ++i) { | 41 for (int i = 0; i < 100; ++i) { |
42 if (data) { | 42 if (data) { |
43 REPORTER_ASSERT(reporter, i == *GrNEW_APPEND_TO_RECORDER(rec
order, | 43 REPORTER_ASSERT(reporter, i == *GrNEW_APPEND_TO_RECORDER(rec
order, |
44 Int
Wrapper, (i))); | 44 Int
Wrapper, (i))); |
45 } else { | 45 } else { |
46 REPORTER_ASSERT(reporter, i == | 46 REPORTER_ASSERT(reporter, i == |
47 *GrNEW_APPEND_WITH_DATA_TO_RECORDER(recorder
, | 47 *GrNEW_APPEND_WITH_DATA_TO_RECORDER(recorder
, |
48 IntWrapp
er, (i), | 48 IntWrapp
er, (i), |
49 rand.nex
tULessThan(10))); | 49 rand.nex
tULessThan(10))); |
50 } | 50 } |
51 REPORTER_ASSERT(reporter, !recorder.empty()); | 51 REPORTER_ASSERT(reporter, !recorder.empty()); |
52 REPORTER_ASSERT(reporter, i == recorder.back()); | 52 REPORTER_ASSERT(reporter, i == recorder.back()); |
53 if (0 == (i % 7)) { | 53 if (0 == (i % 7)) { |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 test_empty_back_and_pop(reporter); | 287 test_empty_back_and_pop(reporter); |
288 | 288 |
289 test_extra_data(reporter); | 289 test_extra_data(reporter); |
290 REPORTER_ASSERT(reporter, 0 == activeRecorderItems); // test_extra_data shou
ld call reset(). | 290 REPORTER_ASSERT(reporter, 0 == activeRecorderItems); // test_extra_data shou
ld call reset(). |
291 | 291 |
292 test_subclasses(reporter); | 292 test_subclasses(reporter); |
293 REPORTER_ASSERT(reporter, 0 == activeRecorderItems); // Ensure ~GrTRecorder
invokes dtors. | 293 REPORTER_ASSERT(reporter, 0 == activeRecorderItems); // Ensure ~GrTRecorder
invokes dtors. |
294 } | 294 } |
295 | 295 |
296 #endif | 296 #endif |
OLD | NEW |