diff options
Diffstat (limited to 'packages/Python/lldbsuite/test/python_api/value')
4 files changed, 24 insertions, 8 deletions
diff --git a/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py b/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py index 77ff07ea64884..2a53177d28aff 100644 --- a/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py +++ b/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py @@ -4,13 +4,14 @@ Test some SBValue APIs. from __future__ import print_function - - -import os, time +import os import re +import time + import lldb -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil class ValueAPITestCase(TestBase): @@ -24,7 +25,7 @@ class ValueAPITestCase(TestBase): # Find the line number to of function 'c'. self.line = line_number('main.c', '// Break at this line') - @expectedFailureWindows("llvm.org/pr24772") + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24772") @add_test_categories(['pyapi']) def test(self): """Exercise some SBValue APIs.""" @@ -133,3 +134,12 @@ class ValueAPITestCase(TestBase): val_a = target.EvaluateExpression('a') self.assertTrue(val_s.GetChildMemberWithName('a').AddressOf(), VALID_VARIABLE) self.assertTrue(val_a.Cast(val_i.GetType()).AddressOf(), VALID_VARIABLE) + + self.assertTrue(int(lldb.value(frame0.FindVariable('uinthex'))) == 3768803088, 'uinthex == 3768803088') + self.assertTrue(int(lldb.value(frame0.FindVariable('sinthex'))) == -526164208, 'sinthex == -526164208') + + self.assertTrue(frame0.FindVariable('uinthex').GetValueAsUnsigned() == 3768803088, 'unsigned uinthex == 3768803088') + self.assertTrue(frame0.FindVariable('sinthex').GetValueAsUnsigned() == 3768803088, 'unsigned sinthex == 3768803088') + + self.assertTrue(frame0.FindVariable('uinthex').GetValueAsSigned() == -526164208, 'signed uinthex == -526164208') + self.assertTrue(frame0.FindVariable('sinthex').GetValueAsSigned() == -526164208, 'signed sinthex == -526164208') 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 f8ad97277f05b..52c91e0b2621f 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 @@ -9,8 +9,9 @@ from __future__ import print_function import os, time import re import lldb -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil class ChangeValueAPITestCase(TestBase): @@ -26,9 +27,9 @@ class ChangeValueAPITestCase(TestBase): self.check_line = line_number('main.c', '// Stop here and check values') self.end_line = line_number ('main.c', '// Set a breakpoint here at the end') - @expectedFailureWindows("llvm.org/pr24772") @add_test_categories(['pyapi']) @expectedFlakeyLinux("llvm.org/pr25652") + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24772") def test_change_value(self): """Exercise the SBValue::SetValueFromCString API.""" d = {'EXE': self.exe_name} 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 8b60be97bdc26..879efd186d68c 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 @@ -10,8 +10,9 @@ from __future__ import print_function import os, time import re import lldb -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil class ValueAsLinkedListTestCase(TestBase): diff --git a/packages/Python/lldbsuite/test/python_api/value/main.c b/packages/Python/lldbsuite/test/python_api/value/main.c index a00795750de03..2ebe3ad303cfa 100644 --- a/packages/Python/lldbsuite/test/python_api/value/main.c +++ b/packages/Python/lldbsuite/test/python_api/value/main.c @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// #include <stdio.h> +#include <stdint.h> // This simple program is to test the lldb Python API SBValue.GetChildAtIndex(). @@ -38,6 +39,9 @@ struct MyStruct int main (int argc, char const *argv[]) { + uint32_t uinthex = 0xE0A35F10; + int32_t sinthex = 0xE0A35F10; + int i; MyInt a = 12345; struct MyStruct s = { 11, 22 }; |