forked from OSchip/llvm-project
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:
parent
0ef0027a0b
commit
36cbc0901f
|
@ -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")
|
||||
|
||||
|
|
Loading…
Reference in New Issue