diff options
| author | Johnny Chen <johnny.chen@apple.com> | 2011-04-23 00:34:56 +0000 |
|---|---|---|
| committer | Johnny Chen <johnny.chen@apple.com> | 2011-04-23 00:34:56 +0000 |
| commit | 9ae982053f526d7368a7b619181119525475511f (patch) | |
| tree | 856dee5c474f1e5a988d0d61bd3000c668217eba /lldb/test/python_api | |
| parent | aa3d6242cfb3a21922f7ec13cbd5b65303a51f80 (diff) | |
| download | bcm5719-llvm-9ae982053f526d7368a7b619181119525475511f.tar.gz bcm5719-llvm-9ae982053f526d7368a7b619181119525475511f.zip | |
Convert the rest of the test suite to use the lldbutil.get_description() utility function.
llvm-svn: 130041
Diffstat (limited to 'lldb/test/python_api')
| -rw-r--r-- | lldb/test/python_api/event/TestEvents.py | 8 | ||||
| -rw-r--r-- | lldb/test/python_api/function_symbol/TestDisasmAPI.py | 12 | ||||
| -rw-r--r-- | lldb/test/python_api/symbol-context/TestSymbolContext.py | 5 | ||||
| -rw-r--r-- | lldb/test/python_api/target/TestTargetAPI.py | 12 |
4 files changed, 15 insertions, 22 deletions
diff --git a/lldb/test/python_api/event/TestEvents.py b/lldb/test/python_api/event/TestEvents.py index 8bd3afd58d9..74da057463c 100644 --- a/lldb/test/python_api/event/TestEvents.py +++ b/lldb/test/python_api/event/TestEvents.py @@ -165,11 +165,9 @@ class EventAPITestCase(TestBase): broadcaster, lldb.SBProcess.eBroadcastBitStateChanged, event): - stream = lldb.SBStream() - event.GetDescription(stream) - description = stream.GetData() - #print "Event description:", description - match = pattern.search(description) + desc = lldbutil.get_description(event) + #print "Event description:", desc + match = pattern.search(desc) if not match: break; if self.context.state == 0 and match.group(1) == 'running': diff --git a/lldb/test/python_api/function_symbol/TestDisasmAPI.py b/lldb/test/python_api/function_symbol/TestDisasmAPI.py index 0f36cd854c3..662860564e1 100644 --- a/lldb/test/python_api/function_symbol/TestDisasmAPI.py +++ b/lldb/test/python_api/function_symbol/TestDisasmAPI.py @@ -109,13 +109,11 @@ class DisasmAPITestCase(TestBase): #ea2 = function.GetEndAddress() #print "ea2:", ea2 - stream1 = lldb.SBStream() - sa1.GetDescription(stream1) - stream2 = lldb.SBStream() - sa2.GetDescription(stream2) - - self.expect(stream1.GetData(), "The two starting addresses should be the same", exe=False, - startstr = stream2.GetData()) + from lldbutil import get_description + desc1 = get_description(sa1) + desc2 = get_description(sa2) + self.assertTrue(desc1 and desc2 and desc1 == desc2, + "The two starting addresses should be the same") if __name__ == '__main__': diff --git a/lldb/test/python_api/symbol-context/TestSymbolContext.py b/lldb/test/python_api/symbol-context/TestSymbolContext.py index a1e1a806f05..6213490aea9 100644 --- a/lldb/test/python_api/symbol-context/TestSymbolContext.py +++ b/lldb/test/python_api/symbol-context/TestSymbolContext.py @@ -65,9 +65,8 @@ class SymbolContextAPITestCase(TestBase): # Get the description of this module. module = context.GetModule() - stream = lldb.SBStream() - module.GetDescription(stream) - self.expect(stream.GetData(), "The module should match", exe=False, + desc = lldbutil.get_description(module) + self.expect(desc, "The module should match", exe=False, substrs = [os.path.join(self.mydir, 'a.out')]) compileUnit = context.GetCompileUnit() diff --git a/lldb/test/python_api/target/TestTargetAPI.py b/lldb/test/python_api/target/TestTargetAPI.py index fd278e242e2..a112de5de28 100644 --- a/lldb/test/python_api/target/TestTargetAPI.py +++ b/lldb/test/python_api/target/TestTargetAPI.py @@ -189,13 +189,11 @@ class TargetAPITestCase(TestBase): #print "symbol1:", symbol1 #print "symbol2:", symbol2 - stream1 = lldb.SBStream() - symbol1.GetDescription(stream1) - stream2 = lldb.SBStream() - symbol2.GetDescription(stream2) - - self.expect(stream1.GetData(), "The two addresses should resolve to the same symbol", exe=False, - startstr = stream2.GetData()) + from lldbutil import get_description + desc1 = get_description(symbol1) + desc2 = get_description(symbol2) + self.assertTrue(desc1 and desc2 and desc1 == desc2, + "The two addresses should resolve to the same symbol") if __name__ == '__main__': |

