diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-06-27 22:38:57 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-06-27 22:38:57 +0000 |
commit | 71eabde2f848e2c1c05d0a6a50526d836c8266c9 (patch) | |
tree | bc29accdda351d635ce502cc9c5fb763c47f9974 /lldb/test/python_api/default-constructor | |
parent | 4dc034df1d8304e203c46b0cc112f150ed82e987 (diff) | |
download | bcm5719-llvm-71eabde2f848e2c1c05d0a6a50526d836c8266c9.tar.gz bcm5719-llvm-71eabde2f848e2c1c05d0a6a50526d836c8266c9.zip |
Add fuzz calls for SBEvent.
llvm-svn: 133954
Diffstat (limited to 'lldb/test/python_api/default-constructor')
-rw-r--r-- | lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py | 3 | ||||
-rw-r--r-- | lldb/test/python_api/default-constructor/sb_event.py | 17 |
2 files changed, 20 insertions, 0 deletions
diff --git a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py index f78c91b0107..bf2729a5963 100644 --- a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py +++ b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py @@ -121,6 +121,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_event + sb_event.fuzz_obj(obj) @python_api_test def test_SBFileSpec(self): diff --git a/lldb/test/python_api/default-constructor/sb_event.py b/lldb/test/python_api/default-constructor/sb_event.py new file mode 100644 index 00000000000..e31f3091f2c --- /dev/null +++ b/lldb/test/python_api/default-constructor/sb_event.py @@ -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()) |