Modify test cases to accomodate Python API change:

o SBFrame.LookupVar -> FindVariable
o SBFrame.LookupVarInScope -> FindValue

llvm-svn: 121782
This commit is contained in:
Johnny Chen 2010-12-14 18:59:15 +00:00
parent d5e38383e0
commit 94f928b83f
6 changed files with 14 additions and 14 deletions

View File

@ -153,7 +153,7 @@ class ArrayTypesTestCase(TestBase):
# Lookup the "strings" string array variable and sanity check its print
# representation.
variable = frame.LookupVar("strings")
variable = frame.FindVariable("strings")
var = repr(variable)
self.expect(var, "Variable for 'strings' looks good with correct name", exe=False,
substrs = ["name: '%s'" % variable.GetName()])
@ -167,7 +167,7 @@ class ArrayTypesTestCase(TestBase):
'strings[3] == "Guten Tag"')
# Lookup the "char_16" char array variable.
variable = frame.LookupVar("char_16")
variable = frame.FindVariable("char_16")
self.DebugSBValue(frame, variable)
self.assertTrue(variable.GetNumChildren() == 16,
"Variable 'char_16' should have 16 children")
@ -176,7 +176,7 @@ class ArrayTypesTestCase(TestBase):
# Notice the pattern of int(child0_2.GetValue(frame), 0). We pass a
# base of 0 so that the proper radix is determined based on the contents
# of the string. Same applies to long().
variable = frame.LookupVar("ushort_matrix")
variable = frame.FindVariable("ushort_matrix")
self.DebugSBValue(frame, variable)
self.assertTrue(variable.GetNumChildren() == 2,
"Variable 'ushort_matrix' should have 2 children")
@ -190,7 +190,7 @@ class ArrayTypesTestCase(TestBase):
"ushort_matrix[0][2] == 3")
# Lookup the "long_6" char array variable.
variable = frame.LookupVar("long_6")
variable = frame.FindVariable("long_6")
self.DebugSBValue(frame, variable)
self.assertTrue(variable.GetNumChildren() == 6,
"Variable 'long_6' should have 6 children")
@ -205,7 +205,7 @@ class ArrayTypesTestCase(TestBase):
self.assertTrue(variable.GetValueType() == lldb.eValueTypeVariableLocal,
"Variable 'long_6' should have '%s' value type." %
ValueTypeString(lldb.eValueTypeVariableLocal))
argc = frame.LookupVar("argc")
argc = frame.FindVariable("argc")
self.DebugSBValue(frame, argc)
self.assertTrue(argc.GetValueType() == lldb.eValueTypeVariableArgument,
"Variable 'argc' should have '%s' value type." %

View File

@ -109,7 +109,7 @@ class BitfieldsTestCase(TestBase):
# Lookup the "bits" variable which contains 8 bitfields.
frame = thread.GetFrameAtIndex(0)
bits = frame.LookupVar("bits")
bits = frame.FindVariable("bits")
self.DebugSBValue(frame, bits)
self.assertTrue(bits.GetTypeName() == "Bits" and
bits.GetNumChildren() == 8 and

View File

@ -133,7 +133,7 @@ class BreakpointConditionsTestCase(TestBase):
# Frame #0 should be on self.line1 and the break condition should hold.
frame0 = self.process.GetThreadAtIndex(0).GetFrameAtIndex(0)
var = frame0.LookupVarInScope('val', 'parameter')
var = frame0.FindValue('val', lldb.eValueTypeVariableArgument)
self.assertTrue(frame0.GetLineEntry().GetLine() == self.line1 and
var.GetValue(frame0) == '3')

View File

@ -119,21 +119,21 @@ class StaticVariableTestCase(TestBase):
self.assertTrue(child1_x.GetTypeName() == 'int' and
child1_x.GetValue(frame) == '11')
# SBFrame.LookupVarInScope() should also work.
val = frame.LookupVarInScope("A::g_points", "global")
# SBFrame.FindValue() should also work.
val = frame.FindValue("A::g_points", lldb.eValueTypeVariableGlobal)
self.DebugSBValue(frame, val)
self.assertTrue(val.GetName() == 'A::g_points')
# Also exercise the "parameter" and "local" scopes while we are at it.
val = frame.LookupVarInScope("argc", "parameter")
val = frame.FindValue("argc", lldb.eValueTypeVariableArgument)
self.DebugSBValue(frame, val)
self.assertTrue(val.GetName() == 'argc')
val = frame.LookupVarInScope("argv", "parameter")
val = frame.FindValue("argv", lldb.eValueTypeVariableArgument)
self.DebugSBValue(frame, val)
self.assertTrue(val.GetName() == 'argv')
val = frame.LookupVarInScope("hello_world", "local")
val = frame.FindValue("hello_world", lldb.eValueTypeVariableLocal)
self.DebugSBValue(frame, val)
self.assertTrue(val.GetName() == 'hello_world')

View File

@ -89,7 +89,7 @@ class ConditionalBreakTestCase(TestBase):
"Immediate caller a() at main.c:%d" % line)
# And the local variable 'val' should have a value of (int) 3.
val = frame1.LookupVar("val")
val = frame1.FindVariable("val")
self.assertTrue(val.GetTypeName() == "int", "'val' has int type")
self.assertTrue(val.GetValue(frame1) == "3", "'val' has a value of 3")
break

View File

@ -80,7 +80,7 @@ class TestObjCStepping(TestBase):
line_number = thread.GetFrameAtIndex(0).GetLineEntry().GetLine()
self.assertTrue (line_number == self.line1, "Hit the first breakpoint.")
mySource = thread.GetFrameAtIndex(0).LookupVar("mySource")
mySource = thread.GetFrameAtIndex(0).FindVariable("mySource")
self.assertTrue(mySource.IsValid(), "Found mySource local variable.")
mySource_isa = mySource.GetChildMemberWithName ("isa")
self.assertTrue(mySource_isa.IsValid(), "Found mySource->isa local variable.")