[libcxx-commits] [PATCH] D120317: [libcxx] [test] Fix get/put long_double_ru_RU on Glibc, FreeBSD and Windows
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Feb 23 09:39:45 PST 2022
Mordante added inline comments.
================
Comment at: libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp:53
+// FreeBSD and Windows use U+00A0 NO-BREAK SPACE.
+static std::wstring convert_thousands_sep(std::wstring const& in) {
+#if defined(TEST_HAS_GLIBC) || defined(__FreeBSD__) || defined(_WIN32)
----------------
Would it make sense to move this function to a helper header and share the code between the two tests?
================
Comment at: libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp:56
+ std::wstring out;
+ unsigned I = 0;
+ bool seen_num_start = false;
----------------
Please reduce the scope to the loop.
Please use a lower case `i`.
================
Comment at: libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp:61
+ seen_decimal |= in[I] == L',';
+ seen_num_start |= in[I] == L'-' || std::iswdigit(in[I]);
+ if (seen_decimal || !seen_num_start || in[I] != L' ') {
----------------
`std::iswdigit` requires `<cwctype>`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120317/new/
https://reviews.llvm.org/D120317
More information about the libcxx-commits
mailing list