OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "platform/geometry/GeometryTestHelpers.h" | 5 #include "platform/geometry/GeometryTestHelpers.h" |
6 | 6 |
| 7 #include <math.h> |
7 #include <limits> | 8 #include <limits> |
8 #include <math.h> | |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 namespace GeometryTest { | 11 namespace GeometryTest { |
12 | 12 |
13 bool ApproximatelyEqual(float a, float b, float testEpsilon) { | 13 bool ApproximatelyEqual(float a, float b, float testEpsilon) { |
14 float absA = ::fabs(a); | 14 float absA = ::fabs(a); |
15 float absB = ::fabs(b); | 15 float absB = ::fabs(b); |
16 float absErr = ::fabs(a - b); | 16 float absErr = ::fabs(a - b); |
17 if (a == b) | 17 if (a == b) |
18 return true; | 18 return true; |
(...skipping 16 matching lines...) Expand all Loading... |
35 << std::endl | 35 << std::endl |
36 << "Expected Approx:" << expected_expr << std::endl | 36 << "Expected Approx:" << expected_expr << std::endl |
37 << " Which is:" << ::testing::PrintToString(expected); | 37 << " Which is:" << ::testing::PrintToString(expected); |
38 } | 38 } |
39 | 39 |
40 return ::testing::AssertionSuccess(); | 40 return ::testing::AssertionSuccess(); |
41 } | 41 } |
42 | 42 |
43 } // namespace GeometryTest | 43 } // namespace GeometryTest |
44 } // namespace blink | 44 } // namespace blink |
OLD | NEW |