summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/test/array_types/TestArrayTypes.py7
-rw-r--r--lldb/test/bitfields/TestBitfields.py7
-rw-r--r--lldb/test/class_types/TestClassTypes.py7
-rw-r--r--lldb/test/hello_world/TestHelloWorld.py7
4 files changed, 16 insertions, 12 deletions
diff --git a/lldb/test/array_types/TestArrayTypes.py b/lldb/test/array_types/TestArrayTypes.py
index 446a5c3b2cf..3e25a7d4935 100644
--- a/lldb/test/array_types/TestArrayTypes.py
+++ b/lldb/test/array_types/TestArrayTypes.py
@@ -120,10 +120,11 @@ class ArrayTypesTestCase(TestBase):
"executable = a.out"])
# The stop reason of the thread should be breakpoint.
- from lldbutil import StopReasonString
thread = self.process.GetThreadAtIndex(0)
- self.assertTrue(thread.GetStopReason() == lldb.eStopReasonBreakpoint,
- STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS % StopReasonString(thread.GetStopReason()))
+ if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
+ from lldbutil import StopReasonString
+ self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
+ StopReasonString(thread.GetStopReason()))
# Sanity check the print representation of thread.
thr = repr(thread)
diff --git a/lldb/test/bitfields/TestBitfields.py b/lldb/test/bitfields/TestBitfields.py
index 9c6aa225d7d..4ae75e76fe6 100644
--- a/lldb/test/bitfields/TestBitfields.py
+++ b/lldb/test/bitfields/TestBitfields.py
@@ -100,10 +100,11 @@ class BitfieldsTestCase(TestBase):
self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
# The stop reason of the thread should be breakpoint.
- from lldbutil import StopReasonString
thread = target.GetProcess().GetThreadAtIndex(0)
- self.assertTrue(thread.GetStopReason() == lldb.eStopReasonBreakpoint,
- STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS % StopReasonString(thread.GetStopReason()))
+ if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
+ from lldbutil import StopReasonString
+ self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
+ StopReasonString(thread.GetStopReason()))
# The breakpoint should have a hit count of 1.
self.assertTrue(breakpoint.GetHitCount() == 1, BREAKPOINT_HIT_ONCE)
diff --git a/lldb/test/class_types/TestClassTypes.py b/lldb/test/class_types/TestClassTypes.py
index 1dfa30e53fd..e4bcb2a797b 100644
--- a/lldb/test/class_types/TestClassTypes.py
+++ b/lldb/test/class_types/TestClassTypes.py
@@ -130,10 +130,11 @@ class ClassTypesTestCase(TestBase):
lldbutil.StateTypeString(self.process.GetState()))
# The stop reason of the thread should be breakpoint.
- from lldbutil import StopReasonString
thread = self.process.GetThreadAtIndex(0)
- self.assertTrue(thread.GetStopReason() == lldb.eStopReasonBreakpoint,
- STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS % StopReasonString(thread.GetStopReason()))
+ if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
+ from lldbutil import StopReasonString
+ self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
+ StopReasonString(thread.GetStopReason()))
# The filename of frame #0 should be 'main.cpp' and the line number
# should be 93.
diff --git a/lldb/test/hello_world/TestHelloWorld.py b/lldb/test/hello_world/TestHelloWorld.py
index 21d62f54347..e2497d415b1 100644
--- a/lldb/test/hello_world/TestHelloWorld.py
+++ b/lldb/test/hello_world/TestHelloWorld.py
@@ -68,10 +68,11 @@ class HelloWorldTestCase(TestBase):
self.process = target.GetProcess()
self.assertTrue(self.process.IsValid(), PROCESS_IS_VALID)
- from lldbutil import StopReasonString
thread = self.process.GetThreadAtIndex(0)
- self.assertTrue(thread.GetStopReason() == lldb.eStopReasonBreakpoint,
- STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS % StopReasonString(thread.GetStopReason()))
+ if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
+ from lldbutil import StopReasonString
+ self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
+ StopReasonString(thread.GetStopReason()))
# The breakpoint should have a hit count of 1.
self.assertTrue(breakpoint.GetHitCount() == 1, BREAKPOINT_HIT_ONCE)
OpenPOWER on IntegriCloud