[Lldb-commits] [lldb] r134098 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_typemember.py

Johnny Chen johnny.chen at apple.com
Wed Jun 29 14:42:46 PDT 2011


Author: johnny
Date: Wed Jun 29 16:42:46 2011
New Revision: 134098

URL: http://llvm.org/viewvc/llvm-project?rev=134098&view=rev
Log:
Add fuzz calls for SBTypeMember.

Added:
    lldb/trunk/test/python_api/default-constructor/sb_typemember.py
Modified:
    lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py

Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=134098&r1=134097&r2=134098&view=diff
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original)
+++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Wed Jun 29 16:42:46 2011
@@ -302,6 +302,16 @@
         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():

Added: lldb/trunk/test/python_api/default-constructor/sb_typemember.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_typemember.py?rev=134098&view=auto
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/sb_typemember.py (added)
+++ lldb/trunk/test/python_api/default-constructor/sb_typemember.py Wed Jun 29 16:42:46 2011
@@ -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()





More information about the lldb-commits mailing list