Skip to content

Commit 487ab39

Browse files
committed
[lldb][test] Remove tests relying on deprecated std::char_traits specializations
(motivated by test failures after D157058) With D157058 the base template for `std::char_traits` was removed from libc++. Quoting the release notes: ``` The base template for ``std::char_traits`` has been removed. If you are using ``std::char_traits`` with types other than ``char``, ``wchar_t``, ``char8_t``, ``char16_t``, ``char32_t`` or a custom character type for which you specialized ``std::char_traits``, your code will no longer work. ``` This patch simply removes all such instantiations to make sure the tests that run against the latest libc++ version pass. One could try testing the existence of this base template from within the test source files but this doesn't seem like something we want support. Differential Revision: https://reviews.llvm.org/D157636
1 parent 090996f commit 487ab39

File tree

6 files changed

+0
-40
lines changed

6 files changed

+0
-40
lines changed

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,6 @@ def cleanup():
5050

5151
ns = self.namespace
5252

53-
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(
54-
[">", "16.0"]
55-
):
56-
expected_basic_string = "%s::basic_string<unsigned char>" % ns
57-
else:
58-
expected_basic_string = (
59-
"%s::basic_string<unsigned char, %s::char_traits<unsigned char>, "
60-
"%s::allocator<unsigned char> >" % (ns, ns, ns)
61-
)
62-
6353
self.expect(
6454
"frame variable",
6555
substrs=[
@@ -81,7 +71,6 @@ def cleanup():
8171
'(%s::u32string) u32_string = U"🍄🍅🍆🍌"' % ns,
8272
# FIXME: This should have a 'U' prefix.
8373
'(%s::u32string) u32_empty = ""' % ns,
84-
'(%s) uchar = "aaaaa"' % expected_basic_string,
8574
"(%s::string *) null_str = nullptr" % ns,
8675
],
8776
)
@@ -126,7 +115,6 @@ def cleanup():
126115
'(%s::u16string) u16_string = u"ß水氶"' % ns,
127116
'(%s::u32string) u32_string = U"🍄🍅🍆🍌"' % ns,
128117
'(%s::u32string) u32_empty = ""' % ns,
129-
'(%s) uchar = "aaaaa"' % expected_basic_string,
130118
"(%s::string *) null_str = nullptr" % ns,
131119
],
132120
)

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ int main()
113113
std::u16string u16_empty(u"");
114114
std::u32string u32_string(U"🍄🍅🍆🍌");
115115
std::u32string u32_empty(U"");
116-
std::basic_string<unsigned char> uchar(5, 'a');
117116
std::string *null_str = nullptr;
118117

119118
std::string garbage1, garbage2, garbage3, garbage4, garbage5;

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/TestDataFormatterLibcxxStringView.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,6 @@ def cleanup():
6060
# Execute the cleanup function during test case tear down.
6161
self.addTearDownHook(cleanup)
6262

63-
if self.expectedCompiler(["clang"]) and self.expectedCompilerVersion(
64-
[">", "16.0"]
65-
):
66-
expected_basic_string = "std::basic_string<unsigned char>"
67-
expected_basic_string_view = "std::basic_string_view<unsigned char>"
68-
else:
69-
expected_basic_string = "std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> >"
70-
expected_basic_string_view = "std::basic_string_view<unsigned char, std::char_traits<unsigned char> >"
71-
7263
self.expect_var_path("wempty", type="std::wstring_view", summary='L""')
7364
self.expect_var_path(
7465
"s", type="std::wstring_view", summary='L"hello world! מזל טוב!"'
@@ -96,12 +87,6 @@ def cleanup():
9687
"u32_string", type="std::u32string_view", summary='U"🍄🍅🍆🍌"'
9788
)
9889
self.expect_var_path("u32_empty", type="std::u32string_view", summary='""')
99-
self.expect_var_path(
100-
"uchar_source", type=expected_basic_string, summary='"aaaaaaaaaa"'
101-
)
102-
self.expect_var_path(
103-
"uchar", type=expected_basic_string_view, summary='"aaaaa"'
104-
)
10590
self.expect_var_path(
10691
"oops", type="std::string_view", summary='"Hellooo World\\n"'
10792
)
@@ -166,12 +151,6 @@ def cleanup():
166151
"u32_string", type="std::u32string_view", summary='U"🍄🍅🍆🍌"'
167152
)
168153
self.expect_var_path("u32_empty", type="std::u32string_view", summary='""')
169-
self.expect_var_path(
170-
"uchar_source", type=expected_basic_string, summary='"aaaaaaaaaa"'
171-
)
172-
self.expect_var_path(
173-
"uchar", type=expected_basic_string_view, summary='"aaaaa"'
174-
)
175154

176155
self.runCmd("cont")
177156
self.expect(

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ int main() {
9292
std::u16string_view u16_empty(u"");
9393
std::u32string_view u32_string(U"🍄🍅🍆🍌");
9494
std::u32string_view u32_empty(U"");
95-
std::basic_string<unsigned char> uchar_source(10, 'a');
96-
std::basic_string_view<unsigned char> uchar(uchar_source.data(), 5);
9795
std::string_view *null_str = nullptr;
9896

9997
std::string hello = "Hellooo ";

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ def cleanup():
6161
var_pq = self.frame().FindVariable("pq")
6262
var_pQ = self.frame().FindVariable("pQ")
6363

64-
var_uchar = self.frame().FindVariable("uchar")
65-
6664
self.assertEqual(var_wempty.GetSummary(), 'L""', "wempty summary wrong")
6765
self.assertEqual(
6866
var_s.GetSummary(), 'L"hello world! מזל טוב!"', "s summary wrong"
@@ -78,7 +76,6 @@ def cleanup():
7876
'"quite a long std::strin with lots of info inside it"',
7977
"Q summary wrong",
8078
)
81-
self.assertEqual(var_uchar.GetSummary(), '"aaaaa"', "u summary wrong")
8279
self.assertEqual(var_rq.GetSummary(), '"hello world"', "rq summary wrong")
8380
self.assertEqual(
8481
var_rQ.GetSummary(),

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ int main()
99
std::string empty("");
1010
std::string q("hello world");
1111
std::string Q("quite a long std::strin with lots of info inside it");
12-
std::basic_string<unsigned char> uchar(5, 'a');
1312
auto &rq = q, &rQ = Q;
1413
std::string *pq = &q, *pQ = &Q;
1514
S.assign(L"!!!!!"); // Set break point at this line.

0 commit comments

Comments
 (0)