Home | History | Annotate | Download | only in tests

Lines Matching refs:Reporter

30 template <typename T> void assert16(skiatest::Reporter* reporter, const T data[],
35 REPORTER_ASSERT(reporter, data[0] == m0);
36 REPORTER_ASSERT(reporter, data[1] == m1);
37 REPORTER_ASSERT(reporter, data[2] == m2);
38 REPORTER_ASSERT(reporter, data[3] == m3);
40 REPORTER_ASSERT(reporter, data[4] == m4);
41 REPORTER_ASSERT(reporter, data[5] == m5);
42 REPORTER_ASSERT(reporter, data[6] == m6);
43 REPORTER_ASSERT(reporter, data[7] == m7);
45 REPORTER_ASSERT(reporter, data[8] == m8);
46 REPORTER_ASSERT(reporter, data[9] == m9);
47 REPORTER_ASSERT(reporter, data[10] == m10);
48 REPORTER_ASSERT(reporter, data[11] == m11);
50 REPORTER_ASSERT(reporter, data[12] == m12);
51 REPORTER_ASSERT(reporter, data[13] == m13);
52 REPORTER_ASSERT(reporter, data[14] == m14);
53 REPORTER_ASSERT(reporter, data[15] == m15);
78 static void test_constructor(skiatest::Reporter* reporter) {
93 REPORTER_ASSERT(reporter, testMatrix == placeholderMatrix);
94 REPORTER_ASSERT(reporter, !testMatrix->isIdentity());
97 REPORTER_ASSERT(reporter, nearly_equal_double(row * col, testMatrix->getDouble(row, col)));
104 REPORTER_ASSERT(reporter, testMatrix == placeholderMatrix);
105 REPORTER_ASSERT(reporter, testMatrix->isIdentity());
106 REPORTER_ASSERT(reporter, *testMatrix == SkMatrix44::I());
111 REPORTER_ASSERT(reporter, scaleMatrix.isScale());
113 REPORTER_ASSERT(reporter, testMatrix->isIdentity());
114 REPORTER_ASSERT(reporter, *testMatrix == SkMatrix44::I());
117 static void test_translate(skiatest::Reporter* reporter) {
122 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kIdentity_Mask));
124 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kTranslate_Mask));
125 REPORTER_ASSERT(reporter, mat.invert(&inverse));
126 REPORTER_ASSERT(reporter, bits_isonly(inverse.getType(), SkMatrix44::kTranslate_Mask));
137 REPORTER_ASSERT(reporter, mat == c);
142 REPORTER_ASSERT(reporter, mat == c);
145 static void test_scale(skiatest::Reporter* reporter) {
150 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kIdentity_Mask));
152 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kScale_Mask));
153 REPORTER_ASSERT(reporter, mat.invert(&inverse));
154 REPORTER_ASSERT(reporter, bits_isonly(inverse.getType(), SkMatrix44::kScale_Mask));
165 REPORTER_ASSERT(reporter, mat == c);
170 REPORTER_ASSERT(reporter, mat == c);
197 static void test_map2(skiatest::Reporter* reporter, const SkMatrix44& mat) {
211 REPORTER_ASSERT(reporter, dstA[i] == dstB[i]);
215 static void test_map2(skiatest::Reporter* reporter) {
220 test_map2(reporter, mat);
224 static void test_gettype(skiatest::Reporter* reporter) {
227 REPORTER_ASSERT(reporter, matrix.isIdentity());
228 REPORTER_ASSERT(reporter, SkMatrix44::kIdentity_Mask == matrix.getType());
234 REPORTER_ASSERT(reporter, matrix.getType() == expectedMask);
238 REPORTER_ASSERT(reporter, matrix.getType() == expectedMask);
242 REPORTER_ASSERT(reporter, matrix.getType() == expectedMask);
245 REPORTER_ASSERT(reporter, matrix.getType() & SkMatrix44::kPerspective_Mask);
252 REPORTER_ASSERT(reporter, matrix.isIdentity());
254 REPORTER_ASSERT(reporter, matrix.isIdentity());
256 REPORTER_ASSERT(reporter, matrix.isIdentity());
259 static void test_common_angles(skiatest::Reporter* reporter) {
267 REPORTER_ASSERT(reporter, rot3x3.rectStaysRect());
271 static void test_concat(skiatest::Reporter* reporter) {
291 REPORTER_ASSERT(reporter, d == c);
295 REPORTER_ASSERT(reporter, 10 == dst[i]);
296 REPORTER_ASSERT(reporter, 12 == dst[i + 4]);
303 REPORTER_ASSERT(reporter, d == c);
307 REPORTER_ASSERT(reporter, 20 == dst[i]);
308 REPORTER_ASSERT(reporter, 22 == dst[i + 4]);
312 static void test_determinant(skiatest::Reporter* reporter) {
314 REPORTER_ASSERT(reporter, nearly_equal_double(1, a.determinant()));
316 REPORTER_ASSERT(reporter, nearly_equal_double(2, a.determinant()));
318 REPORTER_ASSERT(reporter, a.invert(&b));
319 REPORTER_ASSERT(reporter, nearly_equal_double(0.5, b.determinant()));
323 REPORTER_ASSERT(reporter,
328 REPORTER_ASSERT(reporter, nearly_equal_double(16, d.determinant()));
332 REPORTER_ASSERT(reporter, nearly_equal_double(32, e.determinant()));
334 REPORTER_ASSERT(reporter, nearly_equal_double(0, e.determinant()));
337 static void test_invert(skiatest::Reporter* reporter) {
344 assert16<double>(reporter, inverseData,
354 assert16<double>(reporter, inverseData,
364 assert16<double>(reporter, inverseData,
375 assert16<double>(reporter, inverseData,
391 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse));
404 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse));
415 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse));
428 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse));
432 REPORTER_ASSERT(reporter, tinyScale.getType() == SkMatrix44::kScale_Mask);
433 REPORTER_ASSERT(reporter, !tinyScale.invert(nullptr));
434 REPORTER_ASSERT(reporter, !tinyScale.invert(&inverse));
438 REPORTER_ASSERT(reporter, tinyScaleTranslate.invert(nullptr));
441 reporter, tinyScaleTranslate.getType() ==
443 REPORTER_ASSERT(reporter, !tinyScaleTranslate.invert(nullptr));
444 REPORTER_ASSERT(reporter, !tinyScaleTranslate.invert(&inverse));
449 REPORTER_ASSERT(reporter, (tinyScalePerspective.getType() &
452 REPORTER_ASSERT(reporter
453 REPORTER_ASSERT(reporter, !tinyScalePerspective.invert(&inverse));
456 static void test_transpose(skiatest::Reporter* reporter) {
469 REPORTER_ASSERT(reporter, nearly_equal(a, b));
472 static void test_get_set_double(skiatest::Reporter* reporter) {
477 REPORTER_ASSERT(reporter,
481 REPORTER_ASSERT(reporter,
487 static void test_set_row_col_major(skiatest::Reporter* reporter) {
501 REPORTER_ASSERT(reporter, nearly_equal(a, b));
504 REPORTER_ASSERT(reporter, nearly_equal(a, b));
507 REPORTER_ASSERT(reporter, nearly_equal(a, b));
510 REPORTER_ASSERT(reporter, nearly_equal(a, b));
513 static void test_3x3_conversion(skiatest::Reporter* reporter) {
531 REPORTER_ASSERT(reporter, expected33 == a33);
536 REPORTER_ASSERT(reporter, nearly_equal(a44flattened, expected44flattened));
548 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[0], vec3transformed[0]));
549 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[1], vec3transformed[1]));
550 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[3], vec3transformed[2]));
551 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[0], vec4transformed2[0]));
552 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[1], vec4transformed2[1]));
553 REPORTER_ASSERT(reporter, !nearly_equal_scalar(vec4transformed[2], vec4transformed2[2]));
554 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[3], vec4transformed2[3]));
557 static void test_has_perspective(skiatest::Reporter* reporter) {
561 REPORTER_ASSERT(reporter, transform.hasPerspective());
564 REPORTER_ASSERT(reporter, !transform.hasPerspective());
567 REPORTER_ASSERT(reporter, transform.hasPerspective());
571 REPORTER_ASSERT(reporter, transform.hasPerspective());
575 REPORTER_ASSERT(reporter, transform.hasPerspective());
579 REPORTER_ASSERT(reporter, transform.hasPerspective());
583 REPORTER_ASSERT(reporter, transform.hasPerspective());
609 static bool empirically_preserves_2d_axis_alignment(skiatest::Reporter* reporter,
616 REPORTER_ASSERT(reporter, is_rectilinear(p1, p2, p3, p4));
626 static void test(bool expected, skiatest::Reporter* reporter, const SkMatrix44& transform) {
628 REPORTER_ASSERT(reporter, empirically_preserves_2d_axis_alignment(reporter, transform));
629 REPORTER_ASSERT(reporter, transform.preserves2dAxisAlignment());
631 REPORTER_ASSERT(reporter, !empirically_preserves_2d_axis_alignment(reporter, transform));
632 REPORTER_ASSERT(reporter, !transform.preserves2dAxisAlignment());
636 static void test_preserves_2d_axis_alignment(skiatest::Reporter* reporter) {
687 test(value.expected, reporter, transform);
709 test(value.expected, reporter, transform);
735 test(false, reporter, transform);
756 test(value.expected, reporter, transform);
780 test(value.expected, reporter, transform);
788 test(false, reporter, transform);
794 test(true, reporter, transform);
798 static void test_toint(skiatest::Reporter* reporter) {
808 REPORTER_ASSERT(reporter, sum >= 0);
809 REPORTER_ASSERT(reporter, isum >= 0);
810 REPORTER_ASSERT(reporter, static_cast<SkMScalar>(isum) == SkIntToMScalar(isum));
813 DEF_TEST(Matrix44, reporter) {
823 REPORTER_ASSERT(reporter, is_identity(iden1));
828 REPORTER_ASSERT(reporter, is_identity(iden1));
833 REPORTER_ASSERT(reporter, is_identity(iden1));
838 REPORTER_ASSERT(reporter, mat.invert(nullptr));
841 REPORTER_ASSERT(reporter, is_identity(iden1));
843 REPORTER_ASSERT(reporter, is_identity(iden2));
852 REPORTER_ASSERT(reporter, mat.invert(nullptr));
855 REPORTER_ASSERT(reporter, is_identity(iden1));
867 REPORTER_ASSERT(reporter, mat.invert(nullptr));
870 REPORTER_ASSERT(reporter, is_identity(iden1));
875 REPORTER_ASSERT(reporter, !mat.invert(nullptr));
884 assert16<float>(reporter, dataf,
890 assert16<double>(reporter, datad, 1, 0, 0, 0,
895 assert16<float>(reporter, dataf, 1, 0, 0, 2,
900 assert16<double>(reporter, datad, 1, 0, 0, 2,
906 test_concat(reporter);
909 test_common_angles(reporter);
912 test_constructor(reporter);
913 test_gettype(reporter);
914 test_determinant(reporter);
915 reporter);
916 test_transpose(reporter);
917 test_get_set_double(reporter);
918 test_set_row_col_major(reporter);
919 test_translate(reporter);
920 test_scale(reporter);
921 test_map2(reporter);
922 test_3x3_conversion(reporter);
923 test_has_perspective(reporter);
924 test_preserves_2d_axis_alignment(reporter);
925 test_toint(reporter);