[libcxx] [test] Fix locale.time.get.byname get_date and get_date_wide on Windows

Also apply the same fix on glibc. This takes the test one step closer
to passing on glibc, but it still fails on the zh_CN test (which
requires a more involved fix in libc++ itself).

Differential Revision: https://reviews.llvm.org/D119791
This commit is contained in:
Martin Storsjö
2022-01-24 22:25:41 +00:00
parent f081cc5037
commit 83c2aa467e
2 changed files with 10 additions and 8 deletions

View File

@@ -14,12 +14,9 @@
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// GLIBC Expects "10/06/2009" for fr_FR as opposed to "10.06.2009"
// GLIBC also fails on the zh_CN test.
// GLIBC fails on the zh_CN test.
// XFAIL: linux
// XFAIL: LIBCXX-WINDOWS-FIXME
// <locale>
// class time_get_byname<charT, InputIterator>
@@ -66,7 +63,11 @@ int main(int, char**)
}
{
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
#if defined(_WIN32) || defined(TEST_HAS_GLIBC)
const char in[] = "10/06/2009";
#else
const char in[] = "10.06.2009";
#endif
err = std::ios_base::goodbit;
t = std::tm();
I i = f.get_date(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);

View File

@@ -16,12 +16,9 @@
// REQUIRES: locale.ru_RU.UTF-8
// REQUIRES: locale.zh_CN.UTF-8
// GLIBC Expects "10/06/2009" for fr_FR as opposed to "10.06.2009"
// GLIBC also fails on the zh_CN test.
// GLIBC fails on the zh_CN test.
// XFAIL: linux
// XFAIL: LIBCXX-WINDOWS-FIXME
// <locale>
// class time_get_byname<charT, InputIterator>
@@ -68,7 +65,11 @@ int main(int, char**)
}
{
const my_facet f(LOCALE_fr_FR_UTF_8, 1);
#if defined(_WIN32) || defined(TEST_HAS_GLIBC)
const wchar_t in[] = L"10/06/2009";
#else
const wchar_t in[] = L"10.06.2009";
#endif
err = std::ios_base::goodbit;
t = std::tm();
I i = f.get_date(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t);