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

Johnny Chen johnny.chen at apple.com
Mon Jun 27 17:12:06 PDT 2011


Author: johnny
Date: Mon Jun 27 19:12:06 2011
New Revision: 133972

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

Added:
    lldb/trunk/test/python_api/default-constructor/sb_inputreader.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=133972&r1=133971&r2=133972&view=diff
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original)
+++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Mon Jun 27 19:12:06 2011
@@ -161,6 +161,9 @@
         if self.TraceOn():
             print obj
         self.assertFalse(obj)
+        # Do fuzz testing on the invalid obj, it should not crash lldb.
+        import sb_inputreader
+        sb_inputreader.fuzz_obj(obj)
 
     @python_api_test
     def test_SBInstruction(self):

Added: lldb/trunk/test/python_api/default-constructor/sb_inputreader.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_inputreader.py?rev=133972&view=auto
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/sb_inputreader.py (added)
+++ lldb/trunk/test/python_api/default-constructor/sb_inputreader.py Mon Jun 27 19:12:06 2011
@@ -0,0 +1,13 @@
+"""
+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.Initialize(lldb.SBDebugger.Create(), None, None, 0, "$", "^", True)
+    obj.IsActive()
+    obj.IsDone()
+    obj.SetIsDone(True)
+    obj.GetGranularity()





More information about the lldb-commits mailing list