[Lldb-commits] [lldb] r133843 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_compileunit.py
Johnny Chen
johnny.chen at apple.com
Fri Jun 24 16:33:03 PDT 2011
Author: johnny
Date: Fri Jun 24 18:33:03 2011
New Revision: 133843
URL: http://llvm.org/viewvc/llvm-project?rev=133843&view=rev
Log:
Add fuzz calls for SBCompileUnit.
Added:
lldb/trunk/test/python_api/default-constructor/sb_compileunit.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=133843&r1=133842&r2=133843&view=diff
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original)
+++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Fri Jun 24 18:33:03 2011
@@ -91,6 +91,9 @@
if self.TraceOn():
print obj
self.assertFalse(obj)
+ # Do fuzz testing on the invalid obj, it should not crash lldb.
+ import sb_compileunit
+ sb_compileunit.fuzz_obj(obj)
@python_api_test
def test_SBDebugger(self):
Added: lldb/trunk/test/python_api/default-constructor/sb_compileunit.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_compileunit.py?rev=133843&view=auto
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/sb_compileunit.py (added)
+++ lldb/trunk/test/python_api/default-constructor/sb_compileunit.py Fri Jun 24 18:33:03 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.GetFileSpec()
+ obj.GetNumLineEntries()
+ obj.GetLineEntryAtIndex(0xffffffff)
+ obj.FindLineEntryIndex(0, 0xffffffff, None)
+ obj.GetDescription(lldb.SBStream())
More information about the lldb-commits
mailing list