Add fuzz calls for SBInputReader.

llvm-svn: 133972
This commit is contained in:
Johnny Chen
2011-06-28 00:12:06 +00:00
parent 03aff72eff
commit 24c5296957
2 changed files with 16 additions and 0 deletions

View File

@@ -161,6 +161,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_inputreader
sb_inputreader.fuzz_obj(obj)
@python_api_test
def test_SBInstruction(self):

View File

@@ -0,0 +1,13 @@
"""
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.Initialize(lldb.SBDebugger.Create(), None, None, 0, "$", "^", True)
obj.IsActive()
obj.IsDone()
obj.SetIsDone(True)
obj.GetGranularity()