aboutsummaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/python_api/default-constructor/sb_error.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Python/lldbsuite/test/python_api/default-constructor/sb_error.py')
-rw-r--r--packages/Python/lldbsuite/test/python_api/default-constructor/sb_error.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_error.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_error.py
new file mode 100644
index 000000000000..7e069323bf3f
--- /dev/null
+++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_error.py
@@ -0,0 +1,25 @@
+"""
+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.GetCString()
+ obj.Fail()
+ obj.Success()
+ obj.GetError()
+ obj.GetType()
+ obj.SetError(5, lldb.eErrorTypeGeneric)
+ obj.SetErrorToErrno()
+ obj.SetErrorToGenericError()
+ obj.SetErrorString("xyz")
+ obj.SetErrorString(None)
+ obj.SetErrorStringWithFormat("%s!", "error")
+ obj.SetErrorStringWithFormat(None)
+ obj.SetErrorStringWithFormat("error")
+ obj.SetErrorStringWithFormat("%s %s", "warning", "danger")
+ obj.SetErrorStringWithFormat("%s %s %s", "danger", "will", "robinson")
+ obj.GetDescription(lldb.SBStream())
+ obj.Clear()