TestHandleSegv: also assert that we have a thread

If get_stopped_thread(... eStopReasonSignal) returns no thread, the
thread.IsValid assertion would throw AttributeError: 'NoneType' object
has no attribute 'IsValid'.

Differential Revision:	http://reviews.llvm.org/D10123

llvm-svn: 238600
This commit is contained in:
Ed Maste 2015-05-29 19:38:41 +00:00
parent 0ef0027a0b
commit 36cbc0901f
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ class HandleSegvTestCase(TestBase):
signo = process.GetUnixSignals().GetSignalNumberFromName("SIGSEGV")
thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonSignal)
self.assertTrue(thread.IsValid(), "Thread should be stopped due to a signal")
self.assertTrue(thread and thread.IsValid(), "Thread should be stopped due to a signal")
self.assertTrue(thread.GetStopReasonDataCount() >= 1, "There was data in the event.")
self.assertEqual(thread.GetStopReasonDataAtIndex(0), signo, "The stop signal was SIGSEGV")