mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
Tests: Add tests for Checked<T>::div() overflow
This commit is contained in:
parent
da68c4580c
commit
aacbee8ed8
Notes:
sideshowbarker
2024-07-18 18:37:22 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/aacbee8ed84 Pull-request: https://github.com/SerenityOS/serenity/pull/6908
@ -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…
Reference in New Issue
Block a user