Lines Matching refs:reporter

22 static void test_refCnt(skiatest::Reporter* reporter) {
31 REPORTER_ASSERT(reporter, ref->unique());
52 static void test_weakRefCnt(skiatest::Reporter* reporter) {
65 REPORTER_ASSERT(reporter, ref->unique());
66 SkDEBUGCODE(REPORTER_ASSERT(reporter, ref->getWeakCnt() == 1));
70 DEF_TEST(RefCnt, reporter) {
71 test_refCnt(reporter);
72 test_weakRefCnt(reporter);
82 #define check(reporter, ref, unref, make, kill) \
83 REPORTER_ASSERT(reporter, gRefCounter == ref); \
84 REPORTER_ASSERT(reporter, gUnrefCounter == unref); \
85 REPORTER_ASSERT(reporter, gNewCounter == make); \
86 REPORTER_ASSERT(reporter, gDeleteCounter == kill);
150 DEF_TEST(sk_sp, reporter) {
154 REPORTER_ASSERT(reporter, paint.fEffect.get() == nullptr);
155 REPORTER_ASSERT(reporter, !paint.get());
156 check(reporter, 0, 0, 0, 0);
159 check(reporter, 0, 0, 1, 0);
160 REPORTER_ASSERT(reporter, paint.fEffect.get()->fRefCnt == 1);
163 REPORTER_ASSERT(reporter, true);
165 REPORTER_ASSERT(reporter, false);
168 REPORTER_ASSERT(reporter, false);
170 REPORTER_ASSERT(reporter, true);
174 check(reporter, 0, 1, 1, 1);
177 REPORTER_ASSERT(reporter, false);
179 REPORTER_ASSERT(reporter, true);
182 REPORTER_ASSERT(reporter, true);
184 REPORTER_ASSERT(reporter, false);
188 REPORTER_ASSERT(reporter, sizeof(e) == sizeof(void*));
190 check(reporter, 0, 1, 2, 1);
192 check(reporter, 1, 1, 2, 1);
193 REPORTER_ASSERT(reporter, paint.fEffect.get()->fRefCnt == 2);
197 check(reporter, 2, 1, 2, 1);
198 REPORTER_ASSERT(reporter, paint.fEffect.get()->fRefCnt == 3);
202 check(reporter, 2, 1, 2, 1);
206 check(reporter, 2, 1, 2, 1);
211 check(reporter, 2, 4, 2, 2);
216 check(reporter, 0, 0, 0, 0);
218 REPORTER_ASSERT(reporter, !foo);
220 REPORTER_ASSERT(reporter, foo);
221 check(reporter, 0, 0, 1, 0);
223 check(reporter, 0, 1, 1, 1);
228 check(reporter, 0, 0, 1, 0);
230 check(reporter, 0, 1, 1, 1);
234 check(reporter, 0, 0, 1, 0);
236 check(reporter, 0, 0, 1, 0);
237 REPORTER_ASSERT(reporter, !baz);
239 check(reporter, 0, 1, 1, 1);
246 check(reporter, 1, 0, 1, 0);
247 REPORTER_ASSERT(reporter, bar1);
248 REPORTER_ASSERT(reporter, bar2);
249 REPORTER_ASSERT(reporter, bar1 == bar2);
250 REPORTER_ASSERT(reporter, bar2 == bar1);
251 REPORTER_ASSERT(reporter, !(bar1 != bar2));
252 REPORTER_ASSERT(reporter, !(bar2 != bar1));
255 check(reporter, 2, 0, 1, 0);
258 check(reporter, 2, 3, 1, 1);
263 check(reporter, 0, 0, 1, 0);
265 check(reporter, 1, 0, 1, 0);
267 check(reporter, 1, 1, 1, 0);
269 check(reporter, 1, 2, 1, 1);
274 REPORTER_ASSERT(reporter, empty == sk_sp<SkRefCnt>());
276 REPORTER_ASSERT(reporter, notEmpty != empty);
277 REPORTER_ASSERT(reporter, empty != notEmpty);
279 REPORTER_ASSERT(reporter, nullptr == empty);
280 REPORTER_ASSERT(reporter, empty == nullptr);
281 REPORTER_ASSERT(reporter, empty == empty);
283 REPORTER_ASSERT(reporter, nullptr <= empty);
284 REPORTER_ASSERT(reporter, empty <= nullptr);
285 REPORTER_ASSERT(reporter, empty <= empty);
287 REPORTER_ASSERT(reporter, nullptr >= empty);
288 REPORTER_ASSERT(reporter, empty >= nullptr);
289 REPORTER_ASSERT(reporter, empty >= empty);
295 REPORTER_ASSERT(reporter, a != b);
296 REPORTER_ASSERT(reporter, (a < b) != (b < a));
297 REPORTER_ASSERT(reporter, (b > a) != (a > b));
298 REPORTER_ASSERT(reporter, (a <= b) != (b <= a));
299 REPORTER_ASSERT(reporter, (b >= a) != (a >= b));
301 REPORTER_ASSERT(reporter, a == a);
302 REPORTER_ASSERT(reporter, a <= a);
303 REPORTER_ASSERT(reporter, a >= a);