Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(685)

Side by Side Diff: ui/gfx/point_unittest.cc

Issue 11028127: Implicit coversion operators from integer geometry types to floating point. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/point_f.h ('k') | ui/gfx/rect.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/gfx/point_base.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/gfx/point.h"
9 #include "ui/gfx/point_f.h"
10
11 namespace ui {
12
13 static int test_pointf(const gfx::PointF& p) {
14 return p.x();
15 }
16
17 TEST(PointTest, ToPointF) {
18 // Check that implicit conversion from integer to float compiles.
19 gfx::Point a(10, 20);
20 float x = test_pointf(a);
21 EXPECT_EQ(x, a.x());
22
23 gfx::PointF b(10, 20);
24 bool equals = a == b;
25 EXPECT_EQ(true, equals);
26
27 equals = b == a;
28 EXPECT_EQ(true, equals);
29 }
30
31 } // namespace ui
OLDNEW
« no previous file with comments | « ui/gfx/point_f.h ('k') | ui/gfx/rect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698