summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/default-constructor
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-06-24 23:16:27 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-06-24 23:16:27 +0000
commit6e3dfa6025c301df749adb1251a9ea592bffb391 (patch)
tree8c9f189eda35d71e6d80f3e5477eb4985c092772 /lldb/test/python_api/default-constructor
parent99adfec0b13153d6fbf5fc430423633c08a791e5 (diff)
downloadbcm5719-llvm-6e3dfa6025c301df749adb1251a9ea592bffb391.tar.gz
bcm5719-llvm-6e3dfa6025c301df749adb1251a9ea592bffb391.zip
Add fuzz calls for SBCommunication.
llvm-svn: 133839
Diffstat (limited to 'lldb/test/python_api/default-constructor')
-rw-r--r--lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py3
-rw-r--r--lldb/test/python_api/default-constructor/sb_communication.py27
2 files changed, 30 insertions, 0 deletions
diff --git a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
index b744d541eb6..eb5aa8360cb 100644
--- a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
+++ b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
@@ -81,6 +81,9 @@ class APIDefaultConstructorTestCase(TestBase):
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):
diff --git a/lldb/test/python_api/default-constructor/sb_communication.py b/lldb/test/python_api/default-constructor/sb_communication.py
new file mode 100644
index 00000000000..fef3eabd909
--- /dev/null
+++ b/lldb/test/python_api/default-constructor/sb_communication.py
@@ -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)
OpenPOWER on IntegriCloud