Add fuzz calls for SBSymbol and SBSymbolContext.

llvm-svn: 134042
This commit is contained in:
Johnny Chen 2011-06-28 23:38:38 +00:00
parent 421bb42c9f
commit c74ed6b0de
3 changed files with 37 additions and 0 deletions

View File

@ -249,6 +249,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_symbol
sb_symbol.fuzz_obj(obj)
@python_api_test
def test_SBSymbolContext(self):
@ -256,6 +259,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_symbolcontext
sb_symbolcontext.fuzz_obj(obj)
@python_api_test
def test_SBSymbolContextList(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.GetName()
obj.GetMangledName()
obj.GetInstructions(lldb.SBTarget())
obj.GetStartAddress()
obj.GetEndAddress()
obj.GetPrologueByteSize()
obj.GetType()
obj.GetDescription(lldb.SBStream())

View File

@ -0,0 +1,15 @@
"""
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.GetModule()
obj.GetCompileUnit()
obj.GetFunction()
obj.GetBlock()
obj.GetLineEntry()
obj.GetSymbol()
obj.GetDescription(lldb.SBStream())