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

Side by Side Diff: ui/gfx/geometry/safe_integer_conversions_unittest.cc

Issue 109433013: Move geometric types to a separate, more lightweight target. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years 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 | Annotate | Revision Log
OLDNEW
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/safe_integer_conversions.h" 5 #include "ui/gfx/geometry/safe_integer_conversions.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace gfx { 11 namespace gfx {
12 12
13 TEST(SafeIntegerConversions, ClampToInt) { 13 TEST(SafeIntegerConversions, ClampToInt) {
14 EXPECT_EQ(0, ClampToInt(std::numeric_limits<float>::quiet_NaN())); 14 EXPECT_EQ(0, ClampToInt(std::numeric_limits<float>::quiet_NaN()));
15 15
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 EXPECT_EQ(100, ToRoundedInt(100.1f)); 100 EXPECT_EQ(100, ToRoundedInt(100.1f));
101 EXPECT_EQ(101, ToRoundedInt(100.5f)); 101 EXPECT_EQ(101, ToRoundedInt(100.5f));
102 EXPECT_EQ(101, ToRoundedInt(100.9f)); 102 EXPECT_EQ(101, ToRoundedInt(100.9f));
103 103
104 EXPECT_EQ(int_min, ToRoundedInt(-infinity)); 104 EXPECT_EQ(int_min, ToRoundedInt(-infinity));
105 EXPECT_EQ(int_min, ToRoundedInt(min)); 105 EXPECT_EQ(int_min, ToRoundedInt(min));
106 EXPECT_EQ(int_min, ToRoundedInt(min - 100)); 106 EXPECT_EQ(int_min, ToRoundedInt(min - 100));
107 } 107 }
108 108
109 } // namespace gfx 109 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698