[libc++][nfc] Add TEST_HAS_NO_UNICODE_CHARS.

This avoids using an libc++ internal macro in our tests.

Reviewed By: #libc, philnik, ldionne

Differential Revision: https://reviews.llvm.org/D118832
This commit is contained in:
Mark de Wever 2022-02-02 19:28:03 +01:00
parent 823fa098aa
commit 959678425d
92 changed files with 127 additions and 135 deletions

View File

@ -342,7 +342,7 @@ constexpr bool test() {
#ifndef _LIBCPP_HAS_NO_CHAR8_T #ifndef _LIBCPP_HAS_NO_CHAR8_T
test<char8_t>(); test<char8_t>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t>(); test<char16_t>();
test<char32_t>(); test<char32_t>();
#endif #endif

View File

@ -97,7 +97,7 @@ constexpr bool test() {
#ifndef _LIBCPP_HAS_NO_CHAR8_T #ifndef _LIBCPP_HAS_NO_CHAR8_T
test<char8_t>(); test<char8_t>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t>(); test<char16_t>();
test<char32_t>(); test<char32_t>();
#endif #endif

View File

@ -260,7 +260,7 @@ constexpr bool test() {
#ifndef _LIBCPP_HAS_NO_CHAR8_T #ifndef _LIBCPP_HAS_NO_CHAR8_T
test<char8_t>(); test<char8_t>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t>(); test<char16_t>();
test<char32_t>(); test<char32_t>();
#endif #endif

View File

@ -177,7 +177,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<std::atomic_char8_t, char8_t>(); test<std::atomic_char8_t, char8_t>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<std::atomic_char16_t, char16_t>(); test<std::atomic_char16_t, char16_t>();
test<std::atomic_char32_t, char32_t>(); test<std::atomic_char32_t, char32_t>();
#endif #endif
@ -205,7 +205,7 @@ int main(int, char**)
test<volatile std::atomic_ulong, unsigned long>(); test<volatile std::atomic_ulong, unsigned long>();
test<volatile std::atomic_llong, long long>(); test<volatile std::atomic_llong, long long>();
test<volatile std::atomic_ullong, unsigned long long>(); test<volatile std::atomic_ullong, unsigned long long>();
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<volatile std::atomic_char16_t, char16_t>(); test<volatile std::atomic_char16_t, char16_t>();
test<volatile std::atomic_char32_t, char32_t>(); test<volatile std::atomic_char32_t, char32_t>();
#endif #endif

View File

@ -60,7 +60,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
static_assert((std::is_same<std::atomic<char8_t>, std::atomic_char8_t>::value), ""); static_assert((std::is_same<std::atomic<char8_t>, std::atomic_char8_t>::value), "");
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
static_assert((std::is_same<std::atomic<char16_t>, std::atomic_char16_t>::value), ""); static_assert((std::is_same<std::atomic<char16_t>, std::atomic_char16_t>::value), "");
static_assert((std::is_same<std::atomic<char32_t>, std::atomic_char32_t>::value), ""); static_assert((std::is_same<std::atomic<char32_t>, std::atomic_char32_t>::value), "");
#endif #endif

View File

@ -30,7 +30,7 @@ static_assert(std::three_way_comparable<wchar_t&>);
#ifndef _LIBCPP_HAS_NO_CHAR8_T #ifndef _LIBCPP_HAS_NO_CHAR8_T
static_assert(std::three_way_comparable<char8_t const&>); static_assert(std::three_way_comparable<char8_t const&>);
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
static_assert(std::three_way_comparable<char16_t volatile&>); static_assert(std::three_way_comparable<char16_t volatile&>);
static_assert(std::three_way_comparable<char32_t const volatile&>); static_assert(std::three_way_comparable<char32_t const volatile&>);
#endif #endif

View File

@ -49,7 +49,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t>(); test<char8_t>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t>(); test<char16_t>();
test<char32_t>(); test<char32_t>();
#endif #endif

View File

@ -36,7 +36,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t>(0); test<char8_t>(0);
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t>(0); test<char16_t>(0);
test<char32_t>(0); test<char32_t>(0);
#endif #endif

View File

@ -35,7 +35,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, 8>(); test<char8_t, 8>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, 16>(); test<char16_t, 16>();
test<char32_t, 32>(); test<char32_t, 32>();
#endif #endif

View File

@ -39,7 +39,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, 2>(); test<char8_t, 2>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, 4>(); test<char16_t, 4>();
test<char32_t, 9>(); test<char32_t, 9>();
#endif #endif

View File

@ -36,7 +36,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t>(0); test<char8_t>(0);
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t>(0); test<char16_t>(0);
test<char32_t>(0); test<char32_t>(0);
#endif #endif

View File

@ -34,7 +34,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, std::denorm_absent>(); test<char8_t, std::denorm_absent>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, std::denorm_absent>(); test<char16_t, std::denorm_absent>();
test<char32_t, std::denorm_absent>(); test<char32_t, std::denorm_absent>();
#endif #endif

View File

@ -34,7 +34,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, false>(); test<char8_t, false>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, false>(); test<char16_t, false>();
test<char32_t, false>(); test<char32_t, false>();
#endif #endif

View File

@ -34,7 +34,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, false>(); test<char8_t, false>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, false>(); test<char16_t, false>();
test<char32_t, false>(); test<char32_t, false>();
#endif #endif

View File

@ -34,7 +34,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, false>(); test<char8_t, false>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, false>(); test<char16_t, false>();
test<char32_t, false>(); test<char32_t, false>();
#endif #endif

View File

@ -34,7 +34,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, false>(); test<char8_t, false>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, false>(); test<char16_t, false>();
test<char32_t, false>(); test<char32_t, false>();
#endif #endif

View File

@ -38,7 +38,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t>(0); test<char8_t>(0);
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t>(0); test<char16_t>(0);
test<char32_t>(0); test<char32_t>(0);
#endif #endif

View File

@ -34,7 +34,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, true>(); test<char8_t, true>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, true>(); test<char16_t, true>();
test<char32_t, true>(); test<char32_t, true>();
#endif #endif

View File

@ -34,7 +34,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, true>(); test<char8_t, true>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, true>(); test<char16_t, true>();
test<char32_t, true>(); test<char32_t, true>();
#endif #endif

View File

@ -34,7 +34,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, false>(); test<char8_t, false>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, false>(); test<char16_t, false>();
test<char32_t, false>(); test<char32_t, false>();
#endif #endif

View File

@ -34,7 +34,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, true>(); test<char8_t, true>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, true>(); test<char16_t, true>();
test<char32_t, true>(); test<char32_t, true>();
#endif #endif

View File

@ -34,7 +34,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, true>(); test<char8_t, true>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, true>(); test<char16_t, true>();
test<char32_t, true>(); test<char32_t, true>();
#endif #endif

View File

@ -34,7 +34,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, false>(); test<char8_t, false>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, false>(); test<char16_t, false>();
test<char32_t, false>(); test<char32_t, false>();
#endif #endif

View File

@ -47,7 +47,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t>(0); test<char8_t>(0);
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t>(0); test<char16_t>(0);
test<char32_t>(0); test<char32_t>(0);
#endif #endif

View File

@ -47,7 +47,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t>(UCHAR_MAX); // ?? test<char8_t>(UCHAR_MAX); // ??
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t>(USHRT_MAX); test<char16_t>(USHRT_MAX);
test<char32_t>(UINT_MAX); test<char32_t>(UINT_MAX);
#endif #endif

View File

@ -35,7 +35,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, 0>(); test<char8_t, 0>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, 0>(); test<char16_t, 0>();
test<char32_t, 0>(); test<char32_t, 0>();
#endif #endif

View File

@ -35,7 +35,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, 0>(); test<char8_t, 0>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, 0>(); test<char16_t, 0>();
test<char32_t, 0>(); test<char32_t, 0>();
#endif #endif

View File

@ -35,7 +35,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, 0>(); test<char8_t, 0>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, 0>(); test<char16_t, 0>();
test<char32_t, 0>(); test<char32_t, 0>();
#endif #endif

View File

@ -47,7 +47,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t>(0); test<char8_t>(0);
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t>(0); test<char16_t>(0);
test<char32_t>(0); test<char32_t>(0);
#endif #endif

View File

@ -35,7 +35,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, 0>(); test<char8_t, 0>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, 0>(); test<char16_t, 0>();
test<char32_t, 0>(); test<char32_t, 0>();
#endif #endif

View File

@ -35,7 +35,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, 0>(); test<char8_t, 0>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, 0>(); test<char16_t, 0>();
test<char32_t, 0>(); test<char32_t, 0>();
#endif #endif

View File

@ -55,7 +55,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t>(); test<char8_t>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t>(); test<char16_t>();
test<char32_t>(); test<char32_t>();
#endif #endif

View File

@ -35,7 +35,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, 2>(); test<char8_t, 2>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, 2>(); test<char16_t, 2>();
test<char32_t, 2>(); test<char32_t, 2>();
#endif #endif

View File

@ -36,7 +36,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t>(0); test<char8_t>(0);
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t>(0); test<char16_t>(0);
test<char32_t>(0); test<char32_t>(0);
#endif #endif

View File

@ -34,7 +34,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, std::round_toward_zero>(); test<char8_t, std::round_toward_zero>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, std::round_toward_zero>(); test<char16_t, std::round_toward_zero>();
test<char32_t, std::round_toward_zero>(); test<char32_t, std::round_toward_zero>();
#endif #endif

View File

@ -55,10 +55,10 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t>(); test<char8_t>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t>(); test<char16_t>();
test<char32_t>(); test<char32_t>();
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
test<short>(); test<short>();
test<unsigned short>(); test<unsigned short>();
test<int>(); test<int>();

View File

@ -34,7 +34,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, false>(); test<char8_t, false>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, false>(); test<char16_t, false>();
test<char32_t, false>(); test<char32_t, false>();
#endif #endif

View File

@ -41,7 +41,7 @@ int main(int, char**)
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
test<char8_t, integral_types_trap>(); test<char8_t, integral_types_trap>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t, integral_types_trap>(); test<char16_t, integral_types_trap>();
test<char32_t, integral_types_trap>(); test<char32_t, integral_types_trap>();
#endif #endif

View File

@ -20,8 +20,6 @@
#include "test_macros.h" #include "test_macros.h"
//#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
typedef std::codecvt<char16_t, char, std::mbstate_t> F; typedef std::codecvt<char16_t, char, std::mbstate_t> F;
class my_facet class my_facet
@ -38,11 +36,8 @@ public:
int my_facet::count = 0; int my_facet::count = 0;
//#endif
int main(int, char**) int main(int, char**)
{ {
//#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
{ {
std::locale l(std::locale::classic(), new my_facet); std::locale l(std::locale::classic(), new my_facet);
assert(my_facet::count == 1); assert(my_facet::count == 1);
@ -58,7 +53,6 @@ int main(int, char**)
assert(my_facet::count == 1); assert(my_facet::count == 1);
} }
assert(my_facet::count == 0); assert(my_facet::count == 0);
//#endif
return 0; return 0;
} }

View File

@ -20,8 +20,6 @@
#include "test_macros.h" #include "test_macros.h"
//#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
typedef std::codecvt<char32_t, char, std::mbstate_t> F; typedef std::codecvt<char32_t, char, std::mbstate_t> F;
class my_facet class my_facet
@ -38,11 +36,8 @@ public:
int my_facet::count = 0; int my_facet::count = 0;
//#endif
int main(int, char**) int main(int, char**)
{ {
//#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
{ {
std::locale l(std::locale::classic(), new my_facet); std::locale l(std::locale::classic(), new my_facet);
assert(my_facet::count == 1); assert(my_facet::count == 1);
@ -58,7 +53,6 @@ int main(int, char**)
assert(my_facet::count == 1); assert(my_facet::count == 1);
} }
assert(my_facet::count == 0); assert(my_facet::count == 0);
//#endif
return 0; return 0;
} }

View File

@ -29,7 +29,7 @@ int main(int, char**) {
#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
test_hash_enabled_for_type<std::u8string>(); test_hash_enabled_for_type<std::u8string>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test_hash_enabled_for_type<std::u16string>(); test_hash_enabled_for_type<std::u16string>();
test_hash_enabled_for_type<std::u32string>(); test_hash_enabled_for_type<std::u32string>();
#endif #endif

View File

@ -46,7 +46,7 @@ int main(int, char**)
#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
test<std::u8string>(); test<std::u8string>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<std::u16string>(); test<std::u16string>();
test<std::u32string>(); test<std::u32string>();
#endif #endif

View File

@ -29,7 +29,7 @@ constexpr bool test_constexpr()
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
char16_t c = u'\0'; char16_t c = u'\0';
std::char_traits<char16_t>::assign(c, u'a'); std::char_traits<char16_t>::assign(c, u'a');
@ -39,7 +39,7 @@ int main(int, char**)
#if TEST_STD_VER > 14 #if TEST_STD_VER > 14
static_assert(test_constexpr(), "" ); static_assert(test_constexpr(), "" );
#endif #endif
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -19,14 +19,14 @@
TEST_CONSTEXPR_CXX20 bool test() TEST_CONSTEXPR_CXX20 bool test()
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
char16_t s2[3] = {0}; char16_t s2[3] = {0};
assert(std::char_traits<char16_t>::assign(s2, 3, char16_t(5)) == s2); assert(std::char_traits<char16_t>::assign(s2, 3, char16_t(5)) == s2);
assert(s2[0] == char16_t(5)); assert(s2[0] == char16_t(5));
assert(s2[1] == char16_t(5)); assert(s2[1] == char16_t(5));
assert(s2[2] == char16_t(5)); assert(s2[2] == char16_t(5));
assert(std::char_traits<char16_t>::assign(NULL, 0, char16_t(5)) == NULL); assert(std::char_traits<char16_t>::assign(NULL, 0, char16_t(5)) == NULL);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return true; return true;
} }

View File

@ -30,7 +30,7 @@ constexpr bool test_constexpr()
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert(std::char_traits<char16_t>::compare(u"", u"", 0) == 0); assert(std::char_traits<char16_t>::compare(u"", u"", 0) == 0);
assert(std::char_traits<char16_t>::compare(NULL, NULL, 0) == 0); assert(std::char_traits<char16_t>::compare(NULL, NULL, 0) == 0);
@ -57,7 +57,7 @@ int main(int, char**)
#if TEST_STD_VER > 14 #if TEST_STD_VER > 14
static_assert(test_constexpr(), "" ); static_assert(test_constexpr(), "" );
#endif #endif
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -19,7 +19,7 @@
TEST_CONSTEXPR_CXX20 bool test() TEST_CONSTEXPR_CXX20 bool test()
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
char16_t s1[] = {1, 2, 3}; char16_t s1[] = {1, 2, 3};
char16_t s2[3] = {0}; char16_t s2[3] = {0};
assert(std::char_traits<char16_t>::copy(s2, s1, 3) == s2); assert(std::char_traits<char16_t>::copy(s2, s1, 3) == s2);
@ -28,7 +28,7 @@ TEST_CONSTEXPR_CXX20 bool test()
assert(s2[2] == char16_t(3)); assert(s2[2] == char16_t(3));
assert(std::char_traits<char16_t>::copy(NULL, s1, 0) == NULL); assert(std::char_traits<char16_t>::copy(NULL, s1, 0) == NULL);
assert(std::char_traits<char16_t>::copy(s1, NULL, 0) == s1); assert(std::char_traits<char16_t>::copy(s1, NULL, 0) == s1);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return true; return true;
} }

