forked from OSchip/llvm-project
parent
825faf7a4f
commit
8bae20f7f7
|
@ -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()
|
||||
|
|
|
@ -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()
|
Loading…
Reference in New Issue