diff options
author | Tom Honermann <tom@honermann.net> | 2019-02-22 01:16:08 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2019-02-22 01:16:08 +0000 |
commit | 59019b4223633066d86d46147bc2c01de8d9da22 (patch) | |
tree | 79b2a1ebd43116878ad44eb2391e5b02f0d8555d /libstdc++-v3/testsuite/22_locale | |
parent | 65bbaf3125f7c92be32e2e3b6c07e63e8ab0ccbc (diff) | |
download | gcc-59019b4223633066d86d46147bc2c01de8d9da22.zip gcc-59019b4223633066d86d46147bc2c01de8d9da22.tar.gz gcc-59019b4223633066d86d46147bc2c01de8d9da22.tar.bz2 |
P0482R5 char8_t: Updates to existing standard library tests
This patch augments existing tests to validate behavior for char8_t. In
all cases, added test cases are cloned from existing tests for wchar_t
or char16_t.
A few tests required updates to line numbers for diagnostic messages.
2019-02-22 Tom Honermann <tom@honermann.net>
* testsuite/18_support/byte/ops.cc: Validate
std::to_integer<char8_t>, std::to_integer<char16_t>, and
std::to_integer<char32_t>.
* testsuite/18_support/numeric_limits/dr559.cc: Validate
std::numeric_limits<char8_t>.
* testsuite/18_support/numeric_limits/lowest.cc: Validate
std::numeric_limits<char8_t>::lowest().
* testsuite/18_support/numeric_limits/max_digits10.cc: Validate
std::numeric_limits<char8_t>::max_digits10.
* testsuite/18_support/type_info/fundamental.cc: Validate
typeinfo for char8_t.
* testsuite/20_util/from_chars/1_c++20_neg.cc: New test, validating
std::from_chars with char8_t.
* testsuite/20_util/hash/requirements/explicit_instantiation.cc:
Validate explicit instantiation of std::hash<char8_t>.
* testsuite/20_util/is_integral/value.cc: Validate
std::is_integral<char8_t>.
* testsuite/20_util/make_signed/requirements/typedefs-4.cc:
Validate std::make_signed<char8_t>.
* testsuite/21_strings/basic_string/cons/char/deduction.cc:
Validate u8string construction from char8_t sources.
* testsuite/21_strings/basic_string/types/pmr_typedefs.cc: Validate
std::pmr::u8string.
* testsuite/21_strings/basic_string_view/operations/compare/
char/70483.cc: Validate substr operations on u8string_view.
* testsuite/21_strings/basic_string_view/typedefs.cc: Validate that
the u8string_view typedef is defined.
* testsuite/21_strings/char_traits/requirements/
constexpr_functions.cc: Validate char_traits<char8_t> constexpr
member functions.
* testsuite/21_strings/char_traits/requirements/
constexpr_functions_c++17.cc: Validate char_traits<char8_t> C++17
constexpr member functions.
* testsuite/21_strings/headers/string/types_std_c++0x.cc: Validate
that the u8string typedef is defined.
* testsuite/22_locale/locale/cons/unicode.cc: Validate the presence
of the std::codecvt<char16_t, char8_t, std::mbstate_t> and
std::codecvt<char32_t, char8_t, std::mbstate_t> facets.
* testsuite/29_atomics/atomic/cons/assign_neg.cc: Update line
numbers.
* testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise.
* testsuite/29_atomics/atomic_integral/cons/assign_neg.cc:
Likewise.
* testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Likewise.
* testsuite/29_atomics/atomic_integral/is_always_lock_free.cc:
Validate std::atomic<char8_t>::is_always_lock_free
* testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc:
Update line numbers.
* testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc:
Likewise.
* testsuite/29_atomics/atomic_integral/operators/increment_neg.cc:
Likewise.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc:
Validate std::experimental::pmr::u8string.
* testsuite/experimental/string_view/typedefs.cc: Validate that the
u8string_view typedef is defined.
* testsuite/util/testsuite_common_types.h: Add char8_t, char16_t and
char32_t to the typelists.
From-SVN: r269089
Diffstat (limited to 'libstdc++-v3/testsuite/22_locale')
-rw-r--r-- | libstdc++-v3/testsuite/22_locale/locale/cons/unicode.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/unicode.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/unicode.cc index fb8e121..21b7534 100644 --- a/libstdc++-v3/testsuite/22_locale/locale/cons/unicode.cc +++ b/libstdc++-v3/testsuite/22_locale/locale/cons/unicode.cc @@ -36,6 +36,10 @@ typedef std::codecvt<wchar_t, char, std::mbstate_t> w_codecvt; #ifdef _GLIBCXX_USE_C99_STDINT_TR1 typedef std::codecvt<char16_t, char, std::mbstate_t> u16_codecvt; typedef std::codecvt<char32_t, char, std::mbstate_t> u32_codecvt; +#ifdef _GLIBCXX_USE_CHAR8_T +typedef std::codecvt<char16_t, char8_t, std::mbstate_t> u16u8_codecvt; +typedef std::codecvt<char32_t, char8_t, std::mbstate_t> u32u8_codecvt; +#endif #endif class gnu_facet: public std::locale::facet @@ -68,6 +72,10 @@ void test01() #ifdef _GLIBCXX_USE_C99_STDINT_TR1 VERIFY( has_facet<u16_codecvt>(loc13) ); VERIFY( has_facet<u32_codecvt>(loc13) ); +#ifdef _GLIBCXX_USE_CHAR8_T + VERIFY( has_facet<u16u8_codecvt>(loc13) ); + VERIFY( has_facet<u32u8_codecvt>(loc13) ); +#endif #endif VERIFY( has_facet<unicode_codecvt>(loc13) ); } |