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

Johnny Chen johnny.chen at apple.com
Mon Jun 27 15:55:51 PDT 2011


Author: johnny
Date: Mon Jun 27 17:55:51 2011
New Revision: 133956

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

Added:
    lldb/trunk/test/python_api/default-constructor/sb_filespec.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=133956&r1=133955&r2=133956&view=diff
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original)
+++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Mon Jun 27 17:55:51 2011
@@ -131,6 +131,9 @@
         if self.TraceOn():
             print obj
         self.assertFalse(obj)
+        # Do fuzz testing on the invalid obj, it should not crash lldb.
+        import sb_filespec
+        sb_filespec.fuzz_obj(obj)
 
     @python_api_test
     def test_SBFrame(self):

Added: lldb/trunk/test/python_api/default-constructor/sb_filespec.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_filespec.py?rev=133956&view=auto
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/sb_filespec.py (added)
+++ lldb/trunk/test/python_api/default-constructor/sb_filespec.py Mon Jun 27 17:55:51 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.Exists()
+    obj.ResolveExecutableLocation()
+    obj.GetFilename()
+    obj.GetDirectory()
+    obj.GetPath(None, 0)
+    obj.GetDescription(lldb.SBStream())





More information about the lldb-commits mailing list