Add fuzz calls for SBInstruction and SBInstructionList.

llvm-svn: 134020
This commit is contained in:
Johnny Chen 2011-06-28 19:07:02 +00:00
parent b10d72f019
commit 6f306a4859
3 changed files with 36 additions and 0 deletions

View File

@ -171,6 +171,9 @@ class APIDefaultConstructorTestCase(TestBase):
if self.TraceOn():
print obj
self.assertFalse(obj)
# Do fuzz testing on the invalid obj, it should not crash lldb.
import sb_instruction
sb_instruction.fuzz_obj(obj)
@python_api_test
def test_SBInstructionList(self):
@ -178,6 +181,9 @@ class APIDefaultConstructorTestCase(TestBase):
if self.TraceOn():
print obj
self.assertFalse(obj)
# Do fuzz testing on the invalid obj, it should not crash lldb.
import sb_instructionlist
sb_instructionlist.fuzz_obj(obj)
@python_api_test
def test_SBLineEntry(self):

View File

@ -0,0 +1,16 @@
"""
Fuzz tests an object after the default construction to make sure it does not crash lldb.
"""
import sys
import lldb
def fuzz_obj(obj):
obj.GetAddress()
obj.GetByteSize
obj.DoesBranch()
obj.Print(None)
obj.GetDescription(lldb.SBStream())
obj.EmulateWithFrame(lldb.SBFrame(), 0)
obj.DumpEmulation("armv7")
obj.TestEmulation(lldb.SBStream(), "my-file")

View File

@ -0,0 +1,14 @@
"""
Fuzz tests an object after the default construction to make sure it does not crash lldb.
"""
import sys
import lldb
def fuzz_obj(obj):
obj.GetSize()
obj.GetInstructionAtIndex(0xffffffff)
obj.AppendInstruction(lldb.SBInstruction())
obj.Print(None)
obj.GetDescription(lldb.SBStream())
obj.DumpEmulationForAllInstructions("armv7")