diff options
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()) |