Skip to content

Commit 9224bfc

Browse files
committed
fixup! move utf-16/utf-32 to separate test-case
1 parent 78533da commit 9224bfc

File tree

1 file changed

+39
-22
lines changed

1 file changed

+39
-22
lines changed

lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/string/TestDataFormatterStdString.py

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,8 @@ def cleanup():
3838

3939
ns = self.namespace
4040

41-
self.expect(
42-
"frame variable",
43-
substrs=[
44-
'(%s::wstring) wempty = L""' % ns,
45-
'(%s::wstring) s = L"hello world! מזל טוב!"' % ns,
46-
'(%s::wstring) S = L"!!!!"' % ns,
47-
"(const wchar_t *) mazeltov = 0x",
48-
'L"מזל טוב"',
49-
'(%s::string) empty = ""' % ns,
50-
'(%s::string) q = "hello world"' % ns,
51-
'(%s::string) Q = "quite a long std::strin with lots of info inside it"'
52-
% ns,
53-
'(%s::string) IHaveEmbeddedZeros = "a\\0b\\0c\\0d"' % ns,
54-
'(%s::wstring) IHaveEmbeddedZerosToo = L"hello world!\\0てざ ル゜䋨ミ㠧槊 きゅへ狦穤襩 じゃ馩リョ 䤦監"'
55-
% ns,
56-
'(%s::u16string) u16_string = u"ß水氶"' % ns,
57-
'(%s::u16string) u16_empty = u""' % ns,
58-
'(%s::u32string) u32_string = U"🍄🍅🍆🍌"' % ns,
59-
'(%s::u32string) u32_empty = U""' % ns,
60-
"(%s::string *) null_str = nullptr" % ns,
61-
],
62-
)
41+
# Check 'S' pre-assignment.
42+
self.expect("frame variable S", substrs=['(%s::wstring) S = L"!!!!"' % ns])
6343

6444
thread.StepOver()
6545

@@ -99,16 +79,20 @@ def cleanup():
9979
self.expect(
10080
"frame variable",
10181
substrs=[
82+
'(%s::wstring) wempty = L""' % ns,
83+
'(%s::wstring) s = L"hello world! מזל טוב!"' % ns,
10284
'(%s::wstring) S = L"!!!!!"' % ns,
10385
"(const wchar_t *) mazeltov = 0x",
10486
'L"מזל טוב"',
87+
'(%s::string) empty = ""' % ns,
10588
'(%s::string) q = "hello world"' % ns,
10689
'(%s::string) Q = "quite a long std::strin with lots of info inside it"'
10790
% ns,
10891
'(%s::string) IHaveEmbeddedZeros = "a\\0b\\0c\\0d"' % ns,
10992
'(%s::wstring) IHaveEmbeddedZerosToo = L"hello world!\\0てざ ル゜䋨ミ㠧槊 きゅへ狦穤襩 じゃ馩リョ 䤦監"'
11093
% ns,
11194
'(%s::u16string) u16_string = u"ß水氶"' % ns,
95+
'(%s::u16string) u16_empty = u""' % ns,
11296
'(%s::u32string) u32_string = U"🍄🍅🍆🍌"' % ns,
11397
'(%s::u32string) u32_empty = U""' % ns,
11498
"(%s::string *) null_str = nullptr" % ns,
@@ -168,3 +152,36 @@ def test_libcxx(self):
168152
def test_libstdcxx(self):
169153
self.build(dictionary={"USE_LIBSTDCPP": 1})
170154
self.do_test()
155+
156+
def do_test_multibyte(self):
157+
lldbutil.run_to_source_breakpoint(
158+
self, "Set break point at this line.", self.main_spec
159+
)
160+
161+
ns = self.namespace
162+
163+
self.expect(
164+
"frame variable",
165+
substrs=[
166+
'(%s::string) IHaveEmbeddedZeros = "a\\0b\\0c\\0d"' % ns,
167+
'(%s::wstring) IHaveEmbeddedZerosToo = L"hello world!\\0てざ ル゜䋨ミ㠧槊 きゅへ狦穤襩 じゃ馩リョ 䤦監"'
168+
% ns,
169+
'(%s::u16string) u16_string = u"ß水氶"' % ns,
170+
'(%s::u16string) u16_empty = u""' % ns,
171+
'(%s::u32string) u32_string = U"🍄🍅🍆🍌"' % ns,
172+
'(%s::u32string) u32_empty = U""' % ns,
173+
],
174+
)
175+
176+
@add_test_categories(["libc++"])
177+
def test_multibyte_libcxx(self):
178+
self.build(dictionary={"USE_LIBCPP": 1})
179+
self.do_test_multibyte()
180+
181+
@expectedFailureAll(
182+
bugnumber="libstdc++ formatters don't support UTF-16/UTF-32 strings yet."
183+
)
184+
@add_test_categories(["libstdcxx"])
185+
def test_multibyte_libstdcxx(self):
186+
self.build(dictionary={"USE_LIBSTDCPP": 1})
187+
self.do_test_multibyte()

0 commit comments

Comments
 (0)