Skip to content
Snippets Groups Projects
Commit 6d7fd3e0 authored by pompolic's avatar pompolic
Browse files

More tests

TODO: load test cases as python modules, or separate scripts using the source command?
parent 47fa99c6
No related branches found
No related tags found
No related merge requests found
import unittest
class PerformLowlevelParseRetBreakpointCreated(unittest.TestCase):
def test_breakpoint_is_at_ret(self):
arch = gdb.selected_frame().architecture()
disassembled_ins = arch.disassemble(perform_lowlevel_parse_ret.location)
ins = disassembled_ins['asm'].split(" ")[0]
self.assertIn(ins, ["ret", "retq"])
def test_not_pending(self):
self.assertFalse(perform_lowlevel_parse_ret.pending)
class HPackratParseRetBreakpointCreated(unittest.TestCase):
def test_breakpoint_is_at_ret(self):
arch = gdb.selected_frame().architecture()
disassembled_ins = arch.disassemble(h_packrat_parse_ret.location)
ins = disassembled_ins['asm'].split(" ")[0]
self.assertIn(ins, ["ret", "retq"])
def test_not_pending(self):
self.assertFalse(h_packrat_parse_ret.pending)
import unittest
# TODO: This actually tests whether the main script set up the breakpoint properly, move to integration
class InitParserBreakpointCreated(unittest.TestCase):
def test_breakpoint_is_at_ret(self):
arch = gdb.selected_frame().architecture()
disassembled_ins = arch.disassemble(init_parser.location)
ins = disassembled_ins['asm'].split(" ")[0]
self.assertIn(ins, ["ret", "retq"])
def test_not_pending(self):
self.assertFalse(init_parser.pending)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment