Lines Matching refs:reporter

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