diff options
Diffstat (limited to 'lldb/test/python_api/default-constructor')
| -rw-r--r-- | lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py | 27 | ||||
| -rw-r--r-- | lldb/test/python_api/default-constructor/sb_typemember.py | 18 |
2 files changed, 15 insertions, 30 deletions
diff --git a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py index 23c96c3f187..f567ce7fded 100644 --- a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py +++ b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py @@ -294,26 +294,29 @@ class APIDefaultConstructorTestCase(TestBase): 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): diff --git a/lldb/test/python_api/default-constructor/sb_typemember.py b/lldb/test/python_api/default-constructor/sb_typemember.py deleted file mode 100644 index 25e3b82005f..00000000000 --- a/lldb/test/python_api/default-constructor/sb_typemember.py +++ /dev/null @@ -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() |

