[Lldb-commits] [lldb] r134042 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_symbol.py sb_symbolcontext.py

Johnny Chen johnny.chen at apple.com
Tue Jun 28 16:38:38 PDT 2011


Author: johnny
Date: Tue Jun 28 18:38:38 2011
New Revision: 134042

URL: http://llvm.org/viewvc/llvm-project?rev=134042&view=rev
Log:
Add fuzz calls for SBSymbol and SBSymbolContext.

Added:
    lldb/trunk/test/python_api/default-constructor/sb_symbol.py
    lldb/trunk/test/python_api/default-constructor/sb_symbolcontext.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=134042&r1=134041&r2=134042&view=diff
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original)
+++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Tue Jun 28 18:38:38 2011
@@ -249,6 +249,9 @@
         if self.TraceOn():
             print obj
         self.assertFalse(obj)
+        # Do fuzz testing on the invalid obj, it should not crash lldb.
+        import sb_symbol
+        sb_symbol.fuzz_obj(obj)
 
     @python_api_test
     def test_SBSymbolContext(self):
@@ -256,6 +259,9 @@
         if self.TraceOn():
             print obj
         self.assertFalse(obj)
+        # Do fuzz testing on the invalid obj, it should not crash lldb.
+        import sb_symbolcontext
+        sb_symbolcontext.fuzz_obj(obj)
 
     @python_api_test
     def test_SBSymbolContextList(self):

Added: lldb/trunk/test/python_api/default-constructor/sb_symbol.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_symbol.py?rev=134042&view=auto
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/sb_symbol.py (added)
+++ lldb/trunk/test/python_api/default-constructor/sb_symbol.py Tue Jun 28 18:38:38 2011
@@ -0,0 +1,16 @@
+"""
+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.GetName()
+    obj.GetMangledName()
+    obj.GetInstructions(lldb.SBTarget())
+    obj.GetStartAddress()
+    obj.GetEndAddress()
+    obj.GetPrologueByteSize()
+    obj.GetType()
+    obj.GetDescription(lldb.SBStream())

Added: lldb/trunk/test/python_api/default-constructor/sb_symbolcontext.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_symbolcontext.py?rev=134042&view=auto
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/sb_symbolcontext.py (added)
+++ lldb/trunk/test/python_api/default-constructor/sb_symbolcontext.py Tue Jun 28 18:38:38 2011
@@ -0,0 +1,15 @@
+"""
+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.GetModule()
+    obj.GetCompileUnit()
+    obj.GetFunction()
+    obj.GetBlock()
+    obj.GetLineEntry()
+    obj.GetSymbol()
+    obj.GetDescription(lldb.SBStream())





More information about the lldb-commits mailing list