View File

@ -19,7 +19,7 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
std::char_traits<char16_t>::int_type i = std::char_traits<char16_t>::eof(); std::char_traits<char16_t>::int_type i = std::char_traits<char16_t>::eof();
((void)i); // Prevent unused warning ((void)i); // Prevent unused warning
#endif #endif

View File

@ -19,12 +19,12 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert(std::char_traits<char16_t>::eq(u'a', u'a')); assert(std::char_traits<char16_t>::eq(u'a', u'a'));
assert(!std::char_traits<char16_t>::eq(u'a', u'A')); assert(!std::char_traits<char16_t>::eq(u'a', u'A'));
#endif #endif
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -19,7 +19,7 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert( std::char_traits<char16_t>::eq_int_type(u'a', u'a')); assert( std::char_traits<char16_t>::eq_int_type(u'a', u'a'));
assert(!std::char_traits<char16_t>::eq_int_type(u'a', u'A')); assert(!std::char_traits<char16_t>::eq_int_type(u'a', u'A'));
@ -27,7 +27,7 @@ int main(int, char**)
#endif #endif
assert( std::char_traits<char16_t>::eq_int_type(std::char_traits<char16_t>::eof(), assert( std::char_traits<char16_t>::eq_int_type(std::char_traits<char16_t>::eof(),
std::char_traits<char16_t>::eof())); std::char_traits<char16_t>::eof()));
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -31,7 +31,7 @@ constexpr bool test_constexpr()
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
char16_t s1[] = {1, 2, 3}; char16_t s1[] = {1, 2, 3};
assert(std::char_traits<char16_t>::find(s1, 3, char16_t(1)) == s1); assert(std::char_traits<char16_t>::find(s1, 3, char16_t(1)) == s1);
assert(std::char_traits<char16_t>::find(s1, 3, char16_t(2)) == s1+1); assert(std::char_traits<char16_t>::find(s1, 3, char16_t(2)) == s1+1);
@ -43,7 +43,7 @@ int main(int, char**)
#if TEST_STD_VER > 14 #if TEST_STD_VER > 14
static_assert(test_constexpr(), "" ); static_assert(test_constexpr(), "" );
#endif #endif
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -28,7 +28,7 @@ constexpr bool test_constexpr()
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert(std::char_traits<char16_t>::length(u"") == 0); assert(std::char_traits<char16_t>::length(u"") == 0);
assert(std::char_traits<char16_t>::length(u"a") == 1); assert(std::char_traits<char16_t>::length(u"a") == 1);
@ -40,7 +40,7 @@ int main(int, char**)
#if TEST_STD_VER > 14 #if TEST_STD_VER > 14
static_assert(test_constexpr(), "" ); static_assert(test_constexpr(), "" );
#endif #endif
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -19,12 +19,12 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert(!std::char_traits<char16_t>::lt(u'a', u'a')); assert(!std::char_traits<char16_t>::lt(u'a', u'a'));
assert( std::char_traits<char16_t>::lt(u'A', u'a')); assert( std::char_traits<char16_t>::lt(u'A', u'a'));
#endif #endif
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -19,7 +19,7 @@
TEST_CONSTEXPR_CXX20 bool test() TEST_CONSTEXPR_CXX20 bool test()
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
char16_t s1[] = {1, 2, 3}; char16_t s1[] = {1, 2, 3};
assert(std::char_traits<char16_t>::move(s1, s1+1, 2) == s1); assert(std::char_traits<char16_t>::move(s1, s1+1, 2) == s1);
assert(s1[0] == char16_t(2)); assert(s1[0] == char16_t(2));
@ -32,7 +32,7 @@ TEST_CONSTEXPR_CXX20 bool test()
assert(s1[2] == char16_t(3)); assert(s1[2] == char16_t(3));
assert(std::char_traits<char16_t>::move(NULL, s1, 0) == NULL); assert(std::char_traits<char16_t>::move(NULL, s1, 0) == NULL);
assert(std::char_traits<char16_t>::move(s1, NULL, 0) == s1); assert(std::char_traits<char16_t>::move(s1, NULL, 0) == s1);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return true; return true;
} }

