Skip to content

Commit 69a10e0

Browse files
[libc++][test] Consistently use TEST_SHORT_WCHAR (#74958)
Found while running libc++'s test suite with MSVC's STL. * In `escaped_output.unicode.pass.cpp`, replace `_LIBCPP_SHORT_WCHAR` with `TEST_SHORT_WCHAR`. + This was the only test that was directly using the `_LIBCPP` macro. `libcxx/test/support/test_macros.h` performs this mapping: https://github.com/llvm/llvm-project/blob/c60ac509399da5cba533b9b6cc5b983c59f7d7b3/libcxx/test/support/test_macros.h#L442-L444 * In `msvc_stdlib_force_include.h`, define `TEST_SHORT_WCHAR`.
1 parent 99eb843 commit 69a10e0

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

libcxx/test/std/utilities/format/format.functions/escaped_output.unicode.pass.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ static void test_ill_formed_utf8() {
515515
}
516516

517517
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
518-
# ifdef _LIBCPP_SHORT_WCHAR
518+
# ifdef TEST_SHORT_WCHAR
519519
static void test_ill_formed_utf16() {
520520
using namespace std::literals;
521521

@@ -543,7 +543,7 @@ static void test_ill_formed_utf16() {
543543
L"\xdbff"
544544
"a");
545545
}
546-
# else // _LIBCPP_SHORT_WCHAR
546+
# else // TEST_SHORT_WCHAR
547547
static void test_ill_formed_utf32() {
548548
using namespace std::literals;
549549

@@ -552,7 +552,7 @@ static void test_ill_formed_utf32() {
552552
test_format(LR"("\x{ffffffff}")"sv, L"{:?}", L"\xffffffff"); // largest encoded code point
553553
}
554554

555-
# endif // _LIBCPP_SHORT_WCHAR
555+
# endif // TEST_SHORT_WCHAR
556556
#endif // TEST_HAS_NO_WIDE_CHARACTERS
557557

558558
int main(int, char**) {
@@ -563,11 +563,11 @@ int main(int, char**) {
563563

564564
test_ill_formed_utf8();
565565
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
566-
# ifdef _LIBCPP_SHORT_WCHAR
566+
# ifdef TEST_SHORT_WCHAR
567567
test_ill_formed_utf16();
568-
# else // _LIBCPP_SHORT_WCHAR
568+
# else // TEST_SHORT_WCHAR
569569
test_ill_formed_utf32();
570-
# endif // _LIBCPP_SHORT_WCHAR
570+
# endif // TEST_SHORT_WCHAR
571571
#endif // TEST_HAS_NO_WIDE_CHARACTERS
572572

573573
return 0;

libcxx/test/support/msvc_stdlib_force_include.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ const AssertionDialogAvoider assertion_dialog_avoider{};
100100
# define TEST_STD_VER 14
101101
#endif
102102

103+
#define TEST_SHORT_WCHAR
104+
103105
#define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
104106

105107
#ifdef __clang__

0 commit comments

Comments
 (0)