[Lldb-commits] [lldb] r133810 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_breakpointlocation.py
Johnny Chen
johnny.chen at apple.com
Fri Jun 24 12:00:22 PDT 2011
Author: johnny
Date: Fri Jun 24 14:00:22 2011
New Revision: 133810
URL: http://llvm.org/viewvc/llvm-project?rev=133810&view=rev
Log:
Add fuzz calls for SBBreakpointLocation.
Added:
lldb/trunk/test/python_api/default-constructor/sb_breakpointlocation.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=133810&r1=133809&r2=133810&view=diff
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original)
+++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Fri Jun 24 14:00:22 2011
@@ -53,6 +53,9 @@
if self.TraceOn():
print obj
self.assertFalse(obj)
+ # Do fuzz testing on the invalid obj, it should not crash lldb.
+ import sb_breakpointlocation
+ sb_breakpointlocation.fuzz_obj(obj)
@python_api_test
def test_SBBroadcaster(self):
Added: lldb/trunk/test/python_api/default-constructor/sb_breakpointlocation.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_breakpointlocation.py?rev=133810&view=auto
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/sb_breakpointlocation.py (added)
+++ lldb/trunk/test/python_api/default-constructor/sb_breakpointlocation.py Fri Jun 24 14:00:22 2011
@@ -0,0 +1,27 @@
+"""
+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.GetLoadAddress()
+ obj.SetEnabled(True)
+ obj.IsEnabled()
+ obj.SetCondition("i >= 10")
+ obj.GetCondition()
+ obj.SetThreadID(0)
+ obj.GetThreadID()
+ obj.SetThreadIndex(0)
+ obj.GetThreadIndex()
+ obj.SetThreadName("worker thread")
+ obj.GetThreadName()
+ obj.SetQueueName("my queue")
+ obj.GetQueueName()
+ obj.IsResolved()
+ obj.GetDescription(lldb.SBStream(), lldb.eDescriptionLevelVerbose)
+ breakpoint = obj.GetBreakpoint()
+ # Do fuzz testing on the breakpoint obj, it should not crash lldb.
+ import sb_breakpoint
+ sb_breakpoint.fuzz_obj(breakpoint)
More information about the lldb-commits
mailing list