summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-07-25 19:57:43 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-07-25 19:57:43 +0000
commitca24cfa42776a93acd39aa436b870de31bb18bd4 (patch)
treefa4d41b31cf052a26f4fe3c2c823b32d463fc7e7 /lldb/test/python_api
parent20b31548e69805a908f56f809644319a8bb502b6 (diff)
downloadbcm5719-llvm-ca24cfa42776a93acd39aa436b870de31bb18bd4.tar.gz
bcm5719-llvm-ca24cfa42776a93acd39aa436b870de31bb18bd4.zip
Add a stronger assert for the test to ensure that the visited items from iterating through
the SBValue.linked_list_iter() API is equal to [1, 2, 4, 5]. llvm-svn: 135944
Diffstat (limited to 'lldb/test/python_api')
-rw-r--r--lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py b/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py
index 2720b2cef23..77801d37477 100644
--- a/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py
+++ b/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py
@@ -83,11 +83,20 @@ class ValueAsLinkedListTestCase(TestBase):
self.assertTrue(task_head, VALID_VARIABLE)
self.DebugSBValue(task_head)
+ # By design (see main.cpp), the visited id's are: [1, 2, 4, 5].
+ visitedIDs = [1, 2, 4, 5]
+ list = []
+
cvf = lldbutil.ChildVisitingFormatter(indent_child=2)
for t in task_head.linked_list_iter('next', eol):
self.assertTrue(t, VALID_VARIABLE)
+ list.append(int(t.GetChildMemberWithName("id").GetValue()))
if self.TraceOn():
print cvf.format(t)
+
+ # Sanity checks that the we visited all the items (no more, no less).
+ #print "list:", list
+ self.assertTrue(visitedIDs == list)
if __name__ == '__main__':
import atexit
OpenPOWER on IntegriCloud