Home | History | Annotate | Download | only in tests

Lines Matching refs:Reporter

13 static void test_casts(skiatest::Reporter* reporter) {
20 REPORTER_ASSERT(reporter, p.asScalars() == pPtr);
21 REPORTER_ASSERT(reporter, r.asScalars() == rPtr);
25 static void test_Normalize(skiatest::Reporter* reporter,
32 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(returned, oldLength));
33 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(newLength, SK_Scalar1));
38 static void test_length(skiatest::Reporter* reporter, SkScalar x, SkScalar y,
46 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(s1, s2));
47 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(s1, expectedLength));
49 test_Normalize(reporter, x, y);
57 // use that big value, hence this hacky helper function: reporter is
59 template <typename T> T get_value(skiatest::Reporter* reporter, T value) {
60 return reporter ? value : 0;
70 static float force_as_float(skiatest::Reporter* reporter, float value) {
76 if (nullptr == reporter) {
85 static void test_overflow(skiatest::Reporter* reporter) {
86 SkScalar bigFloat = get_value(reporter, 3.4e38f);
90 length = force_as_float(reporter, length);
95 REPORTER_ASSERT(reporter, !SkScalarIsFinite(length));
99 REPORTER_ASSERT(reporter, pt.setLength(SK_Scalar1));
103 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(length, SK_Scalar1));
108 static void test_underflow(skiatest::Reporter* reporter) {
112 REPORTER_ASSERT(reporter, 0 == SkPoint::Normalize(&pt));
113 REPORTER_ASSERT(reporter, pt == empty);
115 REPORTER_ASSERT(reporter, !pt.setLength(SK_Scalar1));
116 REPORTER_ASSERT(reporter, pt == empty);
119 DEF_TEST(Point, reporter) {
120 test_casts(reporter);
132 test_length(reporter, gRec[i].fX, gRec[i].fY, gRec[i].fLength);
135 test_underflow(reporter);
136 test_overflow(reporter);
139 DEF_TEST(Point_setLengthFast, reporter) {
154 REPORTER_ASSERT(reporter, ratio > 0.999f);
155 REPORTER_ASSERT(reporter, ratio < 1.001f);