Lines Matching refs:reporter

31 template <typename T> void assert16(skiatest::Reporter* reporter, const T data[],  in assert16()  argument
36 REPORTER_ASSERT(reporter, data[0] == m0); in assert16()
37 REPORTER_ASSERT(reporter, data[1] == m1); in assert16()
38 REPORTER_ASSERT(reporter, data[2] == m2); in assert16()
39 REPORTER_ASSERT(reporter, data[3] == m3); in assert16()
41 REPORTER_ASSERT(reporter, data[4] == m4); in assert16()
42 REPORTER_ASSERT(reporter, data[5] == m5); in assert16()
43 REPORTER_ASSERT(reporter, data[6] == m6); in assert16()
44 REPORTER_ASSERT(reporter, data[7] == m7); in assert16()
46 REPORTER_ASSERT(reporter, data[8] == m8); in assert16()
47 REPORTER_ASSERT(reporter, data[9] == m9); in assert16()
48 REPORTER_ASSERT(reporter, data[10] == m10); in assert16()
49 REPORTER_ASSERT(reporter, data[11] == m11); in assert16()
51 REPORTER_ASSERT(reporter, data[12] == m12); in assert16()
52 REPORTER_ASSERT(reporter, data[13] == m13); in assert16()
53 REPORTER_ASSERT(reporter, data[14] == m14); in assert16()
54 REPORTER_ASSERT(reporter, data[15] == m15); in assert16()
79 static void test_constructor(skiatest::Reporter* reporter) { in test_constructor() argument
94 REPORTER_ASSERT(reporter, testMatrix == placeholderMatrix); in test_constructor()
95 REPORTER_ASSERT(reporter, !testMatrix->isIdentity()); in test_constructor()
98 … REPORTER_ASSERT(reporter, nearly_equal_double(row * col, testMatrix->getDouble(row, col))); in test_constructor()
105 REPORTER_ASSERT(reporter, testMatrix == placeholderMatrix); in test_constructor()
106 REPORTER_ASSERT(reporter, testMatrix->isIdentity()); in test_constructor()
107 REPORTER_ASSERT(reporter, *testMatrix == SkMatrix44::I()); in test_constructor()
112 REPORTER_ASSERT(reporter, scaleMatrix.isScale()); in test_constructor()
114 REPORTER_ASSERT(reporter, testMatrix->isIdentity()); in test_constructor()
115 REPORTER_ASSERT(reporter, *testMatrix == SkMatrix44::I()); in test_constructor()
118 static void test_translate(skiatest::Reporter* reporter) { in test_translate() argument
123 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kIdentity_Mask)); in test_translate()
125 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kTranslate_Mask)); in test_translate()
126 REPORTER_ASSERT(reporter, mat.invert(&inverse)); in test_translate()
127 REPORTER_ASSERT(reporter, bits_isonly(inverse.getType(), SkMatrix44::kTranslate_Mask)); in test_translate()
136 REPORTER_ASSERT(reporter, mat == c); in test_translate()
141 REPORTER_ASSERT(reporter, mat == c); in test_translate()
144 static void test_scale(skiatest::Reporter* reporter) { in test_scale() argument
149 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kIdentity_Mask)); in test_scale()
151 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kScale_Mask)); in test_scale()
152 REPORTER_ASSERT(reporter, mat.invert(&inverse)); in test_scale()
153 REPORTER_ASSERT(reporter, bits_isonly(inverse.getType(), SkMatrix44::kScale_Mask)); in test_scale()
162 REPORTER_ASSERT(reporter, mat == c); in test_scale()
167 REPORTER_ASSERT(reporter, mat == c); in test_scale()
194 static void test_map2(skiatest::Reporter* reporter, const SkMatrix44& mat) { in test_map2() argument
208 REPORTER_ASSERT(reporter, dstA[i] == dstB[i]); in test_map2()
212 static void test_map2(skiatest::Reporter* reporter) { in test_map2() argument
217 test_map2(reporter, mat); in test_map2()
221 static void test_gettype(skiatest::Reporter* reporter) { in test_gettype() argument
224 REPORTER_ASSERT(reporter, matrix.isIdentity()); in test_gettype()
225 REPORTER_ASSERT(reporter, SkMatrix44::kIdentity_Mask == matrix.getType()); in test_gettype()
231 REPORTER_ASSERT(reporter, matrix.getType() == expectedMask); in test_gettype()
235 REPORTER_ASSERT(reporter, matrix.getType() == expectedMask); in test_gettype()
239 REPORTER_ASSERT(reporter, matrix.getType() == expectedMask); in test_gettype()
242 REPORTER_ASSERT(reporter, matrix.getType() & SkMatrix44::kPerspective_Mask); in test_gettype()
249 REPORTER_ASSERT(reporter, matrix.isIdentity()); in test_gettype()
251 REPORTER_ASSERT(reporter, matrix.isIdentity()); in test_gettype()
253 REPORTER_ASSERT(reporter, matrix.isIdentity()); in test_gettype()
256 static void test_common_angles(skiatest::Reporter* reporter) { in test_common_angles() argument
264 REPORTER_ASSERT(reporter, rot3x3.rectStaysRect()); in test_common_angles()
268 static void test_concat(skiatest::Reporter* reporter) { in test_concat() argument
285 REPORTER_ASSERT(reporter, d == c); in test_concat()
289 REPORTER_ASSERT(reporter, 10 == dst[i]); in test_concat()
290 REPORTER_ASSERT(reporter, 12 == dst[i + 4]); in test_concat()
297 REPORTER_ASSERT(reporter, d == c); in test_concat()
301 REPORTER_ASSERT(reporter, 20 == dst[i]); in test_concat()
302 REPORTER_ASSERT(reporter, 22 == dst[i + 4]); in test_concat()
306 static void test_determinant(skiatest::Reporter* reporter) { in test_determinant() argument
308 REPORTER_ASSERT(reporter, nearly_equal_double(1, a.determinant())); in test_determinant()
310 REPORTER_ASSERT(reporter, nearly_equal_double(2, a.determinant())); in test_determinant()
312 REPORTER_ASSERT(reporter, a.invert(&b)); in test_determinant()
313 REPORTER_ASSERT(reporter, nearly_equal_double(0.5, b.determinant())); in test_determinant()
317 REPORTER_ASSERT(reporter, in test_determinant()
322 REPORTER_ASSERT(reporter, nearly_equal_double(16, d.determinant())); in test_determinant()
326 REPORTER_ASSERT(reporter, nearly_equal_double(32, e.determinant())); in test_determinant()
328 REPORTER_ASSERT(reporter, nearly_equal_double(0, e.determinant())); in test_determinant()
331 static void test_invert(skiatest::Reporter* reporter) { in test_invert() argument
338 assert16<double>(reporter, inverseData, in test_invert()
348 assert16<double>(reporter, inverseData, in test_invert()
358 assert16<double>(reporter, inverseData, in test_invert()
369 assert16<double>(reporter, inverseData, in test_invert()
385 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse)); in test_invert()
398 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse)); in test_invert()
409 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse)); in test_invert()
422 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse)); in test_invert()
426 REPORTER_ASSERT(reporter, tinyScale.getType() == SkMatrix44::kScale_Mask); in test_invert()
427 REPORTER_ASSERT(reporter, !tinyScale.invert(nullptr)); in test_invert()
428 REPORTER_ASSERT(reporter, !tinyScale.invert(&inverse)); in test_invert()
432 REPORTER_ASSERT(reporter, tinyScaleTranslate.invert(nullptr)); in test_invert()
435 reporter, tinyScaleTranslate.getType() == in test_invert()
437 REPORTER_ASSERT(reporter, !tinyScaleTranslate.invert(nullptr)); in test_invert()
438 REPORTER_ASSERT(reporter, !tinyScaleTranslate.invert(&inverse)); in test_invert()
443 REPORTER_ASSERT(reporter, (tinyScalePerspective.getType() & in test_invert()
446 REPORTER_ASSERT(reporter, !tinyScalePerspective.invert(nullptr)); in test_invert()
447 REPORTER_ASSERT(reporter, !tinyScalePerspective.invert(&inverse)); in test_invert()
450 static void test_transpose(skiatest::Reporter* reporter) { in test_transpose() argument
462 REPORTER_ASSERT(reporter, nearly_equal(a, b)); in test_transpose()
465 static void test_get_set_double(skiatest::Reporter* reporter) { in test_get_set_double() argument
470 REPORTER_ASSERT(reporter, in test_get_set_double()
474 REPORTER_ASSERT(reporter, in test_get_set_double()
497 static void test_set_row_col_major(skiatest::Reporter* reporter) { in test_set_row_col_major() argument
510 REPORTER_ASSERT(reporter, nearly_equal(a, b)); in test_set_row_col_major()
513 REPORTER_ASSERT(reporter, nearly_equal(a, b)); in test_set_row_col_major()
516 REPORTER_ASSERT(reporter, nearly_equal(a, b)); in test_set_row_col_major()
519 REPORTER_ASSERT(reporter, nearly_equal(a, b)); in test_set_row_col_major()
522 static void test_3x3_conversion(skiatest::Reporter* reporter) { in test_3x3_conversion() argument
540 REPORTER_ASSERT(reporter, expected33 == a33); in test_3x3_conversion()
545 REPORTER_ASSERT(reporter, nearly_equal(a44flattened, expected44flattened)); in test_3x3_conversion()
557 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[0], vec3transformed.fX)); in test_3x3_conversion()
558 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[1], vec3transformed.fY)); in test_3x3_conversion()
559 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[3], vec3transformed.fZ)); in test_3x3_conversion()
560 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[0], vec4transformed2[0])); in test_3x3_conversion()
561 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[1], vec4transformed2[1])); in test_3x3_conversion()
562 REPORTER_ASSERT(reporter, !nearly_equal_scalar(vec4transformed[2], vec4transformed2[2])); in test_3x3_conversion()
563 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[3], vec4transformed2[3])); in test_3x3_conversion()
566 static void test_has_perspective(skiatest::Reporter* reporter) { in test_has_perspective() argument
570 REPORTER_ASSERT(reporter, transform.hasPerspective()); in test_has_perspective()
573 REPORTER_ASSERT(reporter, !transform.hasPerspective()); in test_has_perspective()
576 REPORTER_ASSERT(reporter, transform.hasPerspective()); in test_has_perspective()
580 REPORTER_ASSERT(reporter, transform.hasPerspective()); in test_has_perspective()
584 REPORTER_ASSERT(reporter, transform.hasPerspective()); in test_has_perspective()
588 REPORTER_ASSERT(reporter, transform.hasPerspective()); in test_has_perspective()
592 REPORTER_ASSERT(reporter, transform.hasPerspective()); in test_has_perspective()
618 static bool empirically_preserves_2d_axis_alignment(skiatest::Reporter* reporter, in empirically_preserves_2d_axis_alignment() argument
625 REPORTER_ASSERT(reporter, is_rectilinear(p1, p2, p3, p4)); in empirically_preserves_2d_axis_alignment()
635 static void test(bool expected, skiatest::Reporter* reporter, const SkMatrix44& transform) { in test() argument
637 REPORTER_ASSERT(reporter, empirically_preserves_2d_axis_alignment(reporter, transform)); in test()
638 REPORTER_ASSERT(reporter, transform.preserves2dAxisAlignment()); in test()
640 REPORTER_ASSERT(reporter, !empirically_preserves_2d_axis_alignment(reporter, transform)); in test()
641 REPORTER_ASSERT(reporter, !transform.preserves2dAxisAlignment()); in test()
645 static void test_preserves_2d_axis_alignment(skiatest::Reporter* reporter) { in test_preserves_2d_axis_alignment() argument
696 test(value.expected, reporter, transform); in test_preserves_2d_axis_alignment()
718 test(value.expected, reporter, transform); in test_preserves_2d_axis_alignment()
744 test(false, reporter, transform); in test_preserves_2d_axis_alignment()
765 test(value.expected, reporter, transform); in test_preserves_2d_axis_alignment()
789 test(value.expected, reporter, transform); in test_preserves_2d_axis_alignment()
797 test(false, reporter, transform); in test_preserves_2d_axis_alignment()
803 test(true, reporter, transform); in test_preserves_2d_axis_alignment()
807 static void test_toint(skiatest::Reporter* reporter) { in test_toint() argument
817 REPORTER_ASSERT(reporter, sum >= 0); in test_toint()
818 REPORTER_ASSERT(reporter, isum >= 0); in test_toint()
819 REPORTER_ASSERT(reporter, static_cast<SkMScalar>(isum) == SkIntToMScalar(isum)); in test_toint()
822 DEF_TEST(Matrix44, reporter) { in DEF_TEST() argument
832 REPORTER_ASSERT(reporter, is_identity(iden1)); in DEF_TEST()
837 REPORTER_ASSERT(reporter, is_identity(iden1)); in DEF_TEST()
842 REPORTER_ASSERT(reporter, is_identity(iden1)); in DEF_TEST()
847 REPORTER_ASSERT(reporter, mat.invert(nullptr)); in DEF_TEST()
850 REPORTER_ASSERT(reporter, is_identity(iden1)); in DEF_TEST()
852 REPORTER_ASSERT(reporter, is_identity(iden2)); in DEF_TEST()
861 REPORTER_ASSERT(reporter, mat.invert(nullptr)); in DEF_TEST()
864 REPORTER_ASSERT(reporter, is_identity(iden1)); in DEF_TEST()
876 REPORTER_ASSERT(reporter, mat.invert(nullptr)); in DEF_TEST()
879 REPORTER_ASSERT(reporter, is_identity(iden1)); in DEF_TEST()
884 REPORTER_ASSERT(reporter, !mat.invert(nullptr)); in DEF_TEST()
893 assert16<float>(reporter, dataf, in DEF_TEST()
899 assert16<double>(reporter, datad, 1, 0, 0, 0, in DEF_TEST()
904 assert16<float>(reporter, dataf, 1, 0, 0, 2, in DEF_TEST()
909 assert16<double>(reporter, datad, 1, 0, 0, 2, in DEF_TEST()
915 test_concat(reporter); in DEF_TEST()
918 test_common_angles(reporter); in DEF_TEST()
921 test_constructor(reporter); in DEF_TEST()
922 test_gettype(reporter); in DEF_TEST()
923 test_determinant(reporter); in DEF_TEST()
924 test_invert(reporter); in DEF_TEST()
925 test_transpose(reporter); in DEF_TEST()
926 test_get_set_double(reporter); in DEF_TEST()
927 test_set_row_col_major(reporter); in DEF_TEST()
928 test_set_3x3(reporter); in DEF_TEST()
929 test_translate(reporter); in DEF_TEST()
930 test_scale(reporter); in DEF_TEST()
931 test_map2(reporter); in DEF_TEST()
932 test_3x3_conversion(reporter); in DEF_TEST()
933 test_has_perspective(reporter); in DEF_TEST()
934 test_preserves_2d_axis_alignment(reporter); in DEF_TEST()
935 test_toint(reporter); in DEF_TEST()