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 <cmath> | 5 #include <cmath> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/gfx/vector2d.h" | 10 #include "ui/gfx/geometry/vector2d.h" |
11 #include "ui/gfx/vector2d_f.h" | 11 #include "ui/gfx/geometry/vector2d_f.h" |
12 | 12 |
13 namespace gfx { | 13 namespace gfx { |
14 | 14 |
15 TEST(Vector2dTest, ConversionToFloat) { | 15 TEST(Vector2dTest, ConversionToFloat) { |
16 Vector2d i(3, 4); | 16 Vector2d i(3, 4); |
17 Vector2dF f = i; | 17 Vector2dF f = i; |
18 EXPECT_EQ(i, f); | 18 EXPECT_EQ(i, f); |
19 } | 19 } |
20 | 20 |
21 TEST(Vector2dTest, IsZero) { | 21 TEST(Vector2dTest, IsZero) { |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 EXPECT_EQ(Vector2dF(8.5f, 10.5f).ToString(), a.ToString()); | 241 EXPECT_EQ(Vector2dF(8.5f, 10.5f).ToString(), a.ToString()); |
242 a.SetToMin(Vector2dF(11.5f, 9.5f)); | 242 a.SetToMin(Vector2dF(11.5f, 9.5f)); |
243 EXPECT_EQ(Vector2dF(8.5f, 9.5f).ToString(), a.ToString()); | 243 EXPECT_EQ(Vector2dF(8.5f, 9.5f).ToString(), a.ToString()); |
244 a.SetToMin(Vector2dF(7.5f, 11.5f)); | 244 a.SetToMin(Vector2dF(7.5f, 11.5f)); |
245 EXPECT_EQ(Vector2dF(7.5f, 9.5f).ToString(), a.ToString()); | 245 EXPECT_EQ(Vector2dF(7.5f, 9.5f).ToString(), a.ToString()); |
246 a.SetToMin(Vector2dF(3.5f, 5.5f)); | 246 a.SetToMin(Vector2dF(3.5f, 5.5f)); |
247 EXPECT_EQ(Vector2dF(3.5f, 5.5f).ToString(), a.ToString()); | 247 EXPECT_EQ(Vector2dF(3.5f, 5.5f).ToString(), a.ToString()); |
248 } | 248 } |
249 | 249 |
250 } // namespace gfx | 250 } // namespace gfx |
OLD | NEW |