summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2018-05-04 01:31:47 +0000
committerJim Ingham <jingham@apple.com>2018-05-04 01:31:47 +0000
commit0fd685353df630653563da658fe04c566a7d24c4 (patch)
treea370e55ef8e9da3b682fe65b953dfd232a0e8c9f /lldb/packages/Python/lldbsuite/test
parent9510f7063657b8be12c0dafa67c9029669b8d6fa (diff)
downloadbcm5719-llvm-0fd685353df630653563da658fe04c566a7d24c4.tar.gz
bcm5719-llvm-0fd685353df630653563da658fe04c566a7d24c4.zip
Add children and child[N] properties to SBValue.i.
Also fixed some bad formatting in SBValue.i. llvm-svn: 331501
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py b/lldb/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
index 3890b923e75..8a4af0cc2b9 100644
--- a/lldb/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
+++ b/lldb/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
@@ -61,9 +61,23 @@ class ValueAPITestCase(TestBase):
list = target.FindGlobalVariables('days_of_week', 1)
days_of_week = list.GetValueAtIndex(0)
self.assertTrue(days_of_week, VALID_VARIABLE)
- self.assertTrue(days_of_week.GetNumChildren() == 7, VALID_VARIABLE)
+ self.assertEqual(days_of_week.GetNumChildren(), 7, VALID_VARIABLE)
self.DebugSBValue(days_of_week)
+ # Use this to test the "child" and "children" accessors:
+ children = days_of_week.children
+ self.assertEqual(len(children), 7, VALID_VARIABLE)
+ for i in range(0, len(children)):
+ day = days_of_week.child[i]
+ list_day = children[i]
+ self.assertNotEqual(day, None)
+ self.assertNotEqual(list_day, None)
+ self.assertEqual(day.GetSummary(), list_day.GetSummary(), VALID_VARIABLE)
+
+ # Spot check the actual value:
+ first_day = days_of_week.child[1]
+ self.assertEqual(first_day.GetSummary(), '"Monday"', VALID_VARIABLE)
+
# Get global variable 'weekdays'.
list = target.FindGlobalVariables('weekdays', 1)
weekdays = list.GetValueAtIndex(0)
OpenPOWER on IntegriCloud