OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "Test.h" | 8 #include "Test.h" |
9 #include "SkMatrix44.h" | 9 #include "SkMatrix44.h" |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 REPORTER_ASSERT(reporter, data[12] == m12); | 57 REPORTER_ASSERT(reporter, data[12] == m12); |
58 REPORTER_ASSERT(reporter, data[13] == m13); | 58 REPORTER_ASSERT(reporter, data[13] == m13); |
59 REPORTER_ASSERT(reporter, data[14] == m14); | 59 REPORTER_ASSERT(reporter, data[14] == m14); |
60 REPORTER_ASSERT(reporter, data[15] == m15); | 60 REPORTER_ASSERT(reporter, data[15] == m15); |
61 } | 61 } |
62 | 62 |
63 static bool nearly_equal(const SkMatrix44& a, const SkMatrix44& b) { | 63 static bool nearly_equal(const SkMatrix44& a, const SkMatrix44& b) { |
64 for (int i = 0; i < 4; ++i) { | 64 for (int i = 0; i < 4; ++i) { |
65 for (int j = 0; j < 4; ++j) { | 65 for (int j = 0; j < 4; ++j) { |
66 if (!nearly_equal_mscalar(a.get(i, j), b.get(i, j))) { | 66 if (!nearly_equal_mscalar(a.get(i, j), b.get(i, j))) { |
67 printf("not equal %g %g\n", a.get(i, j), b.get(i, j)); | 67 SkDebugf("not equal %g %g\n", a.get(i, j), b.get(i, j)); |
68 return false; | 68 return false; |
69 } | 69 } |
70 } | 70 } |
71 } | 71 } |
72 return true; | 72 return true; |
73 } | 73 } |
74 | 74 |
75 static bool is_identity(const SkMatrix44& m) { | 75 static bool is_identity(const SkMatrix44& m) { |
76 SkMatrix44 identity; | 76 SkMatrix44 identity; |
77 identity.reset(); | 77 identity.reset(); |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 test_get_set_double(reporter); | 620 test_get_set_double(reporter); |
621 test_set_row_col_major(reporter); | 621 test_set_row_col_major(reporter); |
622 test_translate(reporter); | 622 test_translate(reporter); |
623 test_scale(reporter); | 623 test_scale(reporter); |
624 test_map2(reporter); | 624 test_map2(reporter); |
625 test_3x3_conversion(reporter); | 625 test_3x3_conversion(reporter); |
626 } | 626 } |
627 | 627 |
628 #include "TestClassDef.h" | 628 #include "TestClassDef.h" |
629 DEFINE_TESTCLASS("Matrix44", Matrix44TestClass, TestMatrix44) | 629 DEFINE_TESTCLASS("Matrix44", Matrix44TestClass, TestMatrix44) |
OLD | NEW |