View File

@ -19,7 +19,7 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert(std::char_traits<char16_t>::not_eof(u'a') == u'a'); assert(std::char_traits<char16_t>::not_eof(u'a') == u'a');
assert(std::char_traits<char16_t>::not_eof(u'A') == u'A'); assert(std::char_traits<char16_t>::not_eof(u'A') == u'A');
@ -27,7 +27,7 @@ int main(int, char**)
assert(std::char_traits<char16_t>::not_eof(0) == 0); assert(std::char_traits<char16_t>::not_eof(0) == 0);
assert(std::char_traits<char16_t>::not_eof(std::char_traits<char16_t>::eof()) != assert(std::char_traits<char16_t>::not_eof(std::char_traits<char16_t>::eof()) !=
std::char_traits<char16_t>::eof()); std::char_traits<char16_t>::eof());
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -19,13 +19,13 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert(std::char_traits<char16_t>::to_char_type(u'a') == u'a'); assert(std::char_traits<char16_t>::to_char_type(u'a') == u'a');
assert(std::char_traits<char16_t>::to_char_type(u'A') == u'A'); assert(std::char_traits<char16_t>::to_char_type(u'A') == u'A');
#endif #endif
assert(std::char_traits<char16_t>::to_char_type(0) == 0); assert(std::char_traits<char16_t>::to_char_type(0) == 0);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -19,13 +19,13 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert(std::char_traits<char16_t>::to_int_type(u'a') == u'a'); assert(std::char_traits<char16_t>::to_int_type(u'a') == u'a');
assert(std::char_traits<char16_t>::to_int_type(u'A') == u'A'); assert(std::char_traits<char16_t>::to_int_type(u'A') == u'A');
#endif #endif
assert(std::char_traits<char16_t>::to_int_type(0) == 0); assert(std::char_traits<char16_t>::to_int_type(0) == 0);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -24,13 +24,13 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
static_assert((std::is_same<std::char_traits<char16_t>::char_type, char16_t>::value), ""); static_assert((std::is_same<std::char_traits<char16_t>::char_type, char16_t>::value), "");
static_assert((std::is_same<std::char_traits<char16_t>::int_type, std::uint_least16_t>::value), ""); static_assert((std::is_same<std::char_traits<char16_t>::int_type, std::uint_least16_t>::value), "");
static_assert((std::is_same<std::char_traits<char16_t>::off_type, std::streamoff>::value), ""); static_assert((std::is_same<std::char_traits<char16_t>::off_type, std::streamoff>::value), "");
static_assert((std::is_same<std::char_traits<char16_t>::pos_type, std::u16streampos>::value), ""); static_assert((std::is_same<std::char_traits<char16_t>::pos_type, std::u16streampos>::value), "");
static_assert((std::is_same<std::char_traits<char16_t>::state_type, std::mbstate_t>::value), ""); static_assert((std::is_same<std::char_traits<char16_t>::state_type, std::mbstate_t>::value), "");
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -29,7 +29,7 @@ constexpr bool test_constexpr()
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
char32_t c = U'\0'; char32_t c = U'\0';
std::char_traits<char32_t>::assign(c, U'a'); std::char_traits<char32_t>::assign(c, U'a');
@ -39,7 +39,7 @@ int main(int, char**)
#if TEST_STD_VER > 14 #if TEST_STD_VER > 14
static_assert(test_constexpr(), "" ); static_assert(test_constexpr(), "" );
#endif #endif
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -19,14 +19,14 @@
TEST_CONSTEXPR_CXX20 bool test() TEST_CONSTEXPR_CXX20 bool test()
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
char32_t s2[3] = {0}; char32_t s2[3] = {0};
assert(std::char_traits<char32_t>::assign(s2, 3, char32_t(5)) == s2); assert(std::char_traits<char32_t>::assign(s2, 3, char32_t(5)) == s2);
assert(s2[0] == char32_t(5)); assert(s2[0] == char32_t(5));
assert(s2[1] == char32_t(5)); assert(s2[1] == char32_t(5));
assert(s2[2] == char32_t(5)); assert(s2[2] == char32_t(5));
assert(std::char_traits<char32_t>::assign(NULL, 0, char32_t(5)) == NULL); assert(std::char_traits<char32_t>::assign(NULL, 0, char32_t(5)) == NULL);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return true; return true;
} }

