]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/python_api/default-constructor/sb_error.py
Vendor import of lldb trunk r256945:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / python_api / default-constructor / sb_error.py
1 """
2 Fuzz tests an object after the default construction to make sure it does not crash lldb.
3 """
4
5 import sys
6 import lldb
7
8 def fuzz_obj(obj):
9     obj.GetCString()
10     obj.Fail()
11     obj.Success()
12     obj.GetError()
13     obj.GetType()
14     obj.SetError(5, lldb.eErrorTypeGeneric)
15     obj.SetErrorToErrno()
16     obj.SetErrorToGenericError()
17     obj.SetErrorString("xyz")
18     obj.SetErrorString(None)
19     obj.SetErrorStringWithFormat("%s!", "error")
20     obj.SetErrorStringWithFormat(None)
21     obj.SetErrorStringWithFormat("error")
22     obj.SetErrorStringWithFormat("%s %s", "warning", "danger")
23     obj.SetErrorStringWithFormat("%s %s %s", "danger", "will", "robinson")
24     obj.GetDescription(lldb.SBStream())
25     obj.Clear()