summaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 11:09:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 11:09:23 +0000
commitf73363f1dd94996356cefbf24388f561891acf0b (patch)
treee3c31248bdb36eaec5fd833490d4278162dba2a0 /packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
parent160ee69dd7ae18978f4068116777639ea98dc951 (diff)
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py')
-rw-r--r--packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py b/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
index 632244e8b9e6..8a4af0cc2b94 100644
--- a/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
+++ b/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
@@ -33,7 +33,7 @@ class ValueAPITestCase(TestBase):
d = {'EXE': self.exe_name}
self.build(dictionary=d)
self.setTearDownCleanup(dictionary=d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -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)