Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions FTB/AssertionHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def getAssertion(output: list[str]) -> str | list[str] | None:
endRegex = RE_V8_END
lastLine = [line]
haveFatalAssertion = True
elif line.startswith("AssertedCast error:"):
# Firefox AssertedCast error (mozilla/Casting.h)
lastLine = line
haveFatalAssertion = True
elif "Assertion" in line and "failed" in line:
# Firefox ANGLE assertion
lastLine = line
Expand Down
1 change: 1 addition & 0 deletions FTB/tests/fixtures/assert_asserted_cast.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AssertedCast error: Cannot cast -32769 from int32_t to uint32_t: out of range
14 changes: 14 additions & 0 deletions FTB/tests/test_AssertionHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,20 @@ def test_AssertionHelperTestCPPUnhandledException():
_check_regex_matches(err, sanitizedMsg)


def test_AssertionHelperTestAssertedCast():
err = (FIXTURE_PATH / "assert_asserted_cast.txt").read_text().splitlines()

sanitizedMsg = AssertionHelper.getSanitizedAssertionPattern(
AssertionHelper.getAssertion(err)
)
expectedMsg = (
r"AssertedCast error: Cannot cast -[0-9]{2,} from int[0-9]{2,}_t to "
r"uint[0-9]{2,}_t: out of range"
)
assert sanitizedMsg == expectedMsg
_check_regex_matches(err, sanitizedMsg)


def test_AssertionHelperTestRustPanic01():
err = (FIXTURE_PATH / "assert_rust_panic1.txt").read_text().splitlines()
sanitizedMsg = AssertionHelper.getSanitizedAssertionPattern(
Expand Down
Loading