diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 |
commit | f3fbd1c0586ff6ec7895991e6c28f61a503c36a8 (patch) | |
tree | 48d008fd3df8c0e73271a4b18474e0aac6dbfe33 /packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py | |
parent | 2fc5d2d1dfaf623ce4e24cd8590565902f8c557c (diff) |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py')
-rw-r--r-- | packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py b/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py index 0ed56de35699a..8636abadd104a 100644 --- a/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py +++ b/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py @@ -8,8 +8,9 @@ from __future__ import print_function import lldb import os import time +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class TestRerun(TestBase): @@ -31,19 +32,9 @@ class TestRerun(TestBase): self.runCmd("process launch 1 2 3") process = self.process() - - self.assertTrue(process.GetState() == lldb.eStateStopped, - STOPPED_DUE_TO_BREAKPOINT) - - thread = process.GetThreadAtIndex (0) - - self.assertTrue (thread.IsValid(), - "Process stopped at 'main' should have a valid thread"); - - stop_reason = thread.GetStopReason() - - self.assertTrue (stop_reason == lldb.eStopReasonBreakpoint, - "Thread in process stopped in 'main' should have a stop reason of eStopReasonBreakpoint"); + thread = lldbutil.get_one_thread_stopped_at_breakpoint(process, breakpoint) + self.assertIsNotNone(thread, "Process should be stopped at a breakpoint in main") + self.assertTrue(thread.IsValid(), "Stopped thread is not valid") self.expect("frame variable argv[1]", substrs=['1']) self.expect("frame variable argv[2]", substrs=['2']) @@ -57,19 +48,10 @@ class TestRerun(TestBase): self.runCmd("process launch") process = self.process() - - self.assertTrue(process.GetState() == lldb.eStateStopped, - STOPPED_DUE_TO_BREAKPOINT) - - thread = process.GetThreadAtIndex (0) + thread = lldbutil.get_one_thread_stopped_at_breakpoint(process, breakpoint) - self.assertTrue (thread.IsValid(), - "Process stopped at 'main' should have a valid thread"); - - stop_reason = thread.GetStopReason() - - self.assertTrue (stop_reason == lldb.eStopReasonBreakpoint, - "Thread in process stopped in 'main' should have a stop reason of eStopReasonBreakpoint"); + self.assertIsNotNone(thread, "Process should be stopped at a breakpoint in main"); + self.assertTrue(thread.IsValid(), "Stopped thread is not valid") self.expect("frame variable argv[1]", substrs=['1']) self.expect("frame variable argv[2]", substrs=['2']) |