Add a test sequence which passes None to lldb.SBFileSpec(). LLDB should not crash.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146922 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py b/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
index f5f9aef..6ec0350 100644
--- a/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
+++ b/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
@@ -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 @@
@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)