View File

@ -29,7 +29,7 @@ constexpr bool test_constexpr()
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert(std::char_traits<char32_t>::compare(U"", U"", 0) == 0); assert(std::char_traits<char32_t>::compare(U"", U"", 0) == 0);
assert(std::char_traits<char32_t>::compare(NULL, NULL, 0) == 0); assert(std::char_traits<char32_t>::compare(NULL, NULL, 0) == 0);
@ -56,7 +56,7 @@ int main(int, char**)
#if TEST_STD_VER > 14 #if TEST_STD_VER > 14
static_assert(test_constexpr(), "" ); static_assert(test_constexpr(), "" );
#endif #endif
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -19,7 +19,7 @@
TEST_CONSTEXPR_CXX20 bool test() TEST_CONSTEXPR_CXX20 bool test()
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
char32_t s1[] = {1, 2, 3}; char32_t s1[] = {1, 2, 3};
char32_t s2[3] = {0}; char32_t s2[3] = {0};
assert(std::char_traits<char32_t>::copy(s2, s1, 3) == s2); assert(std::char_traits<char32_t>::copy(s2, s1, 3) == s2);
@ -28,7 +28,7 @@ TEST_CONSTEXPR_CXX20 bool test()
assert(s2[2] == char32_t(3)); assert(s2[2] == char32_t(3));
assert(std::char_traits<char32_t>::copy(NULL, s1, 0) == NULL); assert(std::char_traits<char32_t>::copy(NULL, s1, 0) == NULL);
assert(std::char_traits<char32_t>::copy(s1, NULL, 0) == s1); assert(std::char_traits<char32_t>::copy(s1, NULL, 0) == s1);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return true; return true;
} }

