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

Side by Side Diff: base/numerics/safe_numerics_unittest.cc

Issue 1774443002: Replace template_util.h stuff with C++11 <type_traits> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert unrelated whitespace change Created 4 years, 9 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 | « base/memory/weak_ptr.h ('k') | base/template_util.h » ('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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <limits> 8 #include <limits>
9 #include <type_traits> 9 #include <type_traits>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/numerics/safe_conversions.h" 12 #include "base/numerics/safe_conversions.h"
13 #include "base/numerics/safe_math.h" 13 #include "base/numerics/safe_math.h"
14 #include "base/template_util.h"
15 #include "build/build_config.h" 14 #include "build/build_config.h"
16 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
17 16
18 #if defined(COMPILER_MSVC) && defined(ARCH_CPU_32_BITS) 17 #if defined(COMPILER_MSVC) && defined(ARCH_CPU_32_BITS)
19 #include <mmintrin.h> 18 #include <mmintrin.h>
20 #endif 19 #endif
21 20
22 using std::numeric_limits; 21 using std::numeric_limits;
23 using base::CheckedNumeric; 22 using base::CheckedNumeric;
24 using base::checked_cast; 23 using base::checked_cast;
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 775
777 CheckedNumeric<int> too_large = std::numeric_limits<int>::max(); 776 CheckedNumeric<int> too_large = std::numeric_limits<int>::max();
778 EXPECT_TRUE(too_large.IsValid()); 777 EXPECT_TRUE(too_large.IsValid());
779 too_large += d; 778 too_large += d;
780 EXPECT_FALSE(too_large.IsValid()); 779 EXPECT_FALSE(too_large.IsValid());
781 too_large -= d; 780 too_large -= d;
782 EXPECT_FALSE(too_large.IsValid()); 781 EXPECT_FALSE(too_large.IsValid());
783 too_large /= d; 782 too_large /= d;
784 EXPECT_FALSE(too_large.IsValid()); 783 EXPECT_FALSE(too_large.IsValid());
785 } 784 }
OLDNEW
« no previous file with comments | « base/memory/weak_ptr.h ('k') | base/template_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698