OLD | NEW |
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 #if defined(COMPILER_MSVC) && defined(ARCH_CPU_32_BITS) | 5 #if defined(COMPILER_MSVC) && defined(ARCH_CPU_32_BITS) |
6 #include <mmintrin.h> | 6 #include <mmintrin.h> |
7 #endif | 7 #endif |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <limits> | 10 #include <limits> |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 EXPECT_TRUE(IsValueInRangeForNumericType<int32_t>(0x7fffffff)); | 666 EXPECT_TRUE(IsValueInRangeForNumericType<int32_t>(0x7fffffff)); |
667 EXPECT_TRUE(IsValueInRangeForNumericType<int32_t>(0x7fffffffu)); | 667 EXPECT_TRUE(IsValueInRangeForNumericType<int32_t>(0x7fffffffu)); |
668 EXPECT_FALSE(IsValueInRangeForNumericType<int32_t>(0x80000000u)); | 668 EXPECT_FALSE(IsValueInRangeForNumericType<int32_t>(0x80000000u)); |
669 EXPECT_FALSE(IsValueInRangeForNumericType<int32_t>(0xffffffffu)); | 669 EXPECT_FALSE(IsValueInRangeForNumericType<int32_t>(0xffffffffu)); |
670 EXPECT_FALSE(IsValueInRangeForNumericType<int32_t>(INT64_C(0x80000000))); | 670 EXPECT_FALSE(IsValueInRangeForNumericType<int32_t>(INT64_C(0x80000000))); |
671 EXPECT_FALSE(IsValueInRangeForNumericType<int32_t>(INT64_C(0xffffffff))); | 671 EXPECT_FALSE(IsValueInRangeForNumericType<int32_t>(INT64_C(0xffffffff))); |
672 EXPECT_FALSE(IsValueInRangeForNumericType<int32_t>(INT64_C(0x100000000))); | 672 EXPECT_FALSE(IsValueInRangeForNumericType<int32_t>(INT64_C(0x100000000))); |
673 EXPECT_TRUE(IsValueInRangeForNumericType<int32_t>( | 673 EXPECT_TRUE(IsValueInRangeForNumericType<int32_t>( |
674 std::numeric_limits<int32_t>::min())); | 674 std::numeric_limits<int32_t>::min())); |
675 EXPECT_TRUE(IsValueInRangeForNumericType<int32_t>( | 675 EXPECT_TRUE(IsValueInRangeForNumericType<int32_t>( |
676 implicit_cast<int64_t>(std::numeric_limits<int32_t>::min()))); | 676 static_cast<int64_t>(std::numeric_limits<int32_t>::min()))); |
677 EXPECT_FALSE(IsValueInRangeForNumericType<int32_t>( | 677 EXPECT_FALSE(IsValueInRangeForNumericType<int32_t>( |
678 implicit_cast<int64_t>(std::numeric_limits<int32_t>::min()) - 1)); | 678 static_cast<int64_t>(std::numeric_limits<int32_t>::min()) - 1)); |
679 EXPECT_FALSE(IsValueInRangeForNumericType<int32_t>( | 679 EXPECT_FALSE(IsValueInRangeForNumericType<int32_t>( |
680 std::numeric_limits<int64_t>::min())); | 680 std::numeric_limits<int64_t>::min())); |
681 | 681 |
682 EXPECT_TRUE(IsValueInRangeForNumericType<uint64_t>(0)); | 682 EXPECT_TRUE(IsValueInRangeForNumericType<uint64_t>(0)); |
683 EXPECT_TRUE(IsValueInRangeForNumericType<uint64_t>(1)); | 683 EXPECT_TRUE(IsValueInRangeForNumericType<uint64_t>(1)); |
684 EXPECT_TRUE(IsValueInRangeForNumericType<uint64_t>(2)); | 684 EXPECT_TRUE(IsValueInRangeForNumericType<uint64_t>(2)); |
685 EXPECT_FALSE(IsValueInRangeForNumericType<uint64_t>(-1)); | 685 EXPECT_FALSE(IsValueInRangeForNumericType<uint64_t>(-1)); |
686 EXPECT_TRUE(IsValueInRangeForNumericType<uint64_t>(0xffffffffu)); | 686 EXPECT_TRUE(IsValueInRangeForNumericType<uint64_t>(0xffffffffu)); |
687 EXPECT_TRUE(IsValueInRangeForNumericType<uint64_t>(UINT64_C(0xffffffff))); | 687 EXPECT_TRUE(IsValueInRangeForNumericType<uint64_t>(UINT64_C(0xffffffff))); |
688 EXPECT_TRUE(IsValueInRangeForNumericType<uint64_t>(UINT64_C(0x100000000))); | 688 EXPECT_TRUE(IsValueInRangeForNumericType<uint64_t>(UINT64_C(0x100000000))); |
(...skipping 19 matching lines...) Expand all Loading... |
708 IsValueInRangeForNumericType<int64_t>(INT64_C(0x7fffffffffffffff))); | 708 IsValueInRangeForNumericType<int64_t>(INT64_C(0x7fffffffffffffff))); |
709 EXPECT_TRUE( | 709 EXPECT_TRUE( |
710 IsValueInRangeForNumericType<int64_t>(UINT64_C(0x7fffffffffffffff))); | 710 IsValueInRangeForNumericType<int64_t>(UINT64_C(0x7fffffffffffffff))); |
711 EXPECT_FALSE( | 711 EXPECT_FALSE( |
712 IsValueInRangeForNumericType<int64_t>(UINT64_C(0x8000000000000000))); | 712 IsValueInRangeForNumericType<int64_t>(UINT64_C(0x8000000000000000))); |
713 EXPECT_FALSE( | 713 EXPECT_FALSE( |
714 IsValueInRangeForNumericType<int64_t>(UINT64_C(0xffffffffffffffff))); | 714 IsValueInRangeForNumericType<int64_t>(UINT64_C(0xffffffffffffffff))); |
715 EXPECT_TRUE(IsValueInRangeForNumericType<int64_t>( | 715 EXPECT_TRUE(IsValueInRangeForNumericType<int64_t>( |
716 std::numeric_limits<int32_t>::min())); | 716 std::numeric_limits<int32_t>::min())); |
717 EXPECT_TRUE(IsValueInRangeForNumericType<int64_t>( | 717 EXPECT_TRUE(IsValueInRangeForNumericType<int64_t>( |
718 implicit_cast<int64_t>(std::numeric_limits<int32_t>::min()))); | 718 static_cast<int64_t>(std::numeric_limits<int32_t>::min()))); |
719 EXPECT_TRUE(IsValueInRangeForNumericType<int64_t>( | 719 EXPECT_TRUE(IsValueInRangeForNumericType<int64_t>( |
720 std::numeric_limits<int64_t>::min())); | 720 std::numeric_limits<int64_t>::min())); |
721 } | 721 } |
OLD | NEW |