From 8bae20f7f74e9eae82c3deded33a62d8ae389f5b Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Wed, 29 Jun 2011 21:42:46 +0000 Subject: Add fuzz calls for SBTypeMember. llvm-svn: 134098 --- .../TestDefaultConstructorForAPIObjects.py | 10 ++++++++++ .../python_api/default-constructor/sb_typemember.py | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 lldb/test/python_api/default-constructor/sb_typemember.py (limited to 'lldb/test/python_api') 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 @@ -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() 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() -- cgit v1.2.3