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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/memory/weak_ptr_unittest.nc ('k') | tools/nocompile_driver.py » ('j') | 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
index 4a3c57ef342ca0955f86a2649e735cba0a8a14ae..4219cd56a468cb5388b01dbd5828a85075e50264 100644
--- a/base/safe_numerics_unittest.nc
+++ b/base/safe_numerics_unittest.nc
@@ -2,16 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <float.h>
+
#include "base/safe_numerics.h"
-namespace base {
-namespace internal {
+using base::internal::IsValidNumericCast;
+
+#if defined(NCTEST_NO_FLOATING_POINT_1) // [r"size of array is negative"]
-void NoFloatingPoint {
+void WontCompile() {
IsValidNumericCast<float>(0.0);
+}
+
+#elif defined(NCTEST_NO_FLOATING_POINT_2) // [r"size of array is negative"]
+
+void WontCompile() {
IsValidNumericCast<double>(0.0f);
+}
+
+#elif defined(NCTEST_NO_FLOATING_POINT_3) // [r"size of array is negative"]
+
+void WontCompile() {
IsValidNumericCast<int>(DBL_MAX);
}
-} // namespace internal
-} // namespace base
+#endif
« 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