OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
12 * | 12 * |
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y | 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y |
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y | 16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y |
17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N | 19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N |
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 */ | 23 */ |
24 | 24 |
25 #ifndef CCLayerTreeTestCommon_h | 25 #ifndef CCLayerTreeTestCommon_h |
26 #define CCLayerTreeTestCommon_h | 26 #define CCLayerTreeTestCommon_h |
27 | 27 |
28 namespace WebKitTests { | 28 namespace WebKitTests { |
29 | 29 |
30 // This is a macro instead of function so that we get useful line numbers where
a test failed. | 30 // These are macros instead of functions so that we get useful line numbers wher
e a test failed. |
31 #define EXPECT_FLOAT_RECT_EQ(expected, actual) \ | 31 #define EXPECT_FLOAT_RECT_EQ(expected, actual) \ |
32 EXPECT_FLOAT_EQ((expected).location().x(), (actual).location().x()); \ | 32 EXPECT_FLOAT_EQ((expected).location().x(), (actual).location().x()); \ |
33 EXPECT_FLOAT_EQ((expected).location().y(), (actual).location().y()); \ | 33 EXPECT_FLOAT_EQ((expected).location().y(), (actual).location().y()); \ |
34 EXPECT_FLOAT_EQ((expected).size().width(), (actual).size().width()); \ | 34 EXPECT_FLOAT_EQ((expected).size().width(), (actual).size().width()); \ |
35 EXPECT_FLOAT_EQ((expected).size().height(), (actual).size().height()) | 35 EXPECT_FLOAT_EQ((expected).size().height(), (actual).size().height()) |
36 | 36 |
| 37 #define EXPECT_INT_RECT_EQ(expected, actual) \ |
| 38 EXPECT_EQ((expected).location().x(), (actual).location().x()); \ |
| 39 EXPECT_EQ((expected).location().y(), (actual).location().y()); \ |
| 40 EXPECT_EQ((expected).size().width(), (actual).size().width()); \ |
| 41 EXPECT_EQ((expected).size().height(), (actual).size().height()) |
| 42 |
37 // This is a macro instead of a function so that we get useful line numbers wher
e a test failed. | 43 // This is a macro instead of a function so that we get useful line numbers wher
e a test failed. |
38 // Even though TransformationMatrix values are double precision, there are many
other floating-point values used that affect | 44 // Even though TransformationMatrix values are double precision, there are many
other floating-point values used that affect |
39 // the transforms, and so we only expect them to be accurate up to floating-poin
t precision. | 45 // the transforms, and so we only expect them to be accurate up to floating-poin
t precision. |
40 #define EXPECT_TRANSFORMATION_MATRIX_EQ(expected, actual) \ | 46 #define EXPECT_TRANSFORMATION_MATRIX_EQ(expected, actual) \ |
41 EXPECT_FLOAT_EQ((expected).m11(), (actual).m11()); \ | 47 EXPECT_FLOAT_EQ((expected).m11(), (actual).m11()); \ |
42 EXPECT_FLOAT_EQ((expected).m12(), (actual).m12()); \ | 48 EXPECT_FLOAT_EQ((expected).m12(), (actual).m12()); \ |
43 EXPECT_FLOAT_EQ((expected).m13(), (actual).m13()); \ | 49 EXPECT_FLOAT_EQ((expected).m13(), (actual).m13()); \ |
44 EXPECT_FLOAT_EQ((expected).m14(), (actual).m14()); \ | 50 EXPECT_FLOAT_EQ((expected).m14(), (actual).m14()); \ |
45 EXPECT_FLOAT_EQ((expected).m21(), (actual).m21()); \ | 51 EXPECT_FLOAT_EQ((expected).m21(), (actual).m21()); \ |
46 EXPECT_FLOAT_EQ((expected).m22(), (actual).m22()); \ | 52 EXPECT_FLOAT_EQ((expected).m22(), (actual).m22()); \ |
47 EXPECT_FLOAT_EQ((expected).m23(), (actual).m23()); \ | 53 EXPECT_FLOAT_EQ((expected).m23(), (actual).m23()); \ |
48 EXPECT_FLOAT_EQ((expected).m24(), (actual).m24()); \ | 54 EXPECT_FLOAT_EQ((expected).m24(), (actual).m24()); \ |
49 EXPECT_FLOAT_EQ((expected).m31(), (actual).m31()); \ | 55 EXPECT_FLOAT_EQ((expected).m31(), (actual).m31()); \ |
50 EXPECT_FLOAT_EQ((expected).m32(), (actual).m32()); \ | 56 EXPECT_FLOAT_EQ((expected).m32(), (actual).m32()); \ |
51 EXPECT_FLOAT_EQ((expected).m33(), (actual).m33()); \ | 57 EXPECT_FLOAT_EQ((expected).m33(), (actual).m33()); \ |
52 EXPECT_FLOAT_EQ((expected).m34(), (actual).m34()); \ | 58 EXPECT_FLOAT_EQ((expected).m34(), (actual).m34()); \ |
53 EXPECT_FLOAT_EQ((expected).m41(), (actual).m41()); \ | 59 EXPECT_FLOAT_EQ((expected).m41(), (actual).m41()); \ |
54 EXPECT_FLOAT_EQ((expected).m42(), (actual).m42()); \ | 60 EXPECT_FLOAT_EQ((expected).m42(), (actual).m42()); \ |
55 EXPECT_FLOAT_EQ((expected).m43(), (actual).m43()); \ | 61 EXPECT_FLOAT_EQ((expected).m43(), (actual).m43()); \ |
56 EXPECT_FLOAT_EQ((expected).m44(), (actual).m44()) | 62 EXPECT_FLOAT_EQ((expected).m44(), (actual).m44()) |
57 | 63 |
58 } // namespace | 64 } // namespace |
59 | 65 |
60 #endif // CCLayerTreeTestCommon_h | 66 #endif // CCLayerTreeTestCommon_h |
OLD | NEW |