diff options
| author | Johnny Chen <johnny.chen@apple.com> | 2011-06-28 23:38:38 +0000 |
|---|---|---|
| committer | Johnny Chen <johnny.chen@apple.com> | 2011-06-28 23:38:38 +0000 |
| commit | c74ed6b0deda3c8d36e1b1e7cc3fae33a05af3b9 (patch) | |
| tree | 04fbf1f18928967ea177279903d0b268832a966b /lldb/test/python_api | |
| parent | 421bb42c9fc7a786e8263bcff2f09afb4c468bcf (diff) | |
| download | bcm5719-llvm-c74ed6b0deda3c8d36e1b1e7cc3fae33a05af3b9.tar.gz bcm5719-llvm-c74ed6b0deda3c8d36e1b1e7cc3fae33a05af3b9.zip | |
Add fuzz calls for SBSymbol and SBSymbolContext.
llvm-svn: 134042
Diffstat (limited to 'lldb/test/python_api')
3 files changed, 37 insertions, 0 deletions
diff --git a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py index 56f7fc4f841..9d068438250 100644 --- a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py +++ b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py @@ -249,6 +249,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_symbol + sb_symbol.fuzz_obj(obj) @python_api_test def test_SBSymbolContext(self): @@ -256,6 +259,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_symbolcontext + sb_symbolcontext.fuzz_obj(obj) @python_api_test def test_SBSymbolContextList(self): diff --git a/lldb/test/python_api/default-constructor/sb_symbol.py b/lldb/test/python_api/default-constructor/sb_symbol.py new file mode 100644 index 00000000000..4a4c67a0880 --- /dev/null +++ b/lldb/test/python_api/default-constructor/sb_symbol.py @@ -0,0 +1,16 @@ +""" +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.GetName() + obj.GetMangledName() + obj.GetInstructions(lldb.SBTarget()) + obj.GetStartAddress() + obj.GetEndAddress() + obj.GetPrologueByteSize() + obj.GetType() + obj.GetDescription(lldb.SBStream()) diff --git a/lldb/test/python_api/default-constructor/sb_symbolcontext.py b/lldb/test/python_api/default-constructor/sb_symbolcontext.py new file mode 100644 index 00000000000..01b5b7b793e --- /dev/null +++ b/lldb/test/python_api/default-constructor/sb_symbolcontext.py @@ -0,0 +1,15 @@ +""" +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.GetModule() + obj.GetCompileUnit() + obj.GetFunction() + obj.GetBlock() + obj.GetLineEntry() + obj.GetSymbol() + obj.GetDescription(lldb.SBStream()) |

