[Lldb-commits] [lldb] r133954 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_event.py
Johnny Chen
johnny.chen at apple.com
Mon Jun 27 15:38:57 PDT 2011
Author: johnny
Date: Mon Jun 27 17:38:57 2011
New Revision: 133954
URL: http://llvm.org/viewvc/llvm-project?rev=133954&view=rev
Log:
Add fuzz calls for SBEvent.
Added:
lldb/trunk/test/python_api/default-constructor/sb_event.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=133954&r1=133953&r2=133954&view=diff
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original)
+++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Mon Jun 27 17:38:57 2011
@@ -121,6 +121,9 @@
if self.TraceOn():
print obj
self.assertFalse(obj)
+ # Do fuzz testing on the invalid obj, it should not crash lldb.
+ import sb_event
+ sb_event.fuzz_obj(obj)
@python_api_test
def test_SBFileSpec(self):
Added: lldb/trunk/test/python_api/default-constructor/sb_event.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_event.py?rev=133954&view=auto
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/sb_event.py (added)
+++ lldb/trunk/test/python_api/default-constructor/sb_event.py Mon Jun 27 17:38:57 2011
@@ -0,0 +1,17 @@
+"""
+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.GetDataFlavor()
+ obj.GetType()
+ broadcaster = obj.GetBroadcaster()
+ # Do fuzz testing on the broadcaster obj, it should not crash lldb.
+ import sb_broadcaster
+ sb_broadcaster.fuzz_obj(broadcaster)
+ obj.BroadcasterMatchesPtr(None)
+ obj.BroadcasterMatchesRef(broadcaster)
+ obj.GetDescription(lldb.SBStream())
More information about the lldb-commits
mailing list