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

Unified Diff: base/safe_numerics_unittest.nc

Issue 11886037: Add numeric_cast for checked integral narrowing casts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simplify 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 side-by-side diff with in-line comments
Download patch
« base/safe_numerics_unittest.cc ('K') | « base/safe_numerics_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/safe_numerics_unittest.nc
diff --git a/base/safe_numerics_unittest.nc b/base/safe_numerics_unittest.nc
new file mode 100644
index 0000000000000000000000000000000000000000..4a3c57ef342ca0955f86a2649e735cba0a8a14ae
--- /dev/null
+++ b/base/safe_numerics_unittest.nc
@@ -0,0 +1,17 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/safe_numerics.h"
+
+namespace base {
+namespace internal {
+
+void NoFloatingPoint {
+ IsValidNumericCast<float>(0.0);
+ IsValidNumericCast<double>(0.0f);
+ IsValidNumericCast<int>(DBL_MAX);
+}
+
+} // namespace internal
+} // namespace base
« base/safe_numerics_unittest.cc ('K') | « base/safe_numerics_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698