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

Side by Side Diff: ui/gfx/animation/tween_unittest.cc

Issue 1543183002: Switch to standard integer types in ui/gfx/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « ui/gfx/animation/tween.cc ('k') | ui/gfx/blit.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/animation/tween.h" 5 #include "ui/gfx/animation/tween.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "build/build_config.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "ui/gfx/test/gfx_util.h"
12
9 #if defined(OS_WIN) 13 #if defined(OS_WIN)
10 #include <float.h> 14 #include <float.h>
11 #endif 15 #endif
12 16
13 #include "testing/gtest/include/gtest/gtest.h"
14 #include "ui/gfx/test/gfx_util.h"
15
16 namespace gfx { 17 namespace gfx {
17 namespace { 18 namespace {
18 19
19 double next_double(double d) { 20 double next_double(double d) {
20 #if defined(OS_WIN) 21 #if defined(OS_WIN)
21 return _nextafter(d, d + 1); 22 return _nextafter(d, d + 1);
22 #else 23 #else
23 // Step two units of least precision towards positive infinity. On some 32 24 // Step two units of least precision towards positive infinity. On some 32
24 // bit x86 compilers a single step was not enough due to loss of precision in 25 // bit x86 compilers a single step was not enough due to loss of precision in
25 // optimized code. 26 // optimized code.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 EXPECT_EQ(-1, Tween::LinearIntValueBetween(2.5 / 4.0, -2, 0)); 131 EXPECT_EQ(-1, Tween::LinearIntValueBetween(2.5 / 4.0, -2, 0));
131 EXPECT_EQ(-1, Tween::LinearIntValueBetween(2.99 / 4.0, -2, 0)); 132 EXPECT_EQ(-1, Tween::LinearIntValueBetween(2.99 / 4.0, -2, 0));
132 133
133 EXPECT_EQ(0, Tween::LinearIntValueBetween(3.0 / 4.0, -2, 0)); 134 EXPECT_EQ(0, Tween::LinearIntValueBetween(3.0 / 4.0, -2, 0));
134 EXPECT_EQ(0, Tween::LinearIntValueBetween(3.5 / 4.0, -2, 0)); 135 EXPECT_EQ(0, Tween::LinearIntValueBetween(3.5 / 4.0, -2, 0));
135 EXPECT_EQ(0, Tween::LinearIntValueBetween(4.0 / 4.0, -2, 0)); 136 EXPECT_EQ(0, Tween::LinearIntValueBetween(4.0 / 4.0, -2, 0));
136 } 137 }
137 138
138 } // namespace 139 } // namespace
139 } // namespace gfx 140 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/animation/tween.cc ('k') | ui/gfx/blit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698