OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_TEST_GEOMETRY_TEST_UTILS_H_ | 5 #ifndef CC_TEST_GEOMETRY_TEST_UTILS_H_ |
6 #define CC_TEST_GEOMETRY_TEST_UTILS_H_ | 6 #define CC_TEST_GEOMETRY_TEST_UTILS_H_ |
7 | 7 |
8 namespace gfx { | 8 namespace gfx { |
9 class Transform; | 9 class Transform; |
10 } | 10 } |
(...skipping 11 matching lines...) Expand all Loading... |
22 } while (false) | 22 } while (false) |
23 | 23 |
24 #define EXPECT_RECT_NEAR(expected, actual, abs_error) \ | 24 #define EXPECT_RECT_NEAR(expected, actual, abs_error) \ |
25 do { \ | 25 do { \ |
26 EXPECT_NEAR((expected).x(), (actual).x(), (abs_error)); \ | 26 EXPECT_NEAR((expected).x(), (actual).x(), (abs_error)); \ |
27 EXPECT_NEAR((expected).y(), (actual).y(), (abs_error)); \ | 27 EXPECT_NEAR((expected).y(), (actual).y(), (abs_error)); \ |
28 EXPECT_NEAR((expected).width(), (actual).width(), (abs_error)); \ | 28 EXPECT_NEAR((expected).width(), (actual).width(), (abs_error)); \ |
29 EXPECT_NEAR((expected).height(), (actual).height(), (abs_error)); \ | 29 EXPECT_NEAR((expected).height(), (actual).height(), (abs_error)); \ |
30 } while (false) | 30 } while (false) |
31 | 31 |
| 32 #define EXPECT_POINT3F_EQ(expected, actual) \ |
| 33 do { \ |
| 34 EXPECT_FLOAT_EQ((expected).x(), (actual).x()); \ |
| 35 EXPECT_FLOAT_EQ((expected).y(), (actual).y()); \ |
| 36 EXPECT_FLOAT_EQ((expected).z(), (actual).z()); \ |
| 37 } while (false) |
| 38 |
32 #define EXPECT_VECTOR_EQ(expected, actual) \ | 39 #define EXPECT_VECTOR_EQ(expected, actual) \ |
33 do { \ | 40 do { \ |
34 EXPECT_EQ((expected).x(), (actual).x()); \ | 41 EXPECT_EQ((expected).x(), (actual).x()); \ |
35 EXPECT_EQ((expected).y(), (actual).y()); \ | 42 EXPECT_EQ((expected).y(), (actual).y()); \ |
36 } while (false) | 43 } while (false) |
37 | 44 |
38 #define EXPECT_VECTOR2DF_EQ(expected, actual) \ | 45 #define EXPECT_VECTOR2DF_EQ(expected, actual) \ |
39 do { \ | 46 do { \ |
40 EXPECT_FLOAT_EQ((expected).x(), (actual).x()); \ | 47 EXPECT_FLOAT_EQ((expected).x(), (actual).x()); \ |
41 EXPECT_FLOAT_EQ((expected).y(), (actual).y()); \ | 48 EXPECT_FLOAT_EQ((expected).y(), (actual).y()); \ |
(...skipping 26 matching lines...) Expand all Loading... |
68 ExpectTransformationMatrixEq(expected, actual); \ | 75 ExpectTransformationMatrixEq(expected, actual); \ |
69 } while (false) | 76 } while (false) |
70 | 77 |
71 // Should be used in test code only, for convenience. Production code should use | 78 // Should be used in test code only, for convenience. Production code should use |
72 // the gfx::Transform::GetInverse() API. | 79 // the gfx::Transform::GetInverse() API. |
73 gfx::Transform Inverse(const gfx::Transform& transform); | 80 gfx::Transform Inverse(const gfx::Transform& transform); |
74 | 81 |
75 } // namespace cc | 82 } // namespace cc |
76 | 83 |
77 #endif // CC_TEST_GEOMETRY_TEST_UTILS_H_ | 84 #endif // CC_TEST_GEOMETRY_TEST_UTILS_H_ |
OLD | NEW |