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

Side by Side Diff: base/safe_numerics_unittest.nc

Issue 12040055: Fix no-compile tests in base. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « base/memory/weak_ptr_unittest.nc ('k') | tools/nocompile_driver.py » ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <float.h>
6
5 #include "base/safe_numerics.h" 7 #include "base/safe_numerics.h"
6 8
7 namespace base { 9 using base::internal::IsValidNumericCast;
8 namespace internal {
9 10
10 void NoFloatingPoint { 11 #if defined(NCTEST_NO_FLOATING_POINT_1) // [r"size of array is negative"]
12
13 void WontCompile() {
11 IsValidNumericCast<float>(0.0); 14 IsValidNumericCast<float>(0.0);
15 }
16
17 #elif defined(NCTEST_NO_FLOATING_POINT_2) // [r"size of array is negative"]
18
19 void WontCompile() {
12 IsValidNumericCast<double>(0.0f); 20 IsValidNumericCast<double>(0.0f);
21 }
22
23 #elif defined(NCTEST_NO_FLOATING_POINT_3) // [r"size of array is negative"]
24
25 void WontCompile() {
13 IsValidNumericCast<int>(DBL_MAX); 26 IsValidNumericCast<int>(DBL_MAX);
14 } 27 }
15 28
16 } // namespace internal 29 #endif
17 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/weak_ptr_unittest.nc ('k') | tools/nocompile_driver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698