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 "ui/gfx/point3_f.h" | |
6 | |
7 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 #include "ui/gfx/geometry/point3_f.h" |
9 | 8 |
10 namespace gfx { | 9 namespace gfx { |
11 | 10 |
12 TEST(Point3Test, VectorArithmetic) { | 11 TEST(Point3Test, VectorArithmetic) { |
13 gfx::Point3F a(1.6f, 5.1f, 3.2f); | 12 gfx::Point3F a(1.6f, 5.1f, 3.2f); |
14 gfx::Vector3dF v1(3.1f, -3.2f, 9.3f); | 13 gfx::Vector3dF v1(3.1f, -3.2f, 9.3f); |
15 gfx::Vector3dF v2(-8.1f, 1.2f, 3.3f); | 14 gfx::Vector3dF v2(-8.1f, 1.2f, 3.3f); |
16 | 15 |
17 static const struct { | 16 static const struct { |
18 gfx::Point3F expected; | 17 gfx::Point3F expected; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 zero.Scale(6.f, 3.f, 1.5f); | 60 zero.Scale(6.f, 3.f, 1.5f); |
62 EXPECT_EQ(Point3F().ToString(), zero.ToString()); | 61 EXPECT_EQ(Point3F().ToString(), zero.ToString()); |
63 | 62 |
64 Point3F point(1.f, -1.f, 2.f); | 63 Point3F point(1.f, -1.f, 2.f); |
65 point.Scale(2.f); | 64 point.Scale(2.f); |
66 point.Scale(6.f, 3.f, 1.5f); | 65 point.Scale(6.f, 3.f, 1.5f); |
67 EXPECT_EQ(Point3F(12.f, -6.f, 6.f).ToString(), point.ToString()); | 66 EXPECT_EQ(Point3F(12.f, -6.f, 6.f).ToString(), point.ToString()); |
68 } | 67 } |
69 | 68 |
70 } // namespace gfx | 69 } // namespace gfx |
OLD | NEW |