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