| 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 22 matching lines...) Expand all Loading... |
| 33 EXPECT_EQ((expected).width(), (actual).width()); \ | 33 EXPECT_EQ((expected).width(), (actual).width()); \ |
| 34 EXPECT_EQ((expected).height(), (actual).height()); \ | 34 EXPECT_EQ((expected).height(), (actual).height()); \ |
| 35 } while (false) | 35 } while (false) |
| 36 | 36 |
| 37 #define EXPECT_POINT_EQ(expected, actual) \ | 37 #define EXPECT_POINT_EQ(expected, actual) \ |
| 38 do { \ | 38 do { \ |
| 39 EXPECT_EQ((expected).x(), (actual).x()); \ | 39 EXPECT_EQ((expected).x(), (actual).x()); \ |
| 40 EXPECT_EQ((expected).y(), (actual).y()); \ | 40 EXPECT_EQ((expected).y(), (actual).y()); \ |
| 41 } while (false) | 41 } while (false) |
| 42 | 42 |
| 43 #define EXPECT_POINT3F_EQ(expected, actual) \ |
| 44 do { \ |
| 45 EXPECT_FLOAT_EQ((expected).x(), (actual).x()); \ |
| 46 EXPECT_FLOAT_EQ((expected).y(), (actual).y()); \ |
| 47 EXPECT_FLOAT_EQ((expected).z(), (actual).z()); \ |
| 48 } while (false) |
| 49 |
| 43 #define EXPECT_VECTOR_EQ(expected, actual) \ | 50 #define EXPECT_VECTOR_EQ(expected, actual) \ |
| 44 do { \ | 51 do { \ |
| 45 EXPECT_EQ((expected).x(), (actual).x()); \ | 52 EXPECT_EQ((expected).x(), (actual).x()); \ |
| 46 EXPECT_EQ((expected).y(), (actual).y()); \ | 53 EXPECT_EQ((expected).y(), (actual).y()); \ |
| 47 } while (false) | 54 } while (false) |
| 48 | 55 |
| 49 #define EXPECT_FLOAT_ARRAY_EQ(expected, actual, count) \ | 56 #define EXPECT_FLOAT_ARRAY_EQ(expected, actual, count) \ |
| 50 do { \ | 57 do { \ |
| 51 for (int i = 0; i < count; i++) {\ | 58 for (int i = 0; i < count; i++) {\ |
| 52 EXPECT_FLOAT_EQ((expected)[i], (actual)[i]); \ | 59 EXPECT_FLOAT_EQ((expected)[i], (actual)[i]); \ |
| (...skipping 13 matching lines...) Expand all Loading... |
| 66 cc::ExpectTransformationMatrixEq(expected, actual); \ | 73 cc::ExpectTransformationMatrixEq(expected, actual); \ |
| 67 } | 74 } |
| 68 | 75 |
| 69 // Should be used in test code only, for convenience. Production code should use | 76 // Should be used in test code only, for convenience. Production code should use |
| 70 // the gfx::Transform::GetInverse() API. | 77 // the gfx::Transform::GetInverse() API. |
| 71 gfx::Transform inverse(const gfx::Transform& transform); | 78 gfx::Transform inverse(const gfx::Transform& transform); |
| 72 | 79 |
| 73 } // namespace cc | 80 } // namespace cc |
| 74 | 81 |
| 75 #endif // CC_TEST_GEOMETRY_TEST_UTILS_H_ | 82 #endif // CC_TEST_GEOMETRY_TEST_UTILS_H_ |
| OLD | NEW |