OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/base/math_util.h" | 5 #include "cc/base/math_util.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include <cmath> | 9 #include <cmath> |
8 | 10 |
9 #include "cc/test/geometry_test_utils.h" | 11 #include "cc/test/geometry_test_utils.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "ui/gfx/geometry/rect.h" | 14 #include "ui/gfx/geometry/rect.h" |
13 #include "ui/gfx/geometry/rect_f.h" | 15 #include "ui/gfx/geometry/rect_f.h" |
14 #include "ui/gfx/transform.h" | 16 #include "ui/gfx/transform.h" |
15 | 17 |
16 namespace cc { | 18 namespace cc { |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 | 381 |
380 TEST(MathUtilTest, RoundDownUnderflow) { | 382 TEST(MathUtilTest, RoundDownUnderflow) { |
381 // Rounding down -123 by 50 is -150, which underflows int8_t, but fits in | 383 // Rounding down -123 by 50 is -150, which underflows int8_t, but fits in |
382 // int16_t. | 384 // int16_t. |
383 EXPECT_FALSE(MathUtil::VerifyRoundDown<int8_t>(-123, 50)); | 385 EXPECT_FALSE(MathUtil::VerifyRoundDown<int8_t>(-123, 50)); |
384 EXPECT_TRUE(MathUtil::VerifyRoundDown<int16_t>(-123, 50)); | 386 EXPECT_TRUE(MathUtil::VerifyRoundDown<int16_t>(-123, 50)); |
385 } | 387 } |
386 | 388 |
387 } // namespace | 389 } // namespace |
388 } // namespace cc | 390 } // namespace cc |
OLD | NEW |