[Lldb-commits] [lldb] r130041 - in /lldb/trunk/test/python_api: event/TestEvents.py function_symbol/TestDisasmAPI.py symbol-context/TestSymbolContext.py target/TestTargetAPI.py
Johnny Chen
johnny.chen at apple.com
Fri Apr 22 17:34:56 PDT 2011
Author: johnny
Date: Fri Apr 22 19:34:56 2011
New Revision: 130041
URL: http://llvm.org/viewvc/llvm-project?rev=130041&view=rev
Log:
Convert the rest of the test suite to use the lldbutil.get_description() utility function.
Modified:
lldb/trunk/test/python_api/event/TestEvents.py
lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py
lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py
lldb/trunk/test/python_api/target/TestTargetAPI.py
Modified: lldb/trunk/test/python_api/event/TestEvents.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/event/TestEvents.py?rev=130041&r1=130040&r2=130041&view=diff
==============================================================================
--- lldb/trunk/test/python_api/event/TestEvents.py (original)
+++ lldb/trunk/test/python_api/event/TestEvents.py Fri Apr 22 19:34:56 2011
@@ -165,11 +165,9 @@
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':
Modified: lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py?rev=130041&r1=130040&r2=130041&view=diff
==============================================================================
--- lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py (original)
+++ lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py Fri Apr 22 19:34:56 2011
@@ -109,13 +109,11 @@
#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__':
Modified: lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py?rev=130041&r1=130040&r2=130041&view=diff
==============================================================================
--- lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py (original)
+++ lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py Fri Apr 22 19:34:56 2011
@@ -65,9 +65,8 @@
# 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()
Modified: lldb/trunk/test/python_api/target/TestTargetAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/target/TestTargetAPI.py?rev=130041&r1=130040&r2=130041&view=diff
==============================================================================
--- lldb/trunk/test/python_api/target/TestTargetAPI.py (original)
+++ lldb/trunk/test/python_api/target/TestTargetAPI.py Fri Apr 22 19:34:56 2011
@@ -189,13 +189,11 @@
#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__':
More information about the lldb-commits
mailing list