Lines Matching refs:Reporter
15 static void TestTSet_basic(skiatest::Reporter* reporter) {
19 REPORTER_ASSERT(reporter, a.empty());
20 REPORTER_ASSERT(reporter, a.count() == 0);
24 REPORTER_ASSERT(reporter, !a.empty());
25 REPORTER_ASSERT(reporter, a.count() == 1);
29 REPORTER_ASSERT(reporter, a.empty());
30 REPORTER_ASSERT(reporter, a.count() == 0);
34 REPORTER_ASSERT(reporter, a.push_back() = 1);
36 REPORTER_ASSERT(reporter, !a.empty());
37 REPORTER_ASSERT(reporter, a.count() == 1);
38 REPORTER_ASSERT(reporter, a[0] == 1);
43 REPORTER_ASSERT(reporter, a.count() == SK_ARRAY_COUNT(b));
44 REPORTER_ASSERT(reporter, a[2] == 2);
45 REPORTER_ASSERT(reporter, a[4] == 4);
49 REPORTER_ASSERT(reporter, a.count() == SK_ARRAY_COUNT(b) - 1);
50 REPORTER_ASSERT(reporter, a[3] == 3);
54 REPORTER_ASSERT(reporter, a.count() == SK_ARRAY_COUNT(b) - 2);
55 REPORTER_ASSERT(reporter, a[0] == 0);
56 REPORTER_ASSERT(reporter, a[1] == 3);
57 REPORTER_ASSERT(reporter, a[2] == 2);
62 template <typename T> static void test_swap(skiatest::Reporter* reporter,
82 REPORTER_ASSERT(reporter, b->count() == sizeA);
83 REPORTER_ASSERT(reporter, a->count() == sizeB);
86 for (auto&& x : *b) { REPORTER_ASSERT(reporter, x == curr++); }
87 for (auto&& x : *a) { REPORTER_ASSERT(reporter, x == curr++); }
91 for (auto&& x : *a) { REPORTER_ASSERT(reporter, x == curr++); }
96 static void test_swap(skiatest::Reporter* reporter) {
104 test_swap(reporter, arrays, sizes);
118 test_swap(reporter, arraysMoi, sizes);
122 void test_copy_ctor(skiatest::Reporter* reporter, SkTArray<T, MEM_MOVE>&& array) {
126 REPORTER_ASSERT(reporter, array.back()->unique());
132 REPORTER_ASSERT(reporter, !ref->unique());
134 REPORTER_ASSERT(reporter, !ref->unique());
138 REPORTER_ASSERT(reporter, ref->unique());
141 static void test_move(skiatest::Reporter* reporter) {
148 REPORTER_ASSERT(reporter, !copy[0]->unique()); \
153 REPORTER_ASSERT(reporter, move[0]->unique()); \
155 REPORTER_ASSERT(reporter, src.empty()); \
161 REPORTER_ASSERT(reporter, !copy[0]->unique()); \
167 REPORTER_ASSERT(reporter, move[0]->unique()); \
169 REPORTER_ASSERT(reporter, src.empty()); \
226 void test_unnecessary_alloc(skiatest::Reporter* reporter) {
229 REPORTER_ASSERT(reporter, a.allocCntForTest() == 0);
233 REPORTER_ASSERT(reporter, a.allocCntForTest() == 10);
237 REPORTER_ASSERT(reporter, a.allocCntForTest() >= 1);
242 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0);
248 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0);
253 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0);
258 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0);
263 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0);
268 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0);
274 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0);
280 REPORTER_ASSERT(reporter, b.allocCntForTest() == 0);
284 static void test_self_assignment(skiatest::Reporter* reporter) {
287 REPORTER_ASSERT(reporter, !a.empty());
288 REPORTER_ASSERT(reporter, a.count() == 1);
289 REPORTER_ASSERT(reporter, a[0] == 1);
292 REPORTER_ASSERT(reporter, !a.empty());
293 REPORTER_ASSERT(reporter, a.count() == 1);
294 REPORTER_ASSERT(reporter, a[0] == 1);
297 DEF_TEST(TArray, reporter) {
298 TestTSet_basic<true>(reporter);
299 TestTSet_basic<false>(reporter);
300 test_swap(reporter);
302 test_copy_ctor(reporter, SkTArray<sk_sp<SkRefCnt>, false>());
303 test_copy_ctor(reporter, SkTArray<sk_sp<SkRefCnt>, true>());
304 test_copy_ctor(reporter, SkSTArray< 1, sk_sp<SkRefCnt>, false>());
305 test_copy_ctor(reporter, SkSTArray< 1, sk_sp<SkRefCnt>, true>());
306 test_copy_ctor(reporter, SkSTArray<10, sk_sp<SkRefCnt>, false>());
307 test_copy_ctor(reporter, SkSTArray<10, sk_sp<SkRefCnt>, true>());
309 test_move(reporter);
311 test_unnecessary_alloc(reporter);
313 test_self_assignment(reporter);