[Lldb-commits] [lldb] r134028 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_instruction.py sb_lineentry.py

Johnny Chen johnny.chen at apple.com
Tue Jun 28 13:46:03 PDT 2011


Author: johnny
Date: Tue Jun 28 15:46:03 2011
New Revision: 134028

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

Added:
    lldb/trunk/test/python_api/default-constructor/sb_lineentry.py
Modified:
    lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
    lldb/trunk/test/python_api/default-constructor/sb_instruction.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=134028&r1=134027&r2=134028&view=diff
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original)
+++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Tue Jun 28 15:46:03 2011
@@ -191,6 +191,9 @@
         if self.TraceOn():
             print obj
         self.assertFalse(obj)
+        # Do fuzz testing on the invalid obj, it should not crash lldb.
+        import sb_lineentry
+        sb_lineentry.fuzz_obj(obj)
 
     @python_api_test
     def test_SBListener(self):

Modified: lldb/trunk/test/python_api/default-constructor/sb_instruction.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_instruction.py?rev=134028&r1=134027&r2=134028&view=diff
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/sb_instruction.py (original)
+++ lldb/trunk/test/python_api/default-constructor/sb_instruction.py Tue Jun 28 15:46:03 2011
@@ -7,7 +7,7 @@
 
 def fuzz_obj(obj):
     obj.GetAddress()
-    obj.GetByteSize
+    obj.GetByteSize()
     obj.DoesBranch()
     obj.Print(None)
     obj.GetDescription(lldb.SBStream())

Added: lldb/trunk/test/python_api/default-constructor/sb_lineentry.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_lineentry.py?rev=134028&view=auto
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/sb_lineentry.py (added)
+++ lldb/trunk/test/python_api/default-constructor/sb_lineentry.py Tue Jun 28 15:46:03 2011
@@ -0,0 +1,14 @@
+"""
+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.GetStartAddress()
+    obj.GetEndAddress()
+    obj.GetFileSpec()
+    obj.GetLine()
+    obj.GetColumn()
+    obj.GetDescription(lldb.SBStream())





More information about the lldb-commits mailing list