[libcxx-commits] [libcxx] 83c2aa4 - [libcxx] [test] Fix locale.time.get.byname get_date and get_date_wide on Windows
Martin Storsjö via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Feb 17 00:55:03 PST 2022
Author: Martin Storsjö
Date: 2022-02-17T10:54:39+02:00
New Revision: 83c2aa467e22f85a0952fb1788771647829d9633
URL: https://github.com/llvm/llvm-project/commit/83c2aa467e22f85a0952fb1788771647829d9633
DIFF: https://github.com/llvm/llvm-project/commit/83c2aa467e22f85a0952fb1788771647829d9633.diff
LOG: [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
Added:
Modified:
libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp
libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp
index 9989f8cd801c9..4f17a019dbccf 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp
@@ -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);
diff --git a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp
index 69dd3893e3faf..f7f15568e440c 100644
--- a/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp
@@ -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);
More information about the libcxx-commits
mailing list