Home | History | Annotate | Download | only in tests

Lines Matching refs:Reporter

12 static void test_tricky_radii(skiatest::Reporter* reporter) {
31 REPORTER_ASSERT(reporter, (double) rr.radii(SkRRect::kUpperRight_Corner).fY +
37 static void test_empty_crbug_458524(skiatest::Reporter* reporter) {
47 REPORTER_ASSERT(reporter, SkRRect::kEmpty_Type == other.getType());
52 static void test_empty(skiatest::Reporter* reporter) {
72 REPORTER_ASSERT(reporter, !r.isEmpty());
75 REPORTER_ASSERT(reporter, !r.isEmpty());
78 REPORTER_ASSERT(reporter, !r.isEmpty());
81 REPORTER_ASSERT(reporter, !r.isEmpty());
84 REPORTER_ASSERT(reporter, !r.isEmpty());
89 REPORTER_ASSERT(reporter, r.isEmpty());
92 REPORTER_ASSERT(reporter, r.isEmpty());
95 REPORTER_ASSERT(reporter, r.isEmpty());
98 REPORTER_ASSERT(reporter, r.isEmpty());
101 REPORTER_ASSERT(reporter, r.isEmpty());
108 static void test_inset(skiatest::Reporter* reporter) {
114 REPORTER_ASSERT(reporter, rr2.isRect());
117 REPORTER_ASSERT(reporter, rr2.isRect());
120 REPORTER_ASSERT(reporter, rr2.isEmpty());
124 REPORTER_ASSERT(reporter, rr2.isSimple());
126 REPORTER_ASSERT(reporter, rr2.isRect());
130 static void test_9patch_rrect(skiatest::Reporter* reporter,
137 REPORTER_ASSERT(reporter, SkRRect::kNinePatch_Type == rr.type());
138 REPORTER_ASSERT(reporter, rr.rect() == rect);
146 REPORTER_ASSERT(reporter, rquad[i] == rr.radii((SkRRect::Corner) i));
152 REPORTER_ASSERT(reporter, rr2 == rr && rr2.getType() == rr.getType());
156 static void test_round_rect_basic(skiatest::Reporter* reporter) {
163 REPORTER_ASSERT(reporter, SkRRect::kEmpty_Type == empty.type());
164 REPORTER_ASSERT(reporter, empty.rect().isEmpty());
167 REPORTER_ASSERT(reporter, zeroPt == empty.radii((SkRRect::Corner) i));
176 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr1.type());
177 REPORTER_ASSERT(reporter, rr1.rect() == rect);
180 REPORTER_ASSERT(reporter, zeroPt == rr1.radii((SkRRect::Corner) i));
185 REPORTER_ASSERT(reporter, rr1_2 == rr1 && rr1_2.getType() == rr1.getType());
188 REPORTER_ASSERT(reporter, rr1_3 == rr1 && rr1_3.getType() == rr1.getType());
195 REPORTER_ASSERT(reporter, SkRRect::kOval_Type == rr2.type());
196 REPORTER_ASSERT(reporter, rr2.rect() == rect);
199 REPORTER_ASSERT(reporter,
206 REPORTER_ASSERT(reporter, rr2_2 == rr2 && rr2_2.getType() == rr2.getType());
209 REPORTER_ASSERT(reporter, rr2_3 == rr2 && rr2_3.getType() == rr2.getType());
216 REPORTER_ASSERT(reporter, SkRRect::kSimple_Type == rr3.type());
217 REPORTER_ASSERT(reporter, rr3.rect() == rect);
220 REPORTER_ASSERT(reporter, p == rr3.radii((SkRRect::Corner) i));
225 REPORTER_ASSERT(reporter, rr3_2 == rr3 && rr3_2.getType() == rr3.getType());
228 REPORTER_ASSERT(reporter, rr3_3 == rr3 && rr3_3.getType() == rr3.getType());
231 test_9patch_rrect(reporter, rect, 10, 9, 8, 7, true);
237 test_9patch_rrect(reporter,
249 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr5.type());
250 REPORTER_ASSERT(reporter, rr5.rect() == rect);
253 REPORTER_ASSERT(reporter, radii2[i] == rr5.radii((SkRRect::Corner) i));
257 REPORTER_ASSERT(reporter, empty != rr3);
258 REPORTER_ASSERT(reporter, rr3 != rr5);
262 static void test_round_rect_rects(skiatest::Reporter* reporter) {
270 REPORTER_ASSERT(reporter, SkRRect::kEmpty_Type == empty.type());
272 REPORTER_ASSERT(reporter, 0 == r.fLeft && 0 == r.fTop && 0 == r.fRight && 0 == r.fBottom);
279 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr1.type());
281 REPORTER_ASSERT(reporter, rect == r);
289 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr2.type());
291 REPORTER_ASSERT(reporter, rect == r);
298 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr3.type());
302 static void test_round_rect_ovals(skiatest::Reporter* reporter) {
309 REPORTER_ASSERT(reporter, SkRRect::kOval_Type == rr1.type());
311 REPORTER_ASSERT(reporter, oval == rect);
315 static void test_round_rect_general(skiatest::Reporter* reporter) {
321 REPORTER_ASSERT(reporter, SkRRect::kSimple_Type == rr1.type());
329 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr2.type());
333 static void test_round_rect_iffy_parameters(skiatest::Reporter* reporter) {
343 REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr1.type());
347 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(p.fX, 33.33333f));
348 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(p.fY, 66.66666f));
354 REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr2.type());
358 REPORTER_ASSERT(reporter, 0.0f == p2.fX);
359 REPORTER_ASSERT(reporter, 0.0f == p2.fY);
364 static void test_direction(skiatest::Reporter* reporter, const SkRRect &rr,
374 REPORTER_ASSERT(reporter, contains[i] == rr.contains(test));
382 static void test_round_rect_contains_rect(skiatest::Reporter* reporter) {
412 REPORTER_ASSERT(reporter, !rrects[i].contains(easyOuts[j]));
485 test_direction(reporter, rrects[i], 0, 1, 0, 1, kNumSteps, answers[i][0]); // NW
486 test_direction(reporter, rrects[i], 19.5f, 0, 0, 1, kNumSteps, answers[i][1]); // N
487 test_direction(reporter, rrects[i], 40, -1, 0, 1, kNumSteps, answers[i][2]); // NE
488 test_direction(reporter, rrects[i], 40, -1, 19.5f, 0, kNumSteps, answers[i][3]); // E
489 test_direction(reporter, rrects[i], 40, -1, 40, -1, kNumSteps, answers[i][4]); // SE
490 test_direction(reporter, rrects[i], 19.5f, 0, 40, -1, kNumSteps, answers[i][5]); // S
491 test_direction(reporter, rrects[i], 0, 1, 40, -1, kNumSteps, answers[i][6]); // SW
492 test_direction(reporter, rrects[i], 0, 1, 19.5f, 0, kNumSteps, answers[i][7]); // W
497 static void assert_transform_failure(skiatest::Reporter* reporter, const SkRRect& orig,
508 REPORTER_ASSERT(reporter, !success);
510 REPORTER_ASSERT(reporter, copyOfDst == dst);
512 REPORTER_ASSERT(reporter, copyOfOrig == orig);
513 REPORTER_ASSERT(reporter, orig != dst);
527 static void test_transform_helper(skiatest::Reporter* reporter, const SkRRect& orig) {
533 REPORTER_ASSERT(reporter, success);
534 REPORTER_ASSERT(reporter, orig == dst);
540 assert_transform_failure(reporter, orig, matrix);
544 assert_transform_failure(reporter, orig, matrix);
548 assert_transform_failure(reporter, orig, matrix);
552 assert_transform_failure(reporter, orig, matrix);
557 assert_transform_failure(reporter, orig, matrix);
559 assert_transform_failure(reporter, orig, matrix);
569 REPORTER_ASSERT(reporter, success);
571 REPORTER_ASSERT(reporter,
574 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width());
575 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height());
576 REPORTER_ASSERT(reporter, dst.rect().left() == orig.rect().left() + translateX);
577 REPORTER_ASSERT(reporter, dst.rect().top() == orig.rect().top() + translateY);
581 assert_transform_failure(reporter, orig, matrix);
588 REPORTER_ASSERT(reporter, success);
592 REPORTER_ASSERT(reporter, origUL == dstUR);
593 REPORTER_ASSERT(reporter, origUR == dstUL);
594 REPORTER_ASSERT(reporter, origLR == dstLL);
595 REPORTER_ASSERT(reporter, origLL == dstLR);
598 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width());
599 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height());
601 REPORTER_ASSERT(reporter, orig.rect().right() == -dst.rect().left());
603 REPORTER_ASSERT(reporter, orig.rect().top() == dst.rect().top());
607 assert_transform_failure(reporter, orig, matrix);
614 REPORTER_ASSERT(reporter, success);
618 REPORTER_ASSERT(reporter, origUL == dstLL);
619 REPORTER_ASSERT(reporter, origUR == dstLR);
620 REPORTER_ASSERT(reporter, origLR == dstUR);
621 REPORTER_ASSERT(reporter, origLL == dstUL);
624 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width());
625 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height());
627 REPORTER_ASSERT(reporter, orig.rect().top() == -dst.rect().bottom());
629 REPORTER_ASSERT(reporter, orig.rect().left() == dst.rect().left());
637 REPORTER_ASSERT(reporter, success);
640 REPORTER_ASSERT(reporter, origUL == dstLR);
641 REPORTER_ASSERT(reporter, origUR == dstLL);
642 REPORTER_ASSERT(reporter, origLR == dstUL);
643 REPORTER_ASSERT(reporter, origLL == dstUR);
646 REPORTER_ASSERT(reporter, orig.rect().width() == dst.rect().width());
647 REPORTER_ASSERT(reporter, orig.rect().height() == dst.rect().height());
648 REPORTER_ASSERT(reporter, orig.rect().top() == -dst.rect().bottom());
649 REPORTER_ASSERT(reporter, orig.rect().right() == -dst.rect().left());
659 REPORTER_ASSERT(reporter, success);
662 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.radii((SkRRect::Corner) i).fX,
664 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.radii((SkRRect::Corner) i).fY,
667 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().width(),
669 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().height(),
671 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().left(),
673 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(dst.rect().top(),
677 static void test_round_rect_transform(skiatest::Reporter* reporter) {
682 test_transform_helper(reporter, rrect);
692 test_transform_helper(reporter, rrect);
700 static void test_issue_2696(skiatest::Reporter* reporter) {
712 REPORTER_ASSERT(reporter, success);
718 REPORTER_ASSERT(reporter,
720 REPORTER_ASSERT(reporter,
725 DEF_TEST(RoundRect, reporter) {
726 test_round_rect_basic(reporter);
727 test_round_rect_rects(reporter);
728 test_round_rect_ovals(reporter);
729 test_round_rect_general(reporter);
730 test_round_rect_iffy_parameters(reporter);
731 test_inset(reporter);
732 test_round_rect_contains_rect(reporter);
733 test_round_rect_transform(reporter);
734 test_issue_2696(reporter);
735 test_tricky_radii(reporter);
736 test_empty_crbug_458524(reporter);
737 test_empty(reporter);