Skip to content

Commit

Permalink
Apply ruff fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
twizmwazin committed Jul 1, 2024
1 parent e4c8ce9 commit ea5d3a8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ force-exclude = '''

[tool.ruff]
line-length = 120

[tool.ruff.lint]
select = [
"E",
"F",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pyvex.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def test_irstmt_dirty(self):
args = [pyvex.IRExpr.RdTmp.get_instance(i) for i in range(10)]
m = pyvex.IRStmt.Dirty("test_dirty", pyvex.IRConst.U8(1), args, 15, "Ifx_None", 0, 1, 0)
assert m.cee == "test_dirty"
assert type(m.guard) == pyvex.IRConst.U8
assert isinstance(m.guard, pyvex.IRConst.U8)
assert m.tmp == 15
assert m.mFx == "Ifx_None"
assert m.nFxState == 0
Expand Down
8 changes: 4 additions & 4 deletions tests/test_spotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,19 @@ def test_tmrs():
ins = b"\xef\xf3\x08\x82"
b = pyvex.block.IRSB(ins, 1, arch)
assert b.jumpkind == "Ijk_Boring"
assert type(b.statements[1].data) == pyvex.expr.Get
assert isinstance(b.statements[1].data, pyvex.expr.Get)
assert arch.translate_register_name(b.statements[1].data.offset) in ["sp", "r13"]
assert type(b.statements[2]) == pyvex.stmt.Put
assert isinstance(b.statements[2], pyvex.stmt.Put)


def test_tmsr():
arch = pyvex.ARCH_ARM_LE
inss = b"\x82\xf3\x08\x88"
b = pyvex.block.IRSB(inss, 1, arch, opt_level=3)
assert b.jumpkind == "Ijk_Boring"
assert type(b.statements[1].data) == pyvex.expr.Get
assert isinstance(b.statements[1].data, pyvex.expr.Get)
assert arch.translate_register_name(b.statements[1].data.offset) == "r2"
assert type(b.statements[2]) == pyvex.stmt.Put
assert isinstance(b.statements[2], pyvex.stmt.Put)


if __name__ == "__main__":
Expand Down

0 comments on commit ea5d3a8

Please sign in to comment.