| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> |
| 6 |
| 5 #include <cmath> | 7 #include <cmath> |
| 6 #include <limits> | 8 #include <limits> |
| 7 | 9 |
| 8 #include "base/basictypes.h" | 10 #include "base/macros.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "ui/gfx/geometry/vector3d_f.h" | 12 #include "ui/gfx/geometry/vector3d_f.h" |
| 11 | 13 |
| 12 namespace gfx { | 14 namespace gfx { |
| 13 | 15 |
| 14 TEST(Vector3dTest, IsZero) { | 16 TEST(Vector3dTest, IsZero) { |
| 15 gfx::Vector3dF float_zero(0, 0, 0); | 17 gfx::Vector3dF float_zero(0, 0, 0); |
| 16 gfx::Vector3dF float_nonzero(0.1f, -0.1f, 0.1f); | 18 gfx::Vector3dF float_nonzero(0.1f, -0.1f, 0.1f); |
| 17 | 19 |
| 18 EXPECT_TRUE(float_zero.IsZero()); | 20 EXPECT_TRUE(float_zero.IsZero()); |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 EXPECT_FLOAT_EQ(tests[i].expected, actual); | 310 EXPECT_FLOAT_EQ(tests[i].expected, actual); |
| 309 actual = -gfx::ClockwiseAngleBetweenVectorsInDegrees( | 311 actual = -gfx::ClockwiseAngleBetweenVectorsInDegrees( |
| 310 tests[i].input2, tests[i].input1, normal_vector); | 312 tests[i].input2, tests[i].input1, normal_vector); |
| 311 if (actual < 0.0f) | 313 if (actual < 0.0f) |
| 312 actual += 360.0f; | 314 actual += 360.0f; |
| 313 EXPECT_FLOAT_EQ(tests[i].expected, actual); | 315 EXPECT_FLOAT_EQ(tests[i].expected, actual); |
| 314 } | 316 } |
| 315 } | 317 } |
| 316 | 318 |
| 317 } // namespace gfx | 319 } // namespace gfx |
| OLD | NEW |