Skip to content

Commit

Permalink
tests: Make sure keystone and capstone tests fail with missing lib (#791
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Grazfather committed Jan 17, 2022
1 parent 5f31516 commit 9055b65
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def test_cmd_canary(self):
return

def test_cmd_capstone_disassemble(self):
self.assertNotIn("capstone", gdb_run_silent_cmd("gef missing"))
self.assertFailIfInactiveSession(gdb_run_cmd("capstone-disassemble"))
res = gdb_start_silent_cmd("capstone-disassemble")
self.assertNoException(res)
Expand Down Expand Up @@ -421,7 +422,8 @@ def test_cmd_name_break(self):
return

def test_cmd_keystone_assemble(self):
valid_cmds = [
self.assertNotIn("keystone", gdb_run_silent_cmd("gef missing"))
cmds = [
"assemble --arch arm --mode arm add r0, r1, r2",
"assemble --arch arm --mode arm --endian big add r0, r1, r2",
"assemble --arch arm --mode thumb add r0, r1, r2",
Expand All @@ -445,7 +447,7 @@ def test_cmd_keystone_assemble(self):
"assemble --arch x86 --mode 32 mov eax, 0x42",
"assemble --arch x86 --mode 64 mov rax, 0x42",
]
for cmd in valid_cmds:
for cmd in cmds:
res = gdb_start_silent_cmd(cmd)
self.assertNoException(res)
self.assertTrue(len(res.splitlines()) > 1)
Expand Down

0 comments on commit 9055b65

Please sign in to comment.