summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/target/TestTargetAPI.py
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-04-23 00:13:34 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-04-23 00:13:34 +0000
commit90256cdaba4e739e17bb23563db22e7227414272 (patch)
tree5de8082eeef604982653f10e2266e9def51fbd07 /lldb/test/python_api/target/TestTargetAPI.py
parenta6cb0642b22774ab23f6ade3502c9f8dabf64072 (diff)
downloadbcm5719-llvm-90256cdaba4e739e17bb23563db22e7227414272.tar.gz
bcm5719-llvm-90256cdaba4e739e17bb23563db22e7227414272.zip
Add a simple utility function get_description(lldb_obj, option=None) to lldbutil.py
and use it from TestTargetAPI.py. llvm-svn: 130038
Diffstat (limited to 'lldb/test/python_api/target/TestTargetAPI.py')
-rw-r--r--lldb/test/python_api/target/TestTargetAPI.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/lldb/test/python_api/target/TestTargetAPI.py b/lldb/test/python_api/target/TestTargetAPI.py
index c1257185c74..fd278e242e2 100644
--- a/lldb/test/python_api/target/TestTargetAPI.py
+++ b/lldb/test/python_api/target/TestTargetAPI.py
@@ -66,18 +66,19 @@ class TargetAPITestCase(TestBase):
target = self.dbg.CreateTarget(exe)
self.assertTrue(target.IsValid(), VALID_TARGET)
- stream = lldb.SBStream()
- if not target.GetDescription(stream, lldb.eDescriptionLevelBrief):
+ from lldbutil import get_description
+ desc = get_description(target, option=lldb.eDescriptionLevelBrief)
+ if not desc:
self.fail("SBTarget.GetDescription() failed")
- self.expect(stream.GetData(), exe=False,
+ self.expect(desc, exe=False,
substrs = ['a.out'])
- self.expect(stream.GetData(), exe=False, matching=False,
+ self.expect(desc, exe=False, matching=False,
substrs = ['Target', 'Module', 'Breakpoint'])
- stream.Clear()
- if not target.GetDescription(stream, lldb.eDescriptionLevelFull):
+ desc = get_description(target, option=lldb.eDescriptionLevelFull)
+ if not desc:
self.fail("SBTarget.GetDescription() failed")
- self.expect(stream.GetData(), exe=False,
+ self.expect(desc, exe=False,
substrs = ['a.out', 'Target', 'Module', 'Breakpoint'])
OpenPOWER on IntegriCloud