• Home
  • Raw
  • Download

Lines Matching refs:reporter

30 template <typename T> void assert16(skiatest::Reporter* reporter, const T data[],  in assert16()  argument
35 REPORTER_ASSERT(reporter, data[0] == m0); in assert16()
36 REPORTER_ASSERT(reporter, data[1] == m1); in assert16()
37 REPORTER_ASSERT(reporter, data[2] == m2); in assert16()
38 REPORTER_ASSERT(reporter, data[3] == m3); in assert16()
40 REPORTER_ASSERT(reporter, data[4] == m4); in assert16()
41 REPORTER_ASSERT(reporter, data[5] == m5); in assert16()
42 REPORTER_ASSERT(reporter, data[6] == m6); in assert16()
43 REPORTER_ASSERT(reporter, data[7] == m7); in assert16()
45 REPORTER_ASSERT(reporter, data[8] == m8); in assert16()
46 REPORTER_ASSERT(reporter, data[9] == m9); in assert16()
47 REPORTER_ASSERT(reporter, data[10] == m10); in assert16()
48 REPORTER_ASSERT(reporter, data[11] == m11); in assert16()
50 REPORTER_ASSERT(reporter, data[12] == m12); in assert16()
51 REPORTER_ASSERT(reporter, data[13] == m13); in assert16()
52 REPORTER_ASSERT(reporter, data[14] == m14); in assert16()
53 REPORTER_ASSERT(reporter, data[15] == m15); in assert16()
78 static void test_constructor(skiatest::Reporter* reporter) { in test_constructor() argument
93 REPORTER_ASSERT(reporter, testMatrix == placeholderMatrix); in test_constructor()
94 REPORTER_ASSERT(reporter, !testMatrix->isIdentity()); in test_constructor()
97 … REPORTER_ASSERT(reporter, nearly_equal_double(row * col, testMatrix->getDouble(row, col))); in test_constructor()
104 REPORTER_ASSERT(reporter, testMatrix == placeholderMatrix); in test_constructor()
105 REPORTER_ASSERT(reporter, testMatrix->isIdentity()); in test_constructor()
106 REPORTER_ASSERT(reporter, *testMatrix == SkMatrix44::I()); in test_constructor()
111 REPORTER_ASSERT(reporter, scaleMatrix.isScale()); in test_constructor()
113 REPORTER_ASSERT(reporter, testMatrix->isIdentity()); in test_constructor()
114 REPORTER_ASSERT(reporter, *testMatrix == SkMatrix44::I()); in test_constructor()
117 static void test_translate(skiatest::Reporter* reporter) { in test_translate() argument
122 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kIdentity_Mask)); in test_translate()
124 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kTranslate_Mask)); in test_translate()
125 REPORTER_ASSERT(reporter, mat.invert(&inverse)); in test_translate()
126 REPORTER_ASSERT(reporter, bits_isonly(inverse.getType(), SkMatrix44::kTranslate_Mask)); in test_translate()
137 REPORTER_ASSERT(reporter, mat == c); in test_translate()
142 REPORTER_ASSERT(reporter, mat == c); in test_translate()
145 static void test_scale(skiatest::Reporter* reporter) { in test_scale() argument
150 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kIdentity_Mask)); in test_scale()
152 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kScale_Mask)); in test_scale()
153 REPORTER_ASSERT(reporter, mat.invert(&inverse)); in test_scale()
154 REPORTER_ASSERT(reporter, bits_isonly(inverse.getType(), SkMatrix44::kScale_Mask)); in test_scale()
165 REPORTER_ASSERT(reporter, mat == c); in test_scale()
170 REPORTER_ASSERT(reporter, mat == c); in test_scale()
197 static void test_map2(skiatest::Reporter* reporter, const SkMatrix44& mat) { in test_map2() argument
211 REPORTER_ASSERT(reporter, dstA[i] == dstB[i]); in test_map2()
215 static void test_map2(skiatest::Reporter* reporter) { in test_map2() argument
220 test_map2(reporter, mat); in test_map2()
224 static void test_gettype(skiatest::Reporter* reporter) { in test_gettype() argument
227 REPORTER_ASSERT(reporter, matrix.isIdentity()); in test_gettype()
228 REPORTER_ASSERT(reporter, SkMatrix44::kIdentity_Mask == matrix.getType()); in test_gettype()
234 REPORTER_ASSERT(reporter, matrix.getType() == expectedMask); in test_gettype()
238 REPORTER_ASSERT(reporter, matrix.getType() == expectedMask); in test_gettype()
242 REPORTER_ASSERT(reporter, matrix.getType() == expectedMask); in test_gettype()
245 REPORTER_ASSERT(reporter, matrix.getType() & SkMatrix44::kPerspective_Mask); in test_gettype()
252 REPORTER_ASSERT(reporter, matrix.isIdentity()); in test_gettype()
254 REPORTER_ASSERT(reporter, matrix.isIdentity()); in test_gettype()
256 REPORTER_ASSERT(reporter, matrix.isIdentity()); in test_gettype()
259 static void test_common_angles(skiatest::Reporter* reporter) { in test_common_angles() argument
267 REPORTER_ASSERT(reporter, rot3x3.rectStaysRect()); in test_common_angles()
271 static void test_concat(skiatest::Reporter* reporter) { in test_concat() argument
291 REPORTER_ASSERT(reporter, d == c); in test_concat()
295 REPORTER_ASSERT(reporter, 10 == dst[i]); in test_concat()
296 REPORTER_ASSERT(reporter, 12 == dst[i + 4]); in test_concat()
303 REPORTER_ASSERT(reporter, d == c); in test_concat()
307 REPORTER_ASSERT(reporter, 20 == dst[i]); in test_concat()
308 REPORTER_ASSERT(reporter, 22 == dst[i + 4]); in test_concat()
312 static void test_determinant(skiatest::Reporter* reporter) { in test_determinant() argument
314 REPORTER_ASSERT(reporter, nearly_equal_double(1, a.determinant())); in test_determinant()
316 REPORTER_ASSERT(reporter, nearly_equal_double(2, a.determinant())); in test_determinant()
318 REPORTER_ASSERT(reporter, a.invert(&b)); in test_determinant()
319 REPORTER_ASSERT(reporter, nearly_equal_double(0.5, b.determinant())); in test_determinant()
323 REPORTER_ASSERT(reporter, in test_determinant()
328 REPORTER_ASSERT(reporter, nearly_equal_double(16, d.determinant())); in test_determinant()
332 REPORTER_ASSERT(reporter, nearly_equal_double(32, e.determinant())); in test_determinant()
334 REPORTER_ASSERT(reporter, nearly_equal_double(0, e.determinant())); in test_determinant()
337 static void test_invert(skiatest::Reporter* reporter) { in test_invert() argument
344 assert16<double>(reporter, inverseData, in test_invert()
354 assert16<double>(reporter, inverseData, in test_invert()
364 assert16<double>(reporter, inverseData, in test_invert()
375 assert16<double>(reporter, inverseData, in test_invert()
391 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse)); in test_invert()
404 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse)); in test_invert()
415 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse)); in test_invert()
428 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse)); in test_invert()
432 REPORTER_ASSERT(reporter, tinyScale.getType() == SkMatrix44::kScale_Mask); in test_invert()
433 REPORTER_ASSERT(reporter, !tinyScale.invert(nullptr)); in test_invert()
434 REPORTER_ASSERT(reporter, !tinyScale.invert(&inverse)); in test_invert()
438 REPORTER_ASSERT(reporter, tinyScaleTranslate.invert(nullptr)); in test_invert()
441 reporter, tinyScaleTranslate.getType() == in test_invert()
443 REPORTER_ASSERT(reporter, !tinyScaleTranslate.invert(nullptr)); in test_invert()
444 REPORTER_ASSERT(reporter, !tinyScaleTranslate.invert(&inverse)); in test_invert()
449 REPORTER_ASSERT(reporter, (tinyScalePerspective.getType() & in test_invert()
452 REPORTER_ASSERT(reporter, !tinyScalePerspective.invert(nullptr)); in test_invert()
453 REPORTER_ASSERT(reporter, !tinyScalePerspective.invert(&inverse)); in test_invert()
456 static void test_transpose(skiatest::Reporter* reporter) { in test_transpose() argument
469 REPORTER_ASSERT(reporter, nearly_equal(a, b)); in test_transpose()
472 static void test_get_set_double(skiatest::Reporter* reporter) { in test_get_set_double() argument
477 REPORTER_ASSERT(reporter, in test_get_set_double()
481 REPORTER_ASSERT(reporter, in test_get_set_double()
504 static void test_set_row_col_major(skiatest::Reporter* reporter) { in test_set_row_col_major() argument
518 REPORTER_ASSERT(reporter, nearly_equal(a, b)); in test_set_row_col_major()
521 REPORTER_ASSERT(reporter, nearly_equal(a, b)); in test_set_row_col_major()
524 REPORTER_ASSERT(reporter, nearly_equal(a, b)); in test_set_row_col_major()
527 REPORTER_ASSERT(reporter, nearly_equal(a, b)); in test_set_row_col_major()
530 static void test_3x3_conversion(skiatest::Reporter* reporter) { in test_3x3_conversion() argument
548 REPORTER_ASSERT(reporter, expected33 == a33); in test_3x3_conversion()
553 REPORTER_ASSERT(reporter, nearly_equal(a44flattened, expected44flattened)); in test_3x3_conversion()
565 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[0], vec3transformed[0])); in test_3x3_conversion()
566 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[1], vec3transformed[1])); in test_3x3_conversion()
567 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[3], vec3transformed[2])); in test_3x3_conversion()
568 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[0], vec4transformed2[0])); in test_3x3_conversion()
569 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[1], vec4transformed2[1])); in test_3x3_conversion()
570 REPORTER_ASSERT(reporter, !nearly_equal_scalar(vec4transformed[2], vec4transformed2[2])); in test_3x3_conversion()
571 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[3], vec4transformed2[3])); in test_3x3_conversion()
574 static void test_has_perspective(skiatest::Reporter* reporter) { in test_has_perspective() argument
578 REPORTER_ASSERT(reporter, transform.hasPerspective()); in test_has_perspective()
581 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()
596 REPORTER_ASSERT(reporter, transform.hasPerspective()); in test_has_perspective()
600 REPORTER_ASSERT(reporter, transform.hasPerspective()); in test_has_perspective()
626 static bool empirically_preserves_2d_axis_alignment(skiatest::Reporter* reporter, in empirically_preserves_2d_axis_alignment() argument
633 REPORTER_ASSERT(reporter, is_rectilinear(p1, p2, p3, p4)); in empirically_preserves_2d_axis_alignment()
643 static void test(bool expected, skiatest::Reporter* reporter, const SkMatrix44& transform) { in test() argument
645 REPORTER_ASSERT(reporter, empirically_preserves_2d_axis_alignment(reporter, transform)); in test()
646 REPORTER_ASSERT(reporter, transform.preserves2dAxisAlignment()); in test()
648 REPORTER_ASSERT(reporter, !empirically_preserves_2d_axis_alignment(reporter, transform)); in test()
649 REPORTER_ASSERT(reporter, !transform.preserves2dAxisAlignment()); in test()
653 static void test_preserves_2d_axis_alignment(skiatest::Reporter* reporter) { in test_preserves_2d_axis_alignment() argument
704 test(value.expected, reporter, transform); in test_preserves_2d_axis_alignment()
726 test(value.expected, reporter, transform); in test_preserves_2d_axis_alignment()
752 test(false, reporter, transform); in test_preserves_2d_axis_alignment()
773 test(value.expected, reporter, transform); in test_preserves_2d_axis_alignment()
797 test(value.expected, reporter, transform); in test_preserves_2d_axis_alignment()
805 test(false, reporter, transform); in test_preserves_2d_axis_alignment()
811 test(true, reporter, transform); in test_preserves_2d_axis_alignment()
815 static void test_toint(skiatest::Reporter* reporter) { in test_toint() argument
825 REPORTER_ASSERT(reporter, sum >= 0); in test_toint()
826 REPORTER_ASSERT(reporter, isum >= 0); in test_toint()
827 REPORTER_ASSERT(reporter, static_cast<SkMScalar>(isum) == SkIntToMScalar(isum)); in test_toint()
830 DEF_TEST(Matrix44, reporter) { in DEF_TEST() argument
840 REPORTER_ASSERT(reporter, is_identity(iden1)); in DEF_TEST()
845 REPORTER_ASSERT(reporter, is_identity(iden1)); in DEF_TEST()
850 REPORTER_ASSERT(reporter, is_identity(iden1)); in DEF_TEST()
855 REPORTER_ASSERT(reporter, mat.invert(nullptr)); in DEF_TEST()
858 REPORTER_ASSERT(reporter, is_identity(iden1)); in DEF_TEST()
860 REPORTER_ASSERT(reporter, is_identity(iden2)); in DEF_TEST()
869 REPORTER_ASSERT(reporter, mat.invert(nullptr)); in DEF_TEST()
872 REPORTER_ASSERT(reporter, is_identity(iden1)); in DEF_TEST()
884 REPORTER_ASSERT(reporter, mat.invert(nullptr)); in DEF_TEST()
887 REPORTER_ASSERT(reporter, is_identity(iden1)); in DEF_TEST()
892 REPORTER_ASSERT(reporter, !mat.invert(nullptr)); in DEF_TEST()
901 assert16<float>(reporter, dataf, in DEF_TEST()
907 assert16<double>(reporter, datad, 1, 0, 0, 0, in DEF_TEST()
912 assert16<float>(reporter, dataf, 1, 0, 0, 2, in DEF_TEST()
917 assert16<double>(reporter, datad, 1, 0, 0, 2, in DEF_TEST()
923 test_concat(reporter); in DEF_TEST()
926 test_common_angles(reporter); in DEF_TEST()
929 test_constructor(reporter); in DEF_TEST()
930 test_gettype(reporter); in DEF_TEST()
931 test_determinant(reporter); in DEF_TEST()
932 test_invert(reporter); in DEF_TEST()
933 test_transpose(reporter); in DEF_TEST()
934 test_get_set_double(reporter); in DEF_TEST()
935 test_set_row_col_major(reporter); in DEF_TEST()
936 test_set_3x3(reporter); in DEF_TEST()
937 test_translate(reporter); in DEF_TEST()
938 test_scale(reporter); in DEF_TEST()
939 test_map2(reporter); in DEF_TEST()
940 test_3x3_conversion(reporter); in DEF_TEST()
941 test_has_perspective(reporter); in DEF_TEST()
942 test_preserves_2d_axis_alignment(reporter); in DEF_TEST()
943 test_toint(reporter); in DEF_TEST()