From beae523a204e69f658c6939ae0fc5d109e9f636e Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Fri, 19 Nov 2010 18:07:14 +0000 Subject: Fill in more test sequences for Python API SBFrame.LookupVarInScope(name, scope). Change SBFrame::LookupVarInScope() to also work with "global" scope in addition to "local" and "parameter" scope. llvm-svn: 119811 --- lldb/test/class_static/TestStaticVariables.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'lldb/test/class_static/TestStaticVariables.py') diff --git a/lldb/test/class_static/TestStaticVariables.py b/lldb/test/class_static/TestStaticVariables.py index cfcfaa96f7e..c9a5f6685d4 100644 --- a/lldb/test/class_static/TestStaticVariables.py +++ b/lldb/test/class_static/TestStaticVariables.py @@ -116,8 +116,23 @@ class StaticVariableTestCase(TestBase): self.assertTrue(child1_x.GetTypeName() == 'int' and child1_x.GetValue(frame) == '11') - #variable = frame.LookupVarInScope("A::g_points", "global") - #print "variable:", repr(variable) + # SBFrame.LookupVarInScope() should also work. + val = frame.LookupVarInScope("A::g_points", "global") + 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") + self.DebugSBValue(frame, val) + self.assertTrue(val.GetName() == 'argc') + + val = frame.LookupVarInScope("argv", "parameter") + self.DebugSBValue(frame, val) + self.assertTrue(val.GetName() == 'argv') + + val = frame.LookupVarInScope("hello_world", "local") + self.DebugSBValue(frame, val) + self.assertTrue(val.GetName() == 'hello_world') if __name__ == '__main__': -- cgit v1.2.3