summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-06-24 00:21:36 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-06-24 00:21:36 +0000
commit2f675dcb39cea5b4de26c6a5cfe0be0693e0dc32 (patch)
treed001ff12f5a32dead3422a9110aedb47146ade32 /lldb/test/python_api
parentcff00d9c127c7c1c25cf2d5345d5008460f235a1 (diff)
downloadbcm5719-llvm-2f675dcb39cea5b4de26c6a5cfe0be0693e0dc32.tar.gz
bcm5719-llvm-2f675dcb39cea5b4de26c6a5cfe0be0693e0dc32.zip
Add fuzz calls for SBBlock.
llvm-svn: 133780
Diffstat (limited to 'lldb/test/python_api')
-rw-r--r--lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py3
-rw-r--r--lldb/test/python_api/default-constructor/sb_block.py17
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 e28de4c9931..b69e50da803 100644
--- a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
+++ b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
@@ -32,6 +32,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_block
+ sb_block.fuzz_obj(obj)
@python_api_test
def test_SBBreakpoint(self):
diff --git a/lldb/test/python_api/default-constructor/sb_block.py b/lldb/test/python_api/default-constructor/sb_block.py
new file mode 100644
index 00000000000..3eeb24b4273
--- /dev/null
+++ b/lldb/test/python_api/default-constructor/sb_block.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.IsInlined()
+ obj.GetInlinedName()
+ obj.GetInlinedCallSiteFile()
+ obj.GetInlinedCallSiteLine()
+ obj.GetInlinedCallSiteColumn()
+ obj.GetParent()
+ obj.GetSibling()
+ obj.GetFirstChild()
+ obj.GetDescription(lldb.SBStream())
OpenPOWER on IntegriCloud