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

Johnny Chen johnny.chen at apple.com
Thu Aug 4 17:07:41 PDT 2011


Author: johnny
Date: Thu Aug  4 19:07:41 2011
New Revision: 136947

URL: http://llvm.org/viewvc/llvm-project?rev=136947&view=rev
Log:
Remove expectedFailure decorator for test_SBType, which does not take an empty constructor after the recent changes.
And remove expectedFailure decorator for test_SBTypeMember, which no longer exists after the recent changes, replace
it with test_SBTypeList.

Removed:
    lldb/trunk/test/python_api/default-constructor/sb_typemember.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=136947&r1=136946&r2=136947&view=diff
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py (original)
+++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py Thu Aug  4 19:07:41 2011
@@ -294,26 +294,29 @@
         sb_thread.fuzz_obj(obj)
 
     @python_api_test
-    @unittest2.expectedFailure
     def test_SBType(self):
-        obj = lldb.SBType()
-        if self.TraceOn():
-            print obj
-        self.assertFalse(obj)
+        try:
+            obj = lldb.SBType()
+            if self.TraceOn():
+                print obj
+            self.assertFalse(obj)
+            # If we reach here, the test fails.
+            self.fail("lldb.SBType() should fail, not succeed!")
+        except:
+            # Exception is expected.
+            return
+            
+        # Unreachable code because lldb.SBType() should fail.
         # Do fuzz testing on the invalid obj, it should not crash lldb.
         import sb_type
         sb_type.fuzz_obj(obj)
 
     @python_api_test
-    @unittest2.expectedFailure
-    def test_SBTypeMember(self):
-        obj = lldb.SBTypeMember()
+    def test_SBTypeList(self):
+        obj = lldb.SBTypeList()
         if self.TraceOn():
             print obj
-        self.assertFalse(obj)
-        # Do fuzz testing on the invalid obj, it should not crash lldb.
-        import sb_typemember
-        sb_typemember.fuzz_obj(obj)
+        self.assertTrue(obj)
 
     @python_api_test
     def test_SBValue(self):

Removed: lldb/trunk/test/python_api/default-constructor/sb_typemember.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/default-constructor/sb_typemember.py?rev=136946&view=auto
==============================================================================
--- lldb/trunk/test/python_api/default-constructor/sb_typemember.py (original)
+++ lldb/trunk/test/python_api/default-constructor/sb_typemember.py (removed)
@@ -1,18 +0,0 @@
-"""
-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.IsBaseClass()
-    obj.IsBitfield()
-    obj.GetBitfieldWidth()
-    obj.GetBitfieldOffset()
-    obj.GetOffset()
-    obj.GetName()
-    obj.GetType()
-    obj.GetParentType()
-    obj.SetName("my_type_member_name")
-    obj.Clear()





More information about the lldb-commits mailing list