mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
Tests: Add tests for Checked<T>::div() overflow
This commit is contained in:
parent
da68c4580c
commit
aacbee8ed8
1 changed files with 3 additions and 0 deletions
|
@ -96,6 +96,9 @@ TEST_CASE(detects_signed_overflow)
|
|||
EXPECT((Checked<i64>(0x4000000000000000) - Checked<i64>(-0x4000000000000000)).has_overflow());
|
||||
EXPECT(!(Checked<i64>(-0x4000000000000000) - Checked<i64>(0x4000000000000000)).has_overflow());
|
||||
EXPECT((Checked<i64>(-0x4000000000000000) - Checked<i64>(0x4000000000000001)).has_overflow());
|
||||
|
||||
EXPECT((Checked<i32>(0x80000000) / Checked<i32>(-1)).has_overflow());
|
||||
EXPECT((Checked<i64>(0x8000000000000000) / Checked<i64>(-1)).has_overflow());
|
||||
}
|
||||
|
||||
TEST_CASE(detects_unsigned_overflow)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue