[Lldb-commits] [lldb] r140632 - in /lldb/trunk/test/python_api/default-constructor: TestDefaultConstructorForAPIObjects.py sb_watchpointlocation.py

Johnny Chen johnny.chen at apple.com
Tue Sep 27 13:23:43 PDT 2011


Author: johnny
Date: Tue Sep 27 15:23:43 2011
New Revision: 140632

URL: http://llvm.org/viewvc/llvm-project?rev=140632&view=rev
Log:
Add fuzz testing for newly added SBWatchpointLocation API.

Added:
    lldb/trunk/test/python_api/default-constructor/sb_watchpointlocation.py
Modified:
    lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py

Modified: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py?rev=140632&r1=140631&r2=140632&view=diff
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original)
+++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Tue Sep 27 15:23:43 2011
@@ -339,6 +339,16 @@
         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

Added: lldb/trunk/test/python_api/default-constructor/sb_watchpointlocation.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_watchpointlocation.py?rev=140632&view=auto
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/sb_watchpointlocation.py (added)
+++ lldb/trunk/test/python_api/default-constructor/sb_watchpointlocation.py Tue Sep 27 15:23:43 2011
@@ -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)





More information about the lldb-commits mailing list