brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 35cb512 Raw
51 lines · python
1# coding=utf82"""3Test that C++ supports wchar_t correctly.4"""5 6 7import lldb8from lldbsuite.test.lldbtest import *9import lldbsuite.test.lldbutil as lldbutil10 11 12class CxxWCharTTestCase(TestBase):13    def test(self):14        """Test that C++ supports wchar_t correctly."""15        self.build()16        lldbutil.run_to_source_breakpoint(17            self, "// break here", lldb.SBFileSpec("main.cpp")18        )19 20        # Check that we correctly report templates on wchar_t21        self.expect_var_path("foo_y", type="Foo<wchar_t>")22 23        # Check that we correctly report templates on int24        self.expect_var_path("foo_x", type="Foo<int>")25 26        # Check that we correctly report wchar_t27        self.expect_var_path("foo_y.object", type="wchar_t")28 29        # Check that we correctly report int30        self.expect_var_path("foo_x.object", type="int")31 32        # Check that we can run expressions that return wchar_t33        self.expect("expression L'a'", substrs=["(wchar_t) $", "L'a'"])34 35        # Mazel Tov if this works!36        self.expect(37            "frame variable mazeltov",38            substrs=["(const wchar_t *) mazeltov = ", 'L"מזל טוב"'],39        )40 41        self.expect("frame variable ws_NULL", substrs=["(wchar_t *) ws_NULL = 0x0"])42        self.expect("frame variable ws_empty", substrs=[' L""'])43 44        self.expect(45            "frame variable array", substrs=["L\"Hey, I'm a super wchar_t string"]46        )47        self.expect("frame variable array", substrs=["[0]"], matching=False)48 49        self.expect("frame variable wchar_zero", substrs=["L'\\0'"])50        self.expect("expression wchar_zero", substrs=["L'\\0'"])51