Chromium Code Reviews| Index: ui/gfx/geometry/quaternion_unittest.cc |
| diff --git a/ui/gfx/geometry/quaternion_unittest.cc b/ui/gfx/geometry/quaternion_unittest.cc |
| index ef460151d37bbd1f0fe2f25234a2ced6aec97b71..cf9ea352bc0cb598d81d722530dd608f80939f0b 100644 |
| --- a/ui/gfx/geometry/quaternion_unittest.cc |
| +++ b/ui/gfx/geometry/quaternion_unittest.cc |
| @@ -142,16 +142,15 @@ TEST(QuatTest, SlerpOppositeAngles) { |
| Quaternion start(axis, start_radians); |
| Quaternion stop(axis, stop_radians); |
| - // When quaternions are pointed in the fully opposite direction, we take the |
| - // interpolated quaternion to be the first. This is arbitrary, but if we |
| - // change this policy, this test should fail. |
| - Quaternion expected = start; |
| - |
| - for (size_t i = 0; i < 100; ++i) { |
| - float t = static_cast<float>(i) / 100.0f; |
| - Quaternion interpolated = start.Slerp(stop, t); |
| - CompareQuaternions(expected, interpolated); |
| - } |
| + // When quaternions are pointed in the fully opposite direction, we rotate in |
| + // an arbitrary direction. |
|
danakj
2017/07/06 15:41:06
Do you not want to mention/link to spec stuff?
Ian Vollick
2017/07/06 15:45:59
Done.
|
| + Quaternion expected(axis, 0); |
| + |
| + Quaternion interpolated = start.Slerp(stop, 0.5f); |
| + EXPECT_NEAR(expected.x(), interpolated.x(), kEpsilon); |
| + EXPECT_NEAR(expected.y(), interpolated.y(), kEpsilon); |
| + EXPECT_NEAR(expected.z(), interpolated.z(), kEpsilon); |
| + EXPECT_NEAR(expected.w(), interpolated.w(), kEpsilon); |
| } |
| } // namespace gfx |