3 Test that C++ supports wchar_t correctly.
8 from lldbsuite
.test
.lldbtest
import *
9 import lldbsuite
.test
.lldbutil
as lldbutil
12 class CxxWCharTTestCase(TestBase
):
14 """Test that C++ supports wchar_t correctly."""
16 lldbutil
.run_to_source_breakpoint(
17 self
, "// break here", lldb
.SBFileSpec("main.cpp")
20 # Check that we correctly report templates on wchar_t
21 self
.expect_var_path("foo_y", type="Foo<wchar_t>")
23 # Check that we correctly report templates on int
24 self
.expect_var_path("foo_x", type="Foo<int>")
26 # Check that we correctly report wchar_t
27 self
.expect_var_path("foo_y.object", type="wchar_t")
29 # Check that we correctly report int
30 self
.expect_var_path("foo_x.object", type="int")
32 # Check that we can run expressions that return wchar_t
33 self
.expect("expression L'a'", substrs
=["(wchar_t) $", "L'a'"])
35 # Mazel Tov if this works!
37 "frame variable mazeltov",
38 substrs
=["(const wchar_t *) mazeltov = ", 'L"מזל טוב"'],
41 self
.expect("frame variable ws_NULL", substrs
=["(wchar_t *) ws_NULL = 0x0"])
42 self
.expect("frame variable ws_empty", substrs
=[' L""'])
45 "frame variable array", substrs
=["L\"Hey, I'm a super wchar_t string"]
47 self
.expect("frame variable array", substrs
=["[0]"], matching
=False)
49 self
.expect("frame variable wchar_zero", substrs
=["L'\\0'"])
50 self
.expect("expression wchar_zero", substrs
=["L'\\0'"])