diff options
-rw-r--r-- | lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py | 10 | ||||
-rw-r--r-- | lldb/test/python_api/default-constructor/sb_watchpointlocation.py | 18 |
2 files changed, 28 insertions, 0 deletions
diff --git a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py index c41fc16cbf2..b46a9fa7bea 100644 --- a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py +++ b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py @@ -339,6 +339,16 @@ class APIDefaultConstructorTestCase(TestBase): import sb_valuelist sb_valuelist.fuzz_obj(obj) + @python_api_test + def test_SBWatchpointLocation(self): + obj = lldb.SBWatchpointLocation() + if self.TraceOn(): + print obj + self.assertFalse(obj) + # Do fuzz testing on the invalid obj, it should not crash lldb. + import sb_watchpointlocation + sb_watchpointlocation.fuzz_obj(obj) + if __name__ == '__main__': import atexit diff --git a/lldb/test/python_api/default-constructor/sb_watchpointlocation.py b/lldb/test/python_api/default-constructor/sb_watchpointlocation.py new file mode 100644 index 00000000000..8b0b1ecc481 --- /dev/null +++ b/lldb/test/python_api/default-constructor/sb_watchpointlocation.py @@ -0,0 +1,18 @@ +""" +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.GetID() + obj.GetHardwareIndex() + obj.GetWatchAddress() + obj.GetWatchSize() + obj.SetEnabled(True) + obj.IsEnabled() + obj.GetHitCount() + obj.GetIgnoreCount() + obj.SetIgnoreCount(5) + obj.GetDescription(lldb.SBStream(), lldb.eDescriptionLevelVerbose) |