View File

@ -19,7 +19,7 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
std::char_traits<char32_t>::int_type i = std::char_traits<char32_t>::eof(); std::char_traits<char32_t>::int_type i = std::char_traits<char32_t>::eof();
((void)i); // Prevent unused warning ((void)i); // Prevent unused warning
#endif #endif

View File

@ -19,12 +19,12 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert(std::char_traits<char32_t>::eq(U'a', U'a')); assert(std::char_traits<char32_t>::eq(U'a', U'a'));
assert(!std::char_traits<char32_t>::eq(U'a', U'A')); assert(!std::char_traits<char32_t>::eq(U'a', U'A'));
#endif #endif
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -19,7 +19,7 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert( std::char_traits<char32_t>::eq_int_type(U'a', U'a')); assert( std::char_traits<char32_t>::eq_int_type(U'a', U'a'));
assert(!std::char_traits<char32_t>::eq_int_type(U'a', U'A')); assert(!std::char_traits<char32_t>::eq_int_type(U'a', U'A'));
@ -27,7 +27,7 @@ int main(int, char**)
#endif #endif
assert( std::char_traits<char32_t>::eq_int_type(std::char_traits<char32_t>::eof(), assert( std::char_traits<char32_t>::eq_int_type(std::char_traits<char32_t>::eof(),
std::char_traits<char32_t>::eof())); std::char_traits<char32_t>::eof()));
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -31,7 +31,7 @@ constexpr bool test_constexpr()
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
char32_t s1[] = {1, 2, 3}; char32_t s1[] = {1, 2, 3};
assert(std::char_traits<char32_t>::find(s1, 3, char32_t(1)) == s1); assert(std::char_traits<char32_t>::find(s1, 3, char32_t(1)) == s1);
assert(std::char_traits<char32_t>::find(s1, 3, char32_t(2)) == s1+1); assert(std::char_traits<char32_t>::find(s1, 3, char32_t(2)) == s1+1);
@ -43,7 +43,7 @@ int main(int, char**)
#if TEST_STD_VER > 14 #if TEST_STD_VER > 14
static_assert(test_constexpr(), "" ); static_assert(test_constexpr(), "" );
#endif #endif
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -28,7 +28,7 @@ constexpr bool test_constexpr()
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert(std::char_traits<char32_t>::length(U"") == 0); assert(std::char_traits<char32_t>::length(U"") == 0);
assert(std::char_traits<char32_t>::length(U"a") == 1); assert(std::char_traits<char32_t>::length(U"a") == 1);
@ -40,7 +40,7 @@ int main(int, char**)
#if TEST_STD_VER > 14 #if TEST_STD_VER > 14
static_assert(test_constexpr(), "" ); static_assert(test_constexpr(), "" );
#endif #endif
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -19,12 +19,12 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert(!std::char_traits<char32_t>::lt(U'a', U'a')); assert(!std::char_traits<char32_t>::lt(U'a', U'a'));
assert( std::char_traits<char32_t>::lt(U'A', U'a')); assert( std::char_traits<char32_t>::lt(U'A', U'a'));
#endif #endif
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -19,7 +19,7 @@
TEST_CONSTEXPR_CXX20 bool test() TEST_CONSTEXPR_CXX20 bool test()
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
char32_t s1[] = {1, 2, 3}; char32_t s1[] = {1, 2, 3};
assert(std::char_traits<char32_t>::move(s1, s1+1, 2) == s1); assert(std::char_traits<char32_t>::move(s1, s1+1, 2) == s1);
assert(s1[0] == char32_t(2)); assert(s1[0] == char32_t(2));
@ -32,7 +32,7 @@ TEST_CONSTEXPR_CXX20 bool test()
assert(s1[2] == char32_t(3)); assert(s1[2] == char32_t(3));
assert(std::char_traits<char32_t>::move(NULL, s1, 0) == NULL); assert(std::char_traits<char32_t>::move(NULL, s1, 0) == NULL);
assert(std::char_traits<char32_t>::move(s1, NULL, 0) == s1); assert(std::char_traits<char32_t>::move(s1, NULL, 0) == s1);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return true; return true;
} }

