forked from OSchip/llvm-project
Add fuzz calls for SBStringList and add obj.Clear() calls for some files.
llvm-svn: 134040
This commit is contained in:
parent
8ea21dc2af
commit
dedd7d6ed6
|
@ -239,6 +239,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_stringlist
|
||||
sb_stringlist.fuzz_obj(obj)
|
||||
|
||||
@python_api_test
|
||||
def test_SBSymbol(self):
|
||||
|
|
|
@ -10,3 +10,4 @@ def fuzz_obj(obj):
|
|||
obj.GetLoadAddress(lldb.SBTarget())
|
||||
obj.OffsetAddress(sys.maxint)
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.Clear()
|
||||
|
|
|
@ -17,3 +17,4 @@ def fuzz_obj(obj):
|
|||
obj.EventTypeHasListeners(0)
|
||||
obj.RemoveListener(listener, 0xffffffff)
|
||||
obj.RemoveListener(listener, 0)
|
||||
obj.Clear()
|
||||
|
|
|
@ -49,3 +49,4 @@ def fuzz_obj(obj):
|
|||
obj.GetCloseInputOnEOF()
|
||||
obj.SetCloseInputOnEOF(True)
|
||||
obj.SetCloseInputOnEOF(False)
|
||||
obj.Clear()
|
||||
|
|
|
@ -17,3 +17,4 @@ def fuzz_obj(obj):
|
|||
obj.SetErrorString("xyz")
|
||||
obj.SetErrorStringWithFormat("%s!", "error")
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.Clear()
|
||||
|
|
|
@ -15,3 +15,4 @@ def fuzz_obj(obj):
|
|||
obj.BroadcasterMatchesPtr(None)
|
||||
obj.BroadcasterMatchesRef(broadcaster)
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.Clear()
|
||||
|
|
|
@ -32,3 +32,4 @@ def fuzz_obj(obj):
|
|||
obj.FindVariable("my_var")
|
||||
obj.FindVariable("my_var", lldb.eDynamicCanRunTarget)
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.Clear()
|
||||
|
|
|
@ -12,3 +12,4 @@ def fuzz_obj(obj):
|
|||
obj.Print(None)
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.DumpEmulationForAllInstructions("armv7")
|
||||
obj.Clear()
|
||||
|
|
|
@ -40,3 +40,4 @@ def fuzz_obj(obj):
|
|||
obj.GetDescription(lldb.SBStream())
|
||||
obj.LoadImage(lldb.SBFileSpec(), error)
|
||||
obj.UnloadImage(0)
|
||||
obj.Clear()
|
||||
|
|
|
@ -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.AppendString("another string")
|
||||
obj.AppendList(None, 0)
|
||||
obj.AppendList(lldb.SBStringList())
|
||||
obj.GetSize()
|
||||
obj.GetStringAtIndex(0xffffffff)
|
||||
obj.Clear()
|
Loading…
Reference in New Issue