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