View File

@ -19,7 +19,7 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert(std::char_traits<char32_t>::not_eof(U'a') == U'a'); assert(std::char_traits<char32_t>::not_eof(U'a') == U'a');
assert(std::char_traits<char32_t>::not_eof(U'A') == U'A'); assert(std::char_traits<char32_t>::not_eof(U'A') == U'A');
@ -27,7 +27,7 @@ int main(int, char**)
assert(std::char_traits<char32_t>::not_eof(0) == 0); assert(std::char_traits<char32_t>::not_eof(0) == 0);
assert(std::char_traits<char32_t>::not_eof(std::char_traits<char32_t>::eof()) != assert(std::char_traits<char32_t>::not_eof(std::char_traits<char32_t>::eof()) !=
std::char_traits<char32_t>::eof()); std::char_traits<char32_t>::eof());
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -19,13 +19,13 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert(std::char_traits<char32_t>::to_char_type(U'a') == U'a'); assert(std::char_traits<char32_t>::to_char_type(U'a') == U'a');
assert(std::char_traits<char32_t>::to_char_type(U'A') == U'A'); assert(std::char_traits<char32_t>::to_char_type(U'A') == U'A');
#endif #endif
assert(std::char_traits<char32_t>::to_char_type(0) == 0); assert(std::char_traits<char32_t>::to_char_type(0) == 0);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -19,13 +19,13 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
assert(std::char_traits<char32_t>::to_int_type(U'a') == U'a'); assert(std::char_traits<char32_t>::to_int_type(U'a') == U'a');
assert(std::char_traits<char32_t>::to_int_type(U'A') == U'A'); assert(std::char_traits<char32_t>::to_int_type(U'A') == U'A');
#endif #endif
assert(std::char_traits<char32_t>::to_int_type(0) == 0); assert(std::char_traits<char32_t>::to_int_type(0) == 0);
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -24,13 +24,13 @@
int main(int, char**) int main(int, char**)
{ {
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
static_assert((std::is_same<std::char_traits<char32_t>::char_type, char32_t>::value), ""); static_assert((std::is_same<std::char_traits<char32_t>::char_type, char32_t>::value), "");
static_assert((std::is_same<std::char_traits<char32_t>::int_type, std::uint_least32_t>::value), ""); static_assert((std::is_same<std::char_traits<char32_t>::int_type, std::uint_least32_t>::value), "");
static_assert((std::is_same<std::char_traits<char32_t>::off_type, std::streamoff>::value), ""); static_assert((std::is_same<std::char_traits<char32_t>::off_type, std::streamoff>::value), "");
static_assert((std::is_same<std::char_traits<char32_t>::pos_type, std::u32streampos>::value), ""); static_assert((std::is_same<std::char_traits<char32_t>::pos_type, std::u32streampos>::value), "");
static_assert((std::is_same<std::char_traits<char32_t>::state_type, std::mbstate_t>::value), ""); static_assert((std::is_same<std::char_traits<char32_t>::state_type, std::mbstate_t>::value), "");
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -31,10 +31,10 @@ int main(int, char**)
#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
static_assert((std::is_same<std::u8string, std::basic_string<char8_t> >::value), ""); static_assert((std::is_same<std::u8string, std::basic_string<char8_t> >::value), "");
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
static_assert((std::is_same<std::u16string, std::basic_string<char16_t> >::value), ""); static_assert((std::is_same<std::u16string, std::basic_string<char16_t> >::value), "");
static_assert((std::is_same<std::u32string, std::basic_string<char32_t> >::value), ""); static_assert((std::is_same<std::u32string, std::basic_string<char32_t> >::value), "");
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
return 0; return 0;
} }

