[Lldb-commits] [lldb] r114970 - /lldb/trunk/test/array_types/TestArrayTypes.py

Johnny Chen johnny.chen at apple.com
Tue Sep 28 11:13:05 PDT 2010


Author: johnny
Date: Tue Sep 28 13:13:04 2010
New Revision: 114970

URL: http://llvm.org/viewvc/llvm-project?rev=114970&view=rev
Log:
Sanity check the print representations of SBThread, SBFrame, and SBValue.

Modified:
    lldb/trunk/test/array_types/TestArrayTypes.py

Modified: lldb/trunk/test/array_types/TestArrayTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/array_types/TestArrayTypes.py?rev=114970&r1=114969&r2=114970&view=diff
==============================================================================
--- lldb/trunk/test/array_types/TestArrayTypes.py (original)
+++ lldb/trunk/test/array_types/TestArrayTypes.py Tue Sep 28 13:13:04 2010
@@ -111,8 +111,13 @@
         self.assertTrue(thread.GetStopReason() == StopReasonEnum("Breakpoint"),
                         STOPPED_DUE_TO_BREAKPOINT)
 
-        #thr = repr(thread)
-        #print "thr:", thr
+        # Sanity check the print representation of thread.
+        thr = repr(thread)
+        self.expect(thr, "Thread looks good with stop reason = breakpoint", exe=False,
+            substrs = ["thread #%d: tid = 0x%4.4x" % (thread.GetIndexID(), thread.GetThreadID()),
+                       "stop reason = breakpoint",
+                       "queue = %s" % thread.GetQueueName() if thread.GetQueueName() else "",
+                       "%d frames" % thread.GetNumFrames()])
 
         # The breakpoint should have a hit count of 1.
         self.assertTrue(breakpoint.GetHitCount() == 1, BREAKPOINT_HIT_ONCE)
@@ -125,13 +130,21 @@
                        "locations = 1",
                        "resolved = 1"])
 
-        # Lookup the "strings" string array variable.
+        # Sanity check the print representation of frame.
         frame = thread.GetFrameAtIndex(0)
-        #frm = repr(frame)
-        #print "frm:", frm
+        frm = repr(frame)
+        self.expect(frm, "Thread looks good with correct frame function", exe=False,
+            substrs = ["frame #%d" % frame.GetFrameID(),
+                       "a.out`%s" % frame.GetFunction().GetName()])
+
+        # Lookup the "strings" string array variable and sanity check its print
+        # representation.
         variable = frame.LookupVar("strings")
-        #var = repr(variable)
-        #print "var:", var
+        var = repr(variable)
+        self.expect(var, "Variable for 'strings' looks good with correct type and size", exe=False,
+            substrs = ["name: '%s'" % variable.GetName(),
+                       "type: %s" % variable.GetTypeName(),
+                       "size: %d" % variable.GetByteSize()])
         self.DebugSBValue(frame, variable)
         self.assertTrue(variable.GetNumChildren() == 4,
                         "Variable 'strings' should have 4 children")





More information about the lldb-commits mailing list