[Lldb-commits] [lldb] r118731 - in /lldb/trunk/test: array_types/TestArrayTypes.py bitfields/TestBitfields.py class_types/TestClassTypes.py hello_world/TestHelloWorld.py

Johnny Chen johnny.chen at apple.com
Wed Nov 10 15:14:41 PST 2010


Author: johnny
Date: Wed Nov 10 17:14:41 2010
New Revision: 118731

URL: http://llvm.org/viewvc/llvm-project?rev=118731&view=rev
Log:
Slight changes to how to phrase the assert for Python API thread.GetStopReason().

Modified:
    lldb/trunk/test/array_types/TestArrayTypes.py
    lldb/trunk/test/bitfields/TestBitfields.py
    lldb/trunk/test/class_types/TestClassTypes.py
    lldb/trunk/test/hello_world/TestHelloWorld.py

Modified: lldb/trunk/test/array_types/TestArrayTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/array_types/TestArrayTypes.py?rev=118731&r1=118730&r2=118731&view=diff
==============================================================================
--- lldb/trunk/test/array_types/TestArrayTypes.py (original)
+++ lldb/trunk/test/array_types/TestArrayTypes.py Wed Nov 10 17:14:41 2010
@@ -120,10 +120,11 @@
                        "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)

Modified: lldb/trunk/test/bitfields/TestBitfields.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/bitfields/TestBitfields.py?rev=118731&r1=118730&r2=118731&view=diff
==============================================================================
--- lldb/trunk/test/bitfields/TestBitfields.py (original)
+++ lldb/trunk/test/bitfields/TestBitfields.py Wed Nov 10 17:14:41 2010
@@ -100,10 +100,11 @@
         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)

Modified: lldb/trunk/test/class_types/TestClassTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/class_types/TestClassTypes.py?rev=118731&r1=118730&r2=118731&view=diff
==============================================================================
--- lldb/trunk/test/class_types/TestClassTypes.py (original)
+++ lldb/trunk/test/class_types/TestClassTypes.py Wed Nov 10 17:14:41 2010
@@ -130,10 +130,11 @@
                       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.

Modified: lldb/trunk/test/hello_world/TestHelloWorld.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/hello_world/TestHelloWorld.py?rev=118731&r1=118730&r2=118731&view=diff
==============================================================================
--- lldb/trunk/test/hello_world/TestHelloWorld.py (original)
+++ lldb/trunk/test/hello_world/TestHelloWorld.py Wed Nov 10 17:14:41 2010
@@ -68,10 +68,11 @@
         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)





More information about the lldb-commits mailing list