Home | History | Annotate | Download | only in tests

Lines Matching refs:Reporter

16 static void test_inset(skiatest::Reporter* reporter) {
22 REPORTER_ASSERT(reporter, rr2.isRect());
25 REPORTER_ASSERT(reporter, rr2.isRect());
28 REPORTER_ASSERT(reporter, rr2.isEmpty());
32 REPORTER_ASSERT(reporter, rr2.isSimple());
34 REPORTER_ASSERT(reporter, rr2.isRect());
38 static void test_round_rect_basic(skiatest::Reporter* reporter) {
45 REPORTER_ASSERT(reporter, SkRRect::kEmpty_Type == empty.type());
46 REPORTER_ASSERT(reporter, empty.rect().isEmpty());
49 REPORTER_ASSERT(reporter, zeroPt == empty.radii((SkRRect::Corner) i));
58 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr1.type());
59 REPORTER_ASSERT(reporter, rr1.rect() == rect);
62 REPORTER_ASSERT(reporter, zeroPt == rr1.radii((SkRRect::Corner) i));
70 REPORTER_ASSERT(reporter, SkRRect::kOval_Type == rr2.type());
71 REPORTER_ASSERT(reporter, rr2.rect() == rect);
74 REPORTER_ASSERT(reporter,
83 REPORTER_ASSERT(reporter, SkRRect::kSimple_Type == rr3.type());
84 REPORTER_ASSERT(reporter, rr3.rect() == rect);
87 REPORTER_ASSERT(reporter, p == rr3.radii((SkRRect::Corner) i));
96 REPORTER_ASSERT(reporter, SkRRect::kSimple_Type == rr4.type());
97 REPORTER_ASSERT(reporter, rr4.rect() == rect);
100 REPORTER_ASSERT(reporter, radii[i] == rr4.radii((SkRRect::Corner) i));
109 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr5.type());
110 REPORTER_ASSERT(reporter, rr5.rect() == rect);
113 REPORTER_ASSERT(reporter, radii2[i] == rr5.radii((SkRRect::Corner) i));
117 REPORTER_ASSERT(reporter, empty != rr3);
118 REPORTER_ASSERT(reporter, rr3 == rr4);
119 REPORTER_ASSERT(reporter, rr4 != rr5);
123 static void test_round_rect_rects(skiatest::Reporter* reporter) {
131 REPORTER_ASSERT(reporter, SkRRect::kEmpty_Type == empty.type());
133 REPORTER_ASSERT(reporter, 0 == r.fLeft && 0 == r.fTop && 0 == r.fRight && 0 == r.fBottom);
140 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr1.type());
142 REPORTER_ASSERT(reporter, rect == r);
150 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr2.type());
152 REPORTER_ASSERT(reporter, rect == r);
159 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr3.type());
163 static void test_round_rect_ovals(skiatest::Reporter* reporter) {
170 REPORTER_ASSERT(reporter, SkRRect::kOval_Type == rr1.type());
172 REPORTER_ASSERT(reporter, oval == rect);
176 static void test_round_rect_general(skiatest::Reporter* reporter) {
182 REPORTER_ASSERT(reporter, SkRRect::kSimple_Type == rr1.type());
190 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr2.type());
194 static void test_round_rect_iffy_parameters(skiatest::Reporter* reporter) {
204 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr1.type());
208 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(p.fX, 33.33333f));
209 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(p.fY, 66.66666f));
215 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr2.type());
219 REPORTER_ASSERT(reporter, 0.0f == p2.fX);
220 REPORTER_ASSERT(reporter, 0.0f == p2.fY);
225 static void test_direction(skiatest::Reporter* reporter, const SkRRect &rr,
235 REPORTER_ASSERT(reporter, contains[i] == rr.contains(test));
243 static void test_round_rect_contains_rect(skiatest::Reporter* reporter) {
273 REPORTER_ASSERT(reporter, !rrects[i].contains(easyOuts[j]));
346 test_direction(reporter, rrects[i], 0, 1, 0, 1, kNumSteps, answers[i][0]); // NW
347 test_direction(reporter, rrects[i], 19.5f, 0, 0, 1, kNumSteps, answers[i][1]); // N
348 test_direction(reporter, rrects[i], 40, -1, 0, 1, kNumSteps, answers[i][2]); // NE
349 test_direction(reporter, rrects[i], 40, -1, 19.5f, 0, kNumSteps, answers[i][3]); // E
350 test_direction(reporter, rrects[i], 40, -1, 40, -1, kNumSteps, answers[i][4]); // SE
351 test_direction(reporter, rrects[i], 19.5f, 0, 40, -1, kNumSteps, answers[i][5]); // S
352 test_direction(reporter, rrects[i], 0, 1, 40, -1, kNumSteps, answers[i][6]); // SW
353 test_direction(reporter, rrects[i], 0, 1, 19.5f, 0, kNumSteps, answers[i][7]); // W
358 static void assert_transform_failure(skiatest::Reporter* reporter, const SkRRect& orig,
369 REPORTER_ASSERT(reporter, !success);
371 REPORTER_ASSERT(reporter, copyOfDst == dst);
373 REPORTER_ASSERT(reporter, copyOfOrig == orig);
374 REPORTER_ASSERT(reporter, orig != dst);
388 static void test_transform_helper(skiatest::Reporter* reporter, const SkRRect& orig) {
394 REPORTER_ASSERT(reporter, success);
395 REPORTER_ASSERT(reporter, orig == dst);
401 assert_transform_failure(reporter, orig, matrix);
405 assert_transform_failure(reporter, orig, matrix);
409 assert_transform_failure(reporter, orig, matrix);
413 assert_transform_failure(reporter, orig, matrix);
418 assert_transform_failure(reporter, orig, matrix);
420 assert_transform_failure(reporter, orig, matrix);
430 REPORTER_ASSERT(reporter, success);
432 REPORTER_ASSERT(reporter,
435 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width());
436 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height());
437 REPORTER_ASSERT(reporter, dst.rect().left() == orig.rect().left() + translateX);
438 REPORTER_ASSERT(reporter, dst.rect().top() == orig.rect().top() + translateY);
442 assert_transform_failure(reporter, orig, matrix);
449 reporter, success);
453 REPORTER_ASSERT(reporter, origUL == dstUR);
454 REPORTER_ASSERT(reporter, origUR == dstUL);
455 REPORTER_ASSERT(reporter, origLR == dstLL);
456 REPORTER_ASSERT(reporter, origLL == dstLR);
459 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width());
460 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height());
462 REPORTER_ASSERT(reporter, orig.rect().right() == -dst.rect().left());
464 REPORTER_ASSERT(reporter, orig.rect().top() == dst.rect().top());
468 assert_transform_failure(reporter, orig, matrix);
475 REPORTER_ASSERT(reporter, success);
479 REPORTER_ASSERT(reporter, origUL == dstLL);
480 REPORTER_ASSERT(reporter, origUR == dstLR);
481 REPORTER_ASSERT(reporter, origLR == dstUR);
482 REPORTER_ASSERT(reporter, origLL == dstUL);
485 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width());
486 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height());
488 REPORTER_ASSERT(reporter, orig.rect().top() == -dst.rect().bottom());
490 REPORTER_ASSERT(reporter, orig.rect().left() == dst.rect().left());
498 REPORTER_ASSERT(reporter, success);
501 REPORTER_ASSERT(reporter, origUL == dstLR);
502 REPORTER_ASSERT(reporter, origUR == dstLL);
503 REPORTER_ASSERT(reporter, origLR == dstUL);
504 REPORTER_ASSERT(reporter, origLL == dstUR);
507 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width());
508 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height());
509 REPORTER_ASSERT(reporter, orig.rect().top() == -dst.rect().bottom());
510 REPORTER_ASSERT(reporter, orig.rect().right() == -dst.rect().left());
520 REPORTER_ASSERT(reporter, success);
523 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.radii((SkRRect::Corner) i).fX,
525 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.radii((SkRRect::Corner) i).fY,
528 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().width(),
530 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().height(),
532 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().left(),
534 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().top(),
538 static void test_round_rect_transform(skiatest::Reporter* reporter) {
543 test_transform_helper(reporter, rrect);
553 test_transform_helper(reporter, rrect);
557 DEF_TEST(RoundRect, reporter) {
558 test_round_rect_basic(reporter);
559 test_round_rect_rects(reporter);
560 test_round_rect_ovals(reporter);
561 test_round_rect_general(reporter);
562 test_round_rect_iffy_parameters(reporter);
563 test_inset(reporter);
564 test_round_rect_contains_rect(reporter);
565 test_round_rect_transform(reporter);