[libcxx-commits] [PATCH] D119790: [libcxx] [test] Fix the locale get_one_wide test for windows and glibc

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 15 01:07:24 PST 2022


mstorsjo updated this revision to Diff 408750.
mstorsjo added a comment.

Retry the CI, rebased to an older version where there hopefully aren't any other unrelated CI failures.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119790/new/

https://reviews.llvm.org/D119790

Files:
  libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp


Index: libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
===================================================================
--- libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
+++ libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
@@ -9,8 +9,6 @@
 // NetBSD does not support LC_TIME at the moment
 // XFAIL: netbsd
 
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // XFAIL: libcpp-has-no-wide-characters
 
 // REQUIRES: locale.en_US.UTF-8
@@ -25,9 +23,6 @@
 // iter_type get(iter_type s, iter_type end, ios_base& f,
 //               ios_base::iostate& err, tm *t, char format, char modifier = 0) const;
 
-// TODO: investigation needed
-// XFAIL: target={{.*}}-linux-gnu{{.*}}
-
 #include <locale>
 #include <cassert>
 #include "test_macros.h"
@@ -54,7 +49,13 @@
     std::tm t;
     {
         const my_facet f(LOCALE_en_US_UTF_8, 1);
+#ifdef _WIN32
+        const wchar_t in[] = L"12/31/2061 11:55:59 PM";
+#elif defined(TEST_HAS_GLIBC)
+        const wchar_t in[] = L"Sat 31 Dec 2061 11:55:59 PM";
+#else
         const wchar_t in[] = L"Sat Dec 31 23:55:59 2061";
+#endif
         err = std::ios_base::goodbit;
         t = std::tm();
         I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'c');
@@ -65,12 +66,18 @@
         assert(t.tm_mday == 31);
         assert(t.tm_mon == 11);
         assert(t.tm_year == 161);
+#ifndef _WIN32
         assert(t.tm_wday == 6);
+#endif
         assert(err == std::ios_base::eofbit);
     }
     {
         const my_facet f(LOCALE_en_US_UTF_8, 1);
+#if defined(_WIN32) || defined(TEST_HAS_GLIBC)
+        const wchar_t in[] = L"11:55:59 PM";
+#else
         const wchar_t in[] = L"23:55:59";
+#endif
         err = std::ios_base::goodbit;
         t = std::tm();
         I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'X');
@@ -82,7 +89,13 @@
     }
     {
         const my_facet f(LOCALE_fr_FR_UTF_8, 1);
+#ifdef _WIN32
+        const wchar_t in[] = L"31/12/2061 23:55:59";
+#elif defined(TEST_HAS_GLIBC)
+        const wchar_t in[] = L"sam. 31 d" L"\xE9" L"c. 2061 23:55:59";
+#else
         const wchar_t in[] = L"Sam 31 d" L"\xE9" L"c 23:55:59 2061";
+#endif
         err = std::ios_base::goodbit;
         t = std::tm();
         I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'c');
@@ -93,7 +106,9 @@
         assert(t.tm_mday == 31);
         assert(t.tm_mon == 11);
         assert(t.tm_year == 161);
+#ifndef _WIN32
         assert(t.tm_wday == 6);
+#endif
         assert(err == std::ios_base::eofbit);
     }
     {
@@ -164,7 +179,11 @@
 #endif
     {
         const my_facet f(LOCALE_zh_CN_UTF_8, 1);
+#ifdef _WIN32
+        const wchar_t in[] = L"23:55:59";
+#else
         const wchar_t in[] = L"23" L"\x65F6" L"55" L"\x5206" L"59" L"\x79D2";
+#endif
         err = std::ios_base::goodbit;
         t = std::tm();
         I i = f.get(I(in), I(in+sizeof(in)/sizeof(in[0])-1), ios, err, &t, 'X');


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119790.408750.patch
Type: text/x-patch
Size: 3073 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220215/b925eb3d/attachment-0001.bin>


More information about the libcxx-commits mailing list