summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/python_api/symbol-context
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-04-03 11:48:38 +0000
committerPavel Labath <pavel@labath.sk>2019-04-03 11:48:38 +0000
commit4da5a1dbab579da5975de573719c50fd3c1faeab (patch)
treeebf2ba238469a703f9ab0aef2f3cb4c98b9f1d21 /lldb/packages/Python/lldbsuite/test/python_api/symbol-context
parent02599de2e1e9688ed74e2d1080c4e4f73c6072af (diff)
downloadbcm5719-llvm-4da5a1dbab579da5975de573719c50fd3c1faeab.tar.gz
bcm5719-llvm-4da5a1dbab579da5975de573719c50fd3c1faeab.zip
modify-python-lldb.py: clean up __iter__ and __len__ support
Summary: Instead of modifying the swig-generated code, just add the appropriate methods to the interface files in order to get the swig to do the generation for us. This is a straight-forward move from the python script to the interface files. The single class which has nontrivial handling in the script (SBModule) has been left for a separate patch. For the cases where I did not find any tests exercising the iteration/length methods (i.e., no tests failed after I stopped emitting them), I tried to add basic tests for that functionality. Reviewers: zturner, jingham, amccarth Subscribers: jdoerfert, lldb-commits Differential Revision: https://reviews.llvm.org/D60119 llvm-svn: 357572
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/symbol-context')
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py b/lldb/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py
index 2b783fb90e5..57988da1ed9 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py
@@ -102,3 +102,9 @@ class SymbolContextAPITestCase(TestBase):
self.assertTrue(
function.GetName() == symbol.GetName() and symbol.GetName() == 'c',
"The symbol name should be 'c'")
+
+ sc_list = lldb.SBSymbolContextList()
+ sc_list.Append(context)
+ self.assertEqual(len(sc_list), 1)
+ for sc in sc_list:
+ self.assertEqual(lineEntry, sc.GetLineEntry())
OpenPOWER on IntegriCloud