summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/default-constructor
diff options
context:
space:
mode:
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_inputreader.py13
2 files changed, 16 insertions, 0 deletions
diff --git a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
index 7e62453d089..a5717c50bcb 100644
--- a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
+++ b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
@@ -161,6 +161,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_inputreader
+ sb_inputreader.fuzz_obj(obj)
@python_api_test
def test_SBInstruction(self):
diff --git a/lldb/test/python_api/default-constructor/sb_inputreader.py b/lldb/test/python_api/default-constructor/sb_inputreader.py
new file mode 100644
index 00000000000..9b94a12a7e3
--- /dev/null
+++ b/lldb/test/python_api/default-constructor/sb_inputreader.py
@@ -0,0 +1,13 @@
+"""
+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.Initialize(lldb.SBDebugger.Create(), None, None, 0, "$", "^", True)
+ obj.IsActive()
+ obj.IsDone()
+ obj.SetIsDone(True)
+ obj.GetGranularity()
OpenPOWER on IntegriCloud