| Index: cc/test/geometry_test_utils.h
|
| diff --git a/cc/test/geometry_test_utils.h b/cc/test/geometry_test_utils.h
|
| index 6e015131fa7d676dd378130cc2ff279e10b9657a..1d32428261306e1459402c16d0c721d9b1ea3b50 100644
|
| --- a/cc/test/geometry_test_utils.h
|
| +++ b/cc/test/geometry_test_utils.h
|
| @@ -5,6 +5,8 @@
|
| #ifndef CC_TEST_GEOMETRY_TEST_UTILS_H_
|
| #define CC_TEST_GEOMETRY_TEST_UTILS_H_
|
|
|
| +#include "cc/cc_export.h"
|
| +
|
| namespace gfx {
|
| class Transform;
|
| }
|
| @@ -63,6 +65,20 @@ namespace cc {
|
| EXPECT_NEAR((expected).y(), (actual).y(), (abs_error)); \
|
| } while (false)
|
|
|
| +#define EXPECT_VECTOR3DF_EQ(expected, actual) \
|
| + do { \
|
| + EXPECT_FLOAT_EQ((expected).x(), (actual).x()); \
|
| + EXPECT_FLOAT_EQ((expected).y(), (actual).y()); \
|
| + EXPECT_FLOAT_EQ((expected).z(), (actual).z()); \
|
| + } while (false)
|
| +
|
| +#define EXPECT_VECTOR3DF_NEAR(expected, actual, abs_error) \
|
| + do { \
|
| + EXPECT_NEAR((expected).x(), (actual).x(), (abs_error)); \
|
| + EXPECT_NEAR((expected).y(), (actual).y(), (abs_error)); \
|
| + EXPECT_NEAR((expected).z(), (actual).z(), (abs_error)); \
|
| + } while (false)
|
| +
|
| #define EXPECT_FLOAT_ARRAY_EQ(expected, actual, count) \
|
| do { \
|
| for (int i = 0; i < count; i++) { \
|
| @@ -87,8 +103,8 @@ namespace cc {
|
| // problem exists with both gcc and clang, and bugs have been filed at
|
| // http://llvm.org/bugs/show_bug.cgi?id=13651
|
| // and http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54337
|
| -void ExpectTransformationMatrixEq(const gfx::Transform& expected,
|
| - const gfx::Transform& actual);
|
| +void CC_EXPORT ExpectTransformationMatrixEq(const gfx::Transform& expected,
|
| + const gfx::Transform& actual);
|
|
|
| #define EXPECT_TRANSFORMATION_MATRIX_EQ(expected, actual) \
|
| do { \
|
| @@ -96,6 +112,16 @@ void ExpectTransformationMatrixEq(const gfx::Transform& expected,
|
| ExpectTransformationMatrixEq(expected, actual); \
|
| } while (false)
|
|
|
| +void CC_EXPORT ExpectTransformationMatrixNear(const gfx::Transform& expected,
|
| + const gfx::Transform& actual,
|
| + float abs_error);
|
| +
|
| +#define EXPECT_TRANSFORMATION_MATRIX_NEAR(expected, actual, abs_error) \
|
| + do { \
|
| + SCOPED_TRACE(""); \
|
| + ExpectTransformationMatrixNear(expected, actual, abs_error); \
|
| + } while (false)
|
| +
|
| // Should be used in test code only, for convenience. Production code should use
|
| // the gfx::Transform::GetInverse() API.
|
| gfx::Transform Inverse(const gfx::Transform& transform);
|
|
|