Home | History | Annotate | Download | only in tests

Lines Matching full: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());
109 static void test_translate(skiatest::Reporter* reporter) {
114 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kIdentity_Mask));
116 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kTranslate_Mask));
117 REPORTER_ASSERT(reporter, mat.invert(&inverse));
118 REPORTER_ASSERT(reporter, bits_isonly(inverse.getType(), SkMatrix44::kTranslate_Mask));
129 REPORTER_ASSERT(reporter, mat == c);
134 REPORTER_ASSERT(reporter, mat == c);
137 static void test_scale(skiatest::Reporter* reporter) {
142 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kIdentity_Mask));
144 REPORTER_ASSERT(reporter, bits_isonly(mat.getType(), SkMatrix44::kScale_Mask));
145 REPORTER_ASSERT(reporter, mat.invert(&inverse));
146 REPORTER_ASSERT(reporter, bits_isonly(inverse.getType(), SkMatrix44::kScale_Mask));
157 REPORTER_ASSERT(reporter, mat == c);
162 REPORTER_ASSERT(reporter, mat == c);
189 static void test_map2(skiatest::Reporter* reporter, const SkMatrix44& mat) {
203 REPORTER_ASSERT(reporter, dstA[i] == dstB[i]);
207 static void test_map2(skiatest::Reporter* reporter) {
212 test_map2(reporter, mat);
216 static void test_gettype(skiatest::Reporter* reporter) {
219 REPORTER_ASSERT(reporter, matrix.isIdentity());
220 REPORTER_ASSERT(reporter, SkMatrix44::kIdentity_Mask == matrix.getType());
226 REPORTER_ASSERT(reporter, matrix.getType() == expectedMask);
230 REPORTER_ASSERT(reporter, matrix.getType() == expectedMask);
234 REPORTER_ASSERT(reporter, matrix.getType() == expectedMask);
237 REPORTER_ASSERT(reporter, matrix.getType() & SkMatrix44::kPerspective_Mask);
244 REPORTER_ASSERT(reporter, matrix.isIdentity());
246 REPORTER_ASSERT(reporter, matrix.isIdentity());
248 REPORTER_ASSERT(reporter, matrix.isIdentity());
251 static void test_common_angles(skiatest::Reporter* reporter) {
259 REPORTER_ASSERT(reporter, rot3x3.rectStaysRect());
263 static void test_concat(skiatest::Reporter* reporter) {
283 REPORTER_ASSERT(reporter, d == c);
287 REPORTER_ASSERT(reporter, 10 == dst[i]);
288 REPORTER_ASSERT(reporter, 12 == dst[i + 4]);
295 REPORTER_ASSERT(reporter, d == c);
299 REPORTER_ASSERT(reporter, 20 == dst[i]);
300 REPORTER_ASSERT(reporter, 22 == dst[i + 4]);
304 static void test_determinant(skiatest::Reporter* reporter) {
306 REPORTER_ASSERT(reporter, nearly_equal_double(1, a.determinant()));
308 REPORTER_ASSERT(reporter, nearly_equal_double(2, a.determinant()));
310 REPORTER_ASSERT(reporter, a.invert(&b));
311 REPORTER_ASSERT(reporter, nearly_equal_double(0.5, b.determinant()));
315 REPORTER_ASSERT(reporter,
320 REPORTER_ASSERT(reporter, nearly_equal_double(16, d.determinant()));
324 REPORTER_ASSERT(reporter, nearly_equal_double(32, e.determinant()));
326 REPORTER_ASSERT(reporter, nearly_equal_double(0, e.determinant()));
329 static void test_invert(skiatest::Reporter* reporter) {
336 assert16<double>(reporter, inverseData,
346 assert16<double>(reporter, inverseData,
356 assert16<double>(reporter, inverseData,
367 assert16<double>(reporter, inverseData,
383 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse));
396 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse));
407 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse));
420 REPORTER_ASSERT(reporter, nearly_equal(expected, inverse));
423 static void test_transpose(skiatest::Reporter* reporter) {
436 REPORTER_ASSERT(reporter, nearly_equal(a, b));
439 static void test_get_set_double(skiatest::Reporter* reporter) {
444 REPORTER_ASSERT(reporter,
448 REPORTER_ASSERT(reporter,
454 static void test_set_row_col_major(skiatest::Reporter* reporter) {
468 REPORTER_ASSERT(reporter, nearly_equal(a, b));
471 REPORTER_ASSERT(reporter, nearly_equal(a, b));
474 REPORTER_ASSERT(reporter, nearly_equal(a, b));
477 REPORTER_ASSERT(reporter, nearly_equal(a, b));
480 static void test_3x3_conversion(skiatest::Reporter* reporter) {
498 REPORTER_ASSERT(reporter, expected33 == a33);
503 REPORTER_ASSERT(reporter, nearly_equal(a44flattened, expected44flattened));
515 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[0], vec3transformed[0]));
516 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[1], vec3transformed[1]));
517 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[3], vec3transformed[2]));
518 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[0], vec4transformed2[0]));
519 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[1], vec4transformed2[1]));
520 REPORTER_ASSERT(reporter, !nearly_equal_scalar(vec4transformed[2], vec4transformed2[2]));
521 REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[3], vec4transformed2[3]));
524 DEF_TEST(Matrix44, reporter) {
534 REPORTER_ASSERT(reporter, is_identity(iden1));
539 REPORTER_ASSERT(reporter, is_identity(iden1));
544 REPORTER_ASSERT(reporter, is_identity(iden1));
549 REPORTER_ASSERT(reporter, mat.invert(NULL));
552 REPORTER_ASSERT(reporter, is_identity(iden1));
554 REPORTER_ASSERT(reporter, is_identity(iden2));
562 REPORTER_ASSERT(reporter, mat.invert(NULL));
565 REPORTER_ASSERT(reporter, is_identity(iden1));
573 REPORTER_ASSERT(reporter, mat.invert(NULL));
576 REPORTER_ASSERT(reporter, is_identity(iden1));
581 REPORTER_ASSERT(reporter, !mat.invert(NULL));
590 assert16<float>(reporter, dataf,
596 assert16<double>(reporter, datad, 1, 0, 0, 0,
601 assert16<float>(reporter, dataf, 1, 0, 0, 2,
606 assert16<double>(reporter, datad, 1, 0, 0, 2,
612 test_concat(reporter);
615 test_common_angles(reporter);
618 test_constructor(reporter);
619 test_gettype(reporter);
620 test_determinant(reporter);
621 test_invert(reporter);
622 test_transpose(reporter);
623 test_get_set_double(reporter);
624 test_set_row_col_major(reporter);
625 test_translate(reporter);
626 test_scale(reporter);
627 test_map2(reporter);
628 test_3x3_conversion(reporter);