Lines Matching refs:reporter

22 static void test_refCnt(skiatest::Reporter* reporter) {
34 REPORTER_ASSERT(reporter, ref->unique());
55 static void test_weakRefCnt(skiatest::Reporter* reporter) {
73 REPORTER_ASSERT(reporter, ref->unique());
74 SkDEBUGCODE(REPORTER_ASSERT(reporter, ref->getWeakCnt() == 1));
78 DEF_TEST(RefCnt, reporter) {
79 test_refCnt(reporter);
80 test_weakRefCnt(reporter);
90 #define check(reporter, ref, unref, make, kill) \
91 REPORTER_ASSERT(reporter, gRefCounter == ref); \
92 REPORTER_ASSERT(reporter, gUnrefCounter == unref); \
93 REPORTER_ASSERT(reporter, gNewCounter == make); \
94 REPORTER_ASSERT(reporter, gDeleteCounter == kill);
158 DEF_TEST(sk_sp, reporter) {
162 REPORTER_ASSERT(reporter, paint.fEffect.get() == nullptr);
163 REPORTER_ASSERT(reporter, !paint.get());
164 check(reporter, 0, 0, 0, 0);
167 check(reporter, 0, 0, 1, 0);
168 REPORTER_ASSERT(reporter, paint.fEffect.get()->fRefCnt == 1);
171 REPORTER_ASSERT(reporter, true);
173 REPORTER_ASSERT(reporter, false);
176 REPORTER_ASSERT(reporter, false);
178 REPORTER_ASSERT(reporter, true);
182 check(reporter, 0, 1, 1, 1);
185 REPORTER_ASSERT(reporter, false);
187 REPORTER_ASSERT(reporter, true);
190 REPORTER_ASSERT(reporter, true);
192 REPORTER_ASSERT(reporter, false);
196 REPORTER_ASSERT(reporter, sizeof(e) == sizeof(void*));
198 check(reporter, 0, 1, 2, 1);
200 check(reporter, 1, 1, 2, 1);
201 REPORTER_ASSERT(reporter, paint.fEffect.get()->fRefCnt == 2);
205 check(reporter, 2, 1, 2, 1);
206 REPORTER_ASSERT(reporter, paint.fEffect.get()->fRefCnt == 3);
210 check(reporter, 2, 1, 2, 1);
214 check(reporter, 2, 1, 2, 1);
219 check(reporter, 2, 4, 2, 2);
224 check(reporter, 0, 0, 0, 0);
226 REPORTER_ASSERT(reporter, !foo);
228 REPORTER_ASSERT(reporter, foo);
229 check(reporter, 0, 0, 1, 0);
231 check(reporter, 0, 1, 1, 1);
236 check(reporter, 0, 0, 1, 0);
238 check(reporter, 0, 1, 1, 1);
242 check(reporter, 0, 0, 1, 0);
244 check(reporter, 0, 0, 1, 0);
245 REPORTER_ASSERT(reporter, !baz);
247 check(reporter, 0, 1, 1, 1);
254 check(reporter, 1, 0, 1, 0);
255 REPORTER_ASSERT(reporter, bar1);
256 REPORTER_ASSERT(reporter, bar2);
257 REPORTER_ASSERT(reporter, bar1 == bar2);
258 REPORTER_ASSERT(reporter, bar2 == bar1);
259 REPORTER_ASSERT(reporter, !(bar1 != bar2));
260 REPORTER_ASSERT(reporter, !(bar2 != bar1));
263 check(reporter, 2, 0, 1, 0);
266 check(reporter, 2, 3, 1, 1);
271 check(reporter, 0, 0, 1, 0);
273 check(reporter, 1, 0, 1, 0);
275 check(reporter, 1, 1, 1, 0);
277 check(reporter, 1, 2, 1, 1);
282 REPORTER_ASSERT(reporter, empty == sk_sp<SkRefCnt>());
284 REPORTER_ASSERT(reporter, notEmpty != empty);
285 REPORTER_ASSERT(reporter, empty != notEmpty);
287 REPORTER_ASSERT(reporter, nullptr == empty);
288 REPORTER_ASSERT(reporter, empty == nullptr);
289 REPORTER_ASSERT(reporter, empty == empty);
291 REPORTER_ASSERT(reporter, nullptr <= empty);
292 REPORTER_ASSERT(reporter, empty <= nullptr);
293 REPORTER_ASSERT(reporter, empty <= empty);
295 REPORTER_ASSERT(reporter, nullptr >= empty);
296 REPORTER_ASSERT(reporter, empty >= nullptr);
297 REPORTER_ASSERT(reporter, empty >= empty);
303 REPORTER_ASSERT(reporter, a != b);
304 REPORTER_ASSERT(reporter, (a < b) != (b < a));
305 REPORTER_ASSERT(reporter, (b > a) != (a > b));
306 REPORTER_ASSERT(reporter, (a <= b) != (b <= a));
307 REPORTER_ASSERT(reporter, (b >= a) != (a >= b));
309 REPORTER_ASSERT(reporter, a == a);
310 REPORTER_ASSERT(reporter, a <= a);
311 REPORTER_ASSERT(reporter, a >= a);