summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/default-constructor
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-06-28 20:46:03 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-06-28 20:46:03 +0000
commit520eeff0efb9ae46a5ab74de0f814ed0bc1e1d0e (patch)
tree64161d3d65d838ef64c5193cd58f66ba2a2265ca /lldb/test/python_api/default-constructor
parent0beca53a298ce0a670bb0178e21bdf5068b866fb (diff)
downloadbcm5719-llvm-520eeff0efb9ae46a5ab74de0f814ed0bc1e1d0e.tar.gz
bcm5719-llvm-520eeff0efb9ae46a5ab74de0f814ed0bc1e1d0e.zip
Add fuzz calls for SBLineEntry.
llvm-svn: 134028
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_instruction.py2
-rw-r--r--lldb/test/python_api/default-constructor/sb_lineentry.py14
3 files changed, 18 insertions, 1 deletions
diff --git a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
index df8b42eb70f..804d2c8c82c 100644
--- a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
+++ b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
@@ -191,6 +191,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_lineentry
+ sb_lineentry.fuzz_obj(obj)
@python_api_test
def test_SBListener(self):
diff --git a/lldb/test/python_api/default-constructor/sb_instruction.py b/lldb/test/python_api/default-constructor/sb_instruction.py
index 91d2930cb2f..b961bc389e3 100644
--- a/lldb/test/python_api/default-constructor/sb_instruction.py
+++ b/lldb/test/python_api/default-constructor/sb_instruction.py
@@ -7,7 +7,7 @@ import lldb
def fuzz_obj(obj):
obj.GetAddress()
- obj.GetByteSize
+ obj.GetByteSize()
obj.DoesBranch()
obj.Print(None)
obj.GetDescription(lldb.SBStream())
diff --git a/lldb/test/python_api/default-constructor/sb_lineentry.py b/lldb/test/python_api/default-constructor/sb_lineentry.py
new file mode 100644
index 00000000000..d97f2517f4b
--- /dev/null
+++ b/lldb/test/python_api/default-constructor/sb_lineentry.py
@@ -0,0 +1,14 @@
+"""
+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.GetStartAddress()
+ obj.GetEndAddress()
+ obj.GetFileSpec()
+ obj.GetLine()
+ obj.GetColumn()
+ obj.GetDescription(lldb.SBStream())
OpenPOWER on IntegriCloud