Index: base/numerics/safe_numerics_unittest.cc |
diff --git a/base/numerics/safe_numerics_unittest.cc b/base/numerics/safe_numerics_unittest.cc |
index b804d36f7af1e034928341257c81082d1f3a43d3..daef09960c918f7318d3c217713a5eab3d0f119c 100644 |
--- a/base/numerics/safe_numerics_unittest.cc |
+++ b/base/numerics/safe_numerics_unittest.cc |
@@ -120,6 +120,8 @@ static void TestSpecializedArithmetic( |
TEST_EXPECTED_VALUE(0, CheckedNumeric<Dst>(1) % 1); |
CheckedNumeric<Dst> checked_dst = 1; |
TEST_EXPECTED_VALUE(0, checked_dst %= 1); |
+ // Test that div by 0 is avoided but returns invalid result. |
+ TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(1) % 0); |
} |
// Unsigned integer arithmetic. |
@@ -155,6 +157,8 @@ static void TestSpecializedArithmetic( |
TEST_EXPECTED_VALUE(0, CheckedNumeric<Dst>(1) % 1); |
CheckedNumeric<Dst> checked_dst = 1; |
TEST_EXPECTED_VALUE(0, checked_dst %= 1); |
+ // Test that div by 0 is avoided but returns invalid result. |
+ TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(1) % 0); |
} |
// Floating point arithmetic. |