diff options
Diffstat (limited to 'packages/Python/lldbsuite/test/lang/cpp/char1632_t')
| -rw-r--r-- | packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py | 84 | 
1 files changed, 58 insertions, 26 deletions
| diff --git a/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py b/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py index d4400d3a488d..bf8605106adb 100644 --- a/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py +++ b/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py @@ -6,13 +6,14 @@ Test that the C++11 support for char16_t and char32_t works correctly.  from __future__ import print_function - -import os, time +import os +import time  import lldb  from lldbsuite.test.decorators import *  from lldbsuite.test.lldbtest import *  from lldbsuite.test import lldbutil +  class Char1632TestCase(TestBase):      mydir = TestBase.compute_mydir(__file__) @@ -22,10 +23,12 @@ class Char1632TestCase(TestBase):          TestBase.setUp(self)          # Find the line number to break for main.cpp.          self.source = 'main.cpp' -        self.lines = [ line_number(self.source, '// breakpoint1'),  -                       line_number(self.source, '// breakpoint2') ] +        self.lines = [line_number(self.source, '// breakpoint1'), +                      line_number(self.source, '// breakpoint2')] -    @expectedFailureAll(compiler="icc", bugnumber="ICC (13.1) does not emit the DW_TAG_base_type for char16_t and char32_t.") +    @expectedFailureAll( +        compiler="icc", +        bugnumber="ICC (13.1) does not emit the DW_TAG_base_type for char16_t and char32_t.")      def test(self):          """Test that the C++11 support for char16_t and char32_t works correctly."""          self.build() @@ -37,54 +40,83 @@ class Char1632TestCase(TestBase):          # Set breakpoints          for line in self.lines: -            lldbutil.run_break_set_by_file_and_line (self, "main.cpp", line) +            lldbutil.run_break_set_by_file_and_line(self, "main.cpp", line) -        # Now launch the process, and do not stop at entry point and stop at breakpoint1 -        process = target.LaunchSimple (None, None, self.get_process_working_directory()) +        # Now launch the process, and do not stop at entry point and stop at +        # breakpoint1 +        process = target.LaunchSimple( +            None, None, self.get_process_working_directory())          if not process:              self.fail("SBTarget.Launch() failed")          if self.TraceOn(): -             self.runCmd("frame variable") +            self.runCmd("frame variable")          # Check that we correctly report the const types -        self.expect("frame variable cs16 cs32", -            substrs = ['(const char16_t *) cs16 = ','(const char32_t *) cs32 = ','u"hello world ྒྙྐ"','U"hello world ྒྙྐ"']) +        self.expect( +            "frame variable cs16 cs32", +            substrs=[ +                '(const char16_t *) cs16 = ', +                '(const char32_t *) cs32 = ', +                'u"hello world ྒྙྐ"', +                'U"hello world ྒྙྐ"'])          # Check that we correctly report the non-const types -        self.expect("frame variable s16 s32", -            substrs = ['(char16_t *) s16 = ','(char32_t *) s32 = ','u"ﺸﺵۻ"','U"ЕЙРГЖО"']) +        self.expect( +            "frame variable s16 s32", +            substrs=[ +                '(char16_t *) s16 = ', +                '(char32_t *) s32 = ', +                'u"ﺸﺵۻ"', +                'U"ЕЙРГЖО"'])          # Check that we correctly report the array types -        self.expect("frame variable as16 as32", -            patterns = ['\(char16_t \[[0-9]+\]\) as16 = ', '\(char32_t \[[0-9]+\]\) as32 = '], -            substrs = ['u"ﺸﺵۻ"','U"ЕЙРГЖО"']) +        self.expect( +            "frame variable as16 as32", +            patterns=[ +                '\(char16_t \[[0-9]+\]\) as16 = ', +                '\(char32_t \[[0-9]+\]\) as32 = '], +            substrs=[ +                'u"ﺸﺵۻ"', +                'U"ЕЙРГЖО"']) -        self.runCmd("next") # step to after the string is nullified +        self.runCmd("next")  # step to after the string is nullified          # check that we don't crash on NULL          self.expect("frame variable s32", -            substrs = ['(char32_t *) s32 = 0x00000000']) +                    substrs=['(char32_t *) s32 = 0x00000000'])          # continue and hit breakpoint2          self.runCmd("continue")          # check that the new strings show -        self.expect("frame variable s16 s32", -            substrs = ['(char16_t *) s16 = 0x','(char32_t *) s32 = ','"色ハ匂ヘト散リヌルヲ"','"෴"']) +        self.expect( +            "frame variable s16 s32", +            substrs=[ +                '(char16_t *) s16 = 0x', +                '(char32_t *) s32 = ', +                '"色ハ匂ヘト散リヌルヲ"', +                '"෴"'])          # check the same as above for arrays -        self.expect("frame variable as16 as32", -            patterns = ['\(char16_t \[[0-9]+\]\) as16 = ', '\(char32_t \[[0-9]+\]\) as32 = '], -            substrs = ['"色ハ匂ヘト散リヌルヲ"','"෴"']) +        self.expect( +            "frame variable as16 as32", +            patterns=[ +                '\(char16_t \[[0-9]+\]\) as16 = ', +                '\(char32_t \[[0-9]+\]\) as32 = '], +            substrs=[ +                '"色ハ匂ヘト散リヌルヲ"', +                '"෴"'])          # check that zero values are properly handles          self.expect('frame variable cs16_zero', substrs=["U+0000 u'\\0'"]) -        self.expect('frame variable cs32_zero', substrs=["U+0x00000000 U'\\0'"]) +        self.expect( +            'frame variable cs32_zero', +            substrs=["U+0x00000000 U'\\0'"])          self.expect('expression cs16_zero', substrs=["U+0000 u'\\0'"])          self.expect('expression cs32_zero', substrs=["U+0x00000000 U'\\0'"])          # Check that we can run expressions that return charN_t -        self.expect("expression u'a'",substrs = ['(char16_t) $',"61 u'a'"]) -        self.expect("expression U'a'",substrs = ['(char32_t) $',"61 U'a'"]) +        self.expect("expression u'a'", substrs=['(char16_t) $', "61 u'a'"]) +        self.expect("expression U'a'", substrs=['(char32_t) $', "61 U'a'"]) | 
