diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:09:23 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:09:23 +0000 |
| commit | f73363f1dd94996356cefbf24388f561891acf0b (patch) | |
| tree | e3c31248bdb36eaec5fd833490d4278162dba2a0 /packages/Python/lldbsuite/test/python_api/value | |
| parent | 160ee69dd7ae18978f4068116777639ea98dc951 (diff) | |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/python_api/value')
4 files changed, 19 insertions, 5 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) diff --git a/packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py b/packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py index 64c7fde22670..18d39d9675c8 100644 --- a/packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py +++ b/packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py @@ -38,7 +38,7 @@ class ChangeValueAPITestCase(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) diff --git a/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py b/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py index c4b1e282590c..6fa72837484e 100644 --- a/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py +++ b/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py @@ -15,7 +15,7 @@ class ValueAPIEmptyClassTestCase(TestBase): @add_test_categories(['pyapi']) def test(self): self.build() - exe = os.path.join(os.getcwd(), 'a.out') + exe = self.getBuildArtifact("a.out") line = line_number('main.cpp', '// Break at this line') # Create a target by the debugger. diff --git a/packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py b/packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py index d5f53d712e7d..1b009521d253 100644 --- a/packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py +++ b/packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py @@ -36,7 +36,7 @@ class ValueAsLinkedListTestCase(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) |
