Add fuzz calls for SBTypeMember.

llvm-svn: 134098
This commit is contained in:
Johnny Chen 2011-06-29 21:42:46 +00:00
parent 825faf7a4f
commit 8bae20f7f7
2 changed files with 28 additions and 0 deletions

View File

@ -301,6 +301,16 @@ class APIDefaultConstructorTestCase(TestBase):
import sb_type
sb_type.fuzz_obj(obj)
@python_api_test
def test_SBTypeMember(self):
obj = lldb.SBTypeMember()
if self.TraceOn():
print obj
self.assertFalse(obj)
# Do fuzz testing on the invalid obj, it should not crash lldb.
import sb_typemember
sb_typemember.fuzz_obj(obj)
@python_api_test
def test_SBValue(self):
obj = lldb.SBValue()

View File

@ -0,0 +1,18 @@
"""
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.IsBaseClass()
obj.IsBitfield()
obj.GetBitfieldWidth()
obj.GetBitfieldOffset()
obj.GetOffset()
obj.GetName()
obj.GetType()
obj.GetParentType()
obj.SetName("my_type_member_name")
obj.Clear()