[Lldb-commits] [lldb] r133839 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_communication.py
Johnny Chen
johnny.chen at apple.com
Fri Jun 24 16:16:27 PDT 2011
Author: johnny
Date: Fri Jun 24 18:16:27 2011
New Revision: 133839
URL: http://llvm.org/viewvc/llvm-project?rev=133839&view=rev
Log:
Add fuzz calls for SBCommunication.
Added:
lldb/trunk/test/python_api/default-constructor/sb_communication.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=133839&r1=133838&r2=133839&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:16:27 2011
@@ -81,6 +81,9 @@
if self.TraceOn():
print obj
self.assertFalse(obj)
+ # Do fuzz testing on the invalid obj, it should not crash lldb.
+ import sb_communication
+ sb_communication.fuzz_obj(obj)
@python_api_test
def test_SBCompileUnit(self):
Added: lldb/trunk/test/python_api/default-constructor/sb_communication.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_communication.py?rev=133839&view=auto
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/sb_communication.py (added)
+++ lldb/trunk/test/python_api/default-constructor/sb_communication.py Fri Jun 24 18:16:27 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):
+ broadcaster = obj.GetBroadcaster()
+ # Do fuzz testing on the broadcaster obj, it should not crash lldb.
+ import sb_broadcaster
+ sb_broadcaster.fuzz_obj(broadcaster)
+ obj.AdoptFileDesriptor(0, False)
+ obj.AdoptFileDesriptor(1, False)
+ obj.AdoptFileDesriptor(2, False)
+ obj.Connect("file:/tmp/myfile")
+ obj.Disconnect()
+ obj.IsConnected()
+ obj.GetCloseOnEOF()
+ obj.SetCloseOnEOF(True)
+ obj.SetCloseOnEOF(False)
+ #obj.Write(None, sys.maxint, None)
+ #obj.Read(None, sys.maxint, 0xffffffff, None)
+ obj.ReadThreadStart()
+ obj.ReadThreadStop()
+ obj.ReadThreadIsRunning()
+ obj.SetReadThreadBytesReceivedCallback(None, None)
More information about the lldb-commits
mailing list