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 |