View File

@ -35,7 +35,7 @@ int main(int, char**) {
assert( test<std::u8string_view> (u8"1234")); assert( test<std::u8string_view> (u8"1234"));
#endif #endif
#if TEST_STD_VER >= 11 #if TEST_STD_VER >= 11
# ifndef _LIBCPP_HAS_NO_UNICODE_CHARS # ifndef TEST_HAS_NO_UNICODE_CHARS
assert( test<std::u16string_view> ( u"1234")); assert( test<std::u16string_view> ( u"1234"));
assert( test<std::u32string_view> ( U"1234")); assert( test<std::u32string_view> ( U"1234"));
# endif # endif
@ -49,7 +49,7 @@ int main(int, char**) {
# if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L # if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
static_assert( test<std::u8string_view> ({u8"abc", 3}), ""); static_assert( test<std::u8string_view> ({u8"abc", 3}), "");
# endif # endif
# ifndef _LIBCPP_HAS_NO_UNICODE_CHARS # ifndef TEST_HAS_NO_UNICODE_CHARS
static_assert( test<std::u16string_view> ({ u"abc", 3}), ""); static_assert( test<std::u16string_view> ({ u"abc", 3}), "");
static_assert( test<std::u32string_view> ({ U"abc", 3}), ""); static_assert( test<std::u32string_view> ({ U"abc", 3}), "");
# endif # endif

View File

@ -29,7 +29,7 @@ int main(int, char**) {
#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
test_hash_enabled_for_type<std::u8string_view>(); test_hash_enabled_for_type<std::u8string_view>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test_hash_enabled_for_type<std::u16string_view>(); test_hash_enabled_for_type<std::u16string_view>();
test_hash_enabled_for_type<std::u32string_view>(); test_hash_enabled_for_type<std::u32string_view>();
#endif #endif

View File

@ -61,7 +61,7 @@ int main(int, char**)
#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
test<std::u8string_view>(); test<std::u8string_view>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<std::u16string_view>(); test<std::u16string_view>();
test<std::u32string_view>(); test<std::u32string_view>();
#endif #endif

View File

@ -37,7 +37,7 @@ void test() {
#ifndef _LIBCPP_HAS_NO_CHAR8_T #ifndef _LIBCPP_HAS_NO_CHAR8_T
test<char8_t>(); test<char8_t>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t>(); test<char16_t>();
test<char32_t>(); test<char32_t>();
#endif #endif

View File

@ -57,7 +57,7 @@ void test() {
std::make_format_args<std::basic_format_context< std::make_format_args<std::basic_format_context<
std::back_insert_iterator<std::basic_string<char8_t>>, char8_t>>())); std::back_insert_iterator<std::basic_string<char8_t>>, char8_t>>()));
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test(std::basic_format_args( test(std::basic_format_args(
std::make_format_args<std::basic_format_context< std::make_format_args<std::basic_format_context<
std::back_insert_iterator<std::basic_string<char16_t>>, std::back_insert_iterator<std::basic_string<char16_t>>,

View File

@ -54,7 +54,7 @@ int main(int, char**) {
#ifndef _LIBCPP_HAS_NO_CHAR8_T #ifndef _LIBCPP_HAS_NO_CHAR8_T
test<std::back_insert_iterator<std::basic_string<char8_t>>, char8_t>(); test<std::back_insert_iterator<std::basic_string<char8_t>>, char8_t>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<std::back_insert_iterator<std::basic_string<char16_t>>, char16_t>(); test<std::back_insert_iterator<std::basic_string<char16_t>>, char16_t>();
test<std::back_insert_iterator<std::basic_string<char32_t>>, char32_t>(); test<std::back_insert_iterator<std::basic_string<char32_t>>, char32_t>();
#endif #endif

View File

@ -132,7 +132,7 @@ void test() {
#ifndef _LIBCPP_HAS_NO_CHAR8_T #ifndef _LIBCPP_HAS_NO_CHAR8_T
test<std::back_insert_iterator<std::basic_string<char8_t>>, char8_t>(); test<std::back_insert_iterator<std::basic_string<char8_t>>, char8_t>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<std::back_insert_iterator<std::basic_string<char16_t>>, char16_t>(); test<std::back_insert_iterator<std::basic_string<char16_t>>, char16_t>();
test<std::back_insert_iterator<std::basic_string<char32_t>>, char32_t>(); test<std::back_insert_iterator<std::basic_string<char32_t>>, char32_t>();
#endif #endif

View File

@ -88,7 +88,7 @@ void test() {
#ifndef _LIBCPP_HAS_NO_CHAR8_T #ifndef _LIBCPP_HAS_NO_CHAR8_T
test<std::back_insert_iterator<std::basic_string<char8_t>>, char8_t>(); test<std::back_insert_iterator<std::basic_string<char8_t>>, char8_t>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<std::back_insert_iterator<std::basic_string<char16_t>>, char16_t>(); test<std::back_insert_iterator<std::basic_string<char16_t>>, char16_t>();
test<std::back_insert_iterator<std::basic_string<char32_t>>, char32_t>(); test<std::back_insert_iterator<std::basic_string<char32_t>>, char32_t>();
#endif #endif

View File

@ -53,7 +53,7 @@ void test() {
std::make_format_args<std::basic_format_context< std::make_format_args<std::basic_format_context<
std::back_insert_iterator<std::basic_string<char8_t>>, char8_t>>())); std::back_insert_iterator<std::basic_string<char8_t>>, char8_t>>()));
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test(std::basic_format_args( test(std::basic_format_args(
std::make_format_args<std::basic_format_context< std::make_format_args<std::basic_format_context<
std::back_insert_iterator<std::basic_string<char16_t>>, std::back_insert_iterator<std::basic_string<char16_t>>,

View File

@ -55,7 +55,7 @@ constexpr bool test() {
#ifndef _LIBCPP_HAS_NO_CHAR8_T #ifndef _LIBCPP_HAS_NO_CHAR8_T
test(u8"abc"); test(u8"abc");
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test(u"abc"); test(u"abc");
test(U"abc"); test(U"abc");
#endif #endif

View File

@ -41,7 +41,7 @@ constexpr bool test() {
#ifndef _LIBCPP_HAS_NO_CHAR8_T #ifndef _LIBCPP_HAS_NO_CHAR8_T
test(u8"abc"); test(u8"abc");
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test(u"abc"); test(u"abc");
test(U"abc"); test(U"abc");
#endif #endif

View File

@ -64,7 +64,7 @@ constexpr bool test() {
#ifndef _LIBCPP_HAS_NO_CHAR8_T #ifndef _LIBCPP_HAS_NO_CHAR8_T
test(u8"abc"); test(u8"abc");
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test(u"abc"); test(u"abc");
test(U"abc"); test(U"abc");
#endif #endif

View File

@ -41,7 +41,7 @@ constexpr bool test() {
#ifndef _LIBCPP_HAS_NO_CHAR8_T #ifndef _LIBCPP_HAS_NO_CHAR8_T
test(u8"abc"); test(u8"abc");
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test(u"abc"); test(u"abc");
test(U"abc"); test(U"abc");
#endif #endif

View File

@ -53,7 +53,7 @@ constexpr void test() {
#ifndef _LIBCPP_HAS_NO_CHAR8_T #ifndef _LIBCPP_HAS_NO_CHAR8_T
test<char8_t>(); test<char8_t>();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test<char16_t>(); test<char16_t>();
test<char32_t>(); test<char32_t>();
#endif #endif

View File

@ -98,7 +98,7 @@ constexpr void test_char8t() {
} }
#endif // _LIBCPP_HAS_NO_CHAR8_T #endif // _LIBCPP_HAS_NO_CHAR8_T
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
template <class T> template <class T>
constexpr void test_uchars() { constexpr void test_uchars() {
std::cmp_equal(T(), T()); // expected-error 2 {{no matching function for call to 'cmp_equal'}} std::cmp_equal(T(), T()); // expected-error 2 {{no matching function for call to 'cmp_equal'}}
@ -122,7 +122,7 @@ constexpr void test_uchars() {
std::in_range<T>(int()); // expected-error 2 {{no matching function for call to 'in_range'}} std::in_range<T>(int()); // expected-error 2 {{no matching function for call to 'in_range'}}
std::in_range<int>(T()); // expected-error 2 {{no matching function for call to 'in_range'}} std::in_range<int>(T()); // expected-error 2 {{no matching function for call to 'in_range'}}
} }
#endif // _LIBCPP_HAS_NO_UNICODE_CHARS #endif // TEST_HAS_NO_UNICODE_CHARS
int main(int, char**) { int main(int, char**) {
test<bool>(); test<bool>();
@ -143,7 +143,7 @@ int main(int, char**) {
test_char8t<char8_t>(); test_char8t<char8_t>();
#endif // _LIBCPP_HAS_NO_CHAR8_T #endif // _LIBCPP_HAS_NO_CHAR8_T
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
test_uchars<char16_t>(); test_uchars<char16_t>();
test_uchars<char32_t>(); test_uchars<char32_t>();
#endif #endif

View File

@ -81,7 +81,7 @@ struct TestEachIntegralType {
#if TEST_STD_VER > 17 && defined(__cpp_char8_t) #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
TestFunctor<char8_t>()(); TestFunctor<char8_t>()();
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
TestFunctor<char16_t>()(); TestFunctor<char16_t>()();
TestFunctor<char32_t>()(); TestFunctor<char32_t>()();
#endif #endif

View File

@ -60,7 +60,7 @@ using LibraryHashTypes = TypeList<
#ifndef TEST_HAS_NO_WIDE_CHARACTERS #ifndef TEST_HAS_NO_WIDE_CHARACTERS
wchar_t, wchar_t,
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
char16_t, char16_t,
char32_t, char32_t,
#endif #endif

View File

@ -37,7 +37,7 @@ int main(int, char**) {
== u8" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" == u8" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN"
"OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"); "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~");
#endif #endif
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS #ifndef TEST_HAS_NO_UNICODE_CHARS
assert(MAKE_STRING(char16_t, assert(MAKE_STRING(char16_t,
" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN"
"OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~") "OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~")

View File

@ -372,6 +372,10 @@ inline void DoNotOptimize(Tp const& value) {
# define TEST_HAS_NO_INT128 # define TEST_HAS_NO_INT128
#endif #endif
#if defined(_LIBCPP_HAS_NO_UNICODE_CHARS)
# define TEST_HAS_NO_UNICODE_CHARS
#endif
#if defined(__GNUC__) #if defined(__GNUC__)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif