Lines Matching refs:reporter

57                                    skiatest::Reporter* reporter) {
58 REPORTER_ASSERT(reporter, (0 == cnt) == allocator->empty());
59 REPORTER_ASSERT(reporter, cnt == allocator->count());
60 REPORTER_ASSERT(reporter, cnt == C::gInstCnt);
64 REPORTER_ASSERT(reporter, i == c.fID);
65 REPORTER_ASSERT(reporter, allocator->item(i).fID == i);
68 REPORTER_ASSERT(reporter, i == cnt);
71 REPORTER_ASSERT(reporter, cnt-1 == allocator->back().fID);
78 check_allocator_helper(allocator, cnt - popCnt, 0, reporter);
85 skiatest::Reporter* reporter) {
87 REPORTER_ASSERT(reporter, (size_t) allocator->count() == expected.size());
91 REPORTER_ASSERT(reporter, (uintptr_t) &c == (uintptr_t) expected[i]);
94 REPORTER_ASSERT(reporter, (size_t) i == expected.size());
99 REPORTER_ASSERT(reporter, (uintptr_t) &c == (uintptr_t) expected[i]);
102 REPORTER_ASSERT(reporter, (size_t) i == expected.size());
107 REPORTER_ASSERT(reporter, (uintptr_t) &c == (uintptr_t) expected[i]);
110 REPORTER_ASSERT(reporter, i == -1);
115 REPORTER_ASSERT(reporter, (uintptr_t) &c == (uintptr_t) expected[i]);
118 REPORTER_ASSERT(reporter, i == -1);
122 REPORTER_ASSERT(reporter, (uintptr_t) &allocator->item(i) == (uintptr_t) expected[i]);
123 REPORTER_ASSERT(reporter, (uintptr_t) &cAlloc->item(i) == (uintptr_t) expected[i]);
131 skiatest::Reporter* reporter) {
164 check_iterator_helper(allocator, items, reporter);
165 check_allocator_helper(allocator, cnt, popCnt, reporter);
167 check_iterator_helper(allocator, {}, reporter);
168 check_allocator_helper(allocator, 0, 0, reporter);
172 static void run_allocator_test(SkTBlockList<C, N>* allocator, skiatest::Reporter* reporter) {
173 check_allocator(allocator, 0, 0, reporter);
174 check_allocator(allocator, 1, 1, reporter);
175 check_allocator(allocator, 2, 2, reporter);
176 check_allocator(allocator, 10, 1, reporter);
177 check_allocator(allocator, 10, 5, reporter);
178 check_allocator(allocator, 10, 10, reporter);
179 check_allocator(allocator, 100, 10, reporter);
183 static void run_concat_test(skiatest::Reporter* reporter, int aCount, int bCount) {
195 REPORTER_ASSERT(reporter, listA.count() == aCount && listB.count() == bCount);
196 REPORTER_ASSERT(reporter, C::gInstCnt == aCount + bCount);
200 REPORTER_ASSERT(reporter, listA.count() == aCount + bCount);
204 REPORTER_ASSERT(reporter, listB.count() == 0); // NOLINT(bugprone-use-after-move)
205 REPORTER_ASSERT(reporter, C::gInstCnt == aCount + bCount);
210 REPORTER_ASSERT(reporter, i == item.fID);
213 REPORTER_ASSERT(reporter, i == (aCount + bCount));
217 static void run_concat_trivial_test(skiatest::Reporter* reporter, int aCount, int bCount) {
232 REPORTER_ASSERT(reporter, listA.count() == aCount && listB.count() == bCount);
235 REPORTER_ASSERT(reporter, listA.count() == aCount + bCount);
236 REPORTER_ASSERT(reporter, listB.count() == 0); // NOLINT(bugprone-use-after-move): see above
241 REPORTER_ASSERT(reporter, i == item.fID);
244 REPORTER_ASSERT(reporter, i == (aCount + bCount));
248 static void run_reserve_test(skiatest::Reporter* reporter) {
257 REPORTER_ASSERT(reporter, initialSize == TBlockListTestAccess::TotalSize(list));
261 REPORTER_ASSERT(reporter, list.count() == N); // count shouldn't change though
264 REPORTER_ASSERT(reporter, reservedSize >= initialSize + 2 * kItemsPerBlock * sizeof(C));
268 REPORTER_ASSERT(reporter, reservedSize == TBlockListTestAccess::TotalSize(list));
281 REPORTER_ASSERT(reporter, TBlockListTestAccess::ScratchBlockSize(list) >=
288 REPORTER_ASSERT(reporter, reservedSize == TBlockListTestAccess::TotalSize(list));
292 REPORTER_ASSERT(reporter, TBlockListTestAccess::ScratchBlockSize(list) >=
297 REPORTER_ASSERT(reporter, expectedInstanceCount == C::gInstCnt);
300 REPORTER_ASSERT(reporter, 0 == C::gInstCnt);
303 DEF_TEST(SkTBlockList, reporter) {
306 run_allocator_test(&a1, reporter);
309 run_allocator_test(&a2, reporter);
312 run_allocator_test(&a5, reporter);
315 run_allocator_test(&sa1, reporter);
318 run_allocator_test(&sa3, reporter);
321 run_allocator_test(&sa4, reporter);
323 run_reserve_test<1>(reporter);
324 run_reserve_test<2>(reporter);
325 run_reserve_test<3>(reporter);
326 run_reserve_test<4>(reporter);
327 run_reserve_test<5>(reporter);
329 run_concat_test<1, 1>(reporter, 10, 10);
330 run_concat_test<5, 1>(reporter, 50, 10);
331 run_concat_test<1, 5>(reporter, 10, 50);
332 run_concat_test<5, 5>(reporter, 100, 100);
334 run_concat_trivial_test<1, 1>(reporter, 10, 10);
335 run_concat_trivial_test<5, 1>(reporter, 50, 10);
336 run_concat_trivial_test<1, 5>(reporter, 10, 50);
337 run_concat_trivial_test<5, 5>(reporter, 100, 100);