diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-06-29 21:42:46 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-06-29 21:42:46 +0000 |
commit | 8bae20f7f74e9eae82c3deded33a62d8ae389f5b (patch) | |
tree | 871c81b08abff025f9cdfe1c37a668b11a0a6cf7 /lldb/test/python_api | |
parent | 825faf7a4faec8083b87ae2c98a1296991d161b5 (diff) | |
download | bcm5719-llvm-8bae20f7f74e9eae82c3deded33a62d8ae389f5b.tar.gz bcm5719-llvm-8bae20f7f74e9eae82c3deded33a62d8ae389f5b.zip |
Add fuzz calls for SBTypeMember.
llvm-svn: 134098
Diffstat (limited to 'lldb/test/python_api')
-rw-r--r-- | lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py | 10 | ||||
-rw-r--r-- | lldb/test/python_api/default-constructor/sb_typemember.py | 18 |
2 files changed, 28 insertions, 0 deletions
diff --git a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py index f49a3a20d72..b7a73bdd0a8 100644 --- a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py +++ b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py @@ -302,6 +302,16 @@ class APIDefaultConstructorTestCase(TestBase): 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() if self.TraceOn(): diff --git a/lldb/test/python_api/default-constructor/sb_typemember.py b/lldb/test/python_api/default-constructor/sb_typemember.py new file mode 100644 index 00000000000..25e3b82005f --- /dev/null +++ b/lldb/test/python_api/default-constructor/sb_typemember.py @@ -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() |