Add a test sequence which passes None to lldb.SBFileSpec(). LLDB should not crash.

llvm-svn: 146922
This commit is contained in:
Johnny Chen 2011-12-19 23:09:54 +00:00
parent 8648c10184
commit a7bd08be8d
1 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,10 @@
Test lldb Python API object's default constructor and make sure it is invalid
after initial construction.
There are also some cases of boundary condition testings sprinkled throughout
the tests where None is passed to SB API which expects (const char *) in the
C++ API counterpart. Passing None should not crash lldb!
There are three exceptions to the above general rules, though; API objects
SBCommadnReturnObject, SBStream, and SBSymbolContextList, are all valid objects
after default construction.
@ -130,6 +134,8 @@ class APIDefaultConstructorTestCase(TestBase):
@python_api_test
def test_SBFileSpec(self):
obj = lldb.SBFileSpec()
# This is just to test that FileSpec(None) does not crash.
obj2 = lldb.SBFileSpec(None, True)
if self.TraceOn():
print obj
self.assertFalse(obj)