[libcxx-commits] [libcxx] 1403080 - [NFC][chrono][test] Fixes some tests on Windows.
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jul 5 09:09:35 PDT 2023
Author: Mark de Wever
Date: 2023-07-05T18:09:24+02:00
New Revision: 1403080a1f23b27c61da524a31513c449773375d
URL: https://github.com/llvm/llvm-project/commit/1403080a1f23b27c61da524a31513c449773375d
DIFF: https://github.com/llvm/llvm-project/commit/1403080a1f23b27c61da524a31513c449773375d.diff
LOG: [NFC][chrono][test] Fixes some tests on Windows.
This updates the tests to match the actual output on Windows.
Note some tests still need more investigation.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D153498
Added:
Modified:
libcxx/test/std/time/time.syn/formatter.day.pass.cpp
libcxx/test/std/time/time.syn/formatter.duration.pass.cpp
libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp
libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp
libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp
libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp
libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp
libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp
libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp
libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp
libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/test/std/time/time.syn/formatter.day.pass.cpp b/libcxx/test/std/time/time.syn/formatter.day.pass.cpp
index 6e5eee2960e405..95cb30e0433804 100644
--- a/libcxx/test/std/time/time.syn/formatter.day.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.day.pass.cpp
@@ -11,12 +11,12 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
-// TODO FMT Investigate Windows issues.
-// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
-
// TODO FMT This test should not require std::to_chars(floating-point)
// XFAIL: availability-fp_to_chars-missing
+// TODO FMT Investigate Windows issues.
+// XFAIL: msvc
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
@@ -64,41 +64,59 @@ static void test_valid_values() {
std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
// Non localized output using C-locale
+#if defined(_WIN32)
+ check(SV("%d=''\t%Od=''\t%e=''\t%Oe=''\n"), fmt, 0d);
+#else
check(SV("%d='00'\t%Od='00'\t%e=' 0'\t%Oe=' 0'\n"), fmt, 0d);
+#endif
check(SV("%d='01'\t%Od='01'\t%e=' 1'\t%Oe=' 1'\n"), fmt, 1d);
check(SV("%d='31'\t%Od='31'\t%e='31'\t%Oe='31'\n"), fmt, 31d);
-#if defined(_AIX)
+#if defined(_WIN32)
+ check(SV("%d=''\t%Od=''\t%e=''\t%Oe=''\n"), fmt, 0d);
+#elif defined(_AIX)
check(SV("%d='55'\t%Od='55'\t%e='55'\t%Oe='55'\n"), fmt, 255d);
#else
check(SV("%d='255'\t%Od='255'\t%e='255'\t%Oe='255'\n"), fmt, 255d);
#endif
// Use the global locale (fr_FR)
+#if defined(_WIN32)
+ check(SV("%d=''\t%Od=''\t%e=''\t%Oe=''\n"), lfmt, 0d);
+#else
check(SV("%d='00'\t%Od='00'\t%e=' 0'\t%Oe=' 0'\n"), lfmt, 0d);
+#endif
check(SV("%d='01'\t%Od='01'\t%e=' 1'\t%Oe=' 1'\n"), lfmt, 1d);
check(SV("%d='31'\t%Od='31'\t%e='31'\t%Oe='31'\n"), lfmt, 31d);
-#if defined(_AIX)
+#if defined(_WIN32)
+ check(SV("%d=''\t%Od=''\t%e=''\t%Oe=''\n"), lfmt, 255d);
+#elif defined(_AIX)
check(SV("%d='55'\t%Od='55'\t%e='55'\t%Oe='55'\n"), lfmt, 255d);
#else
check(SV("%d='255'\t%Od='255'\t%e='255'\t%Oe='255'\n"), lfmt, 255d);
#endif
// Use supplied locale (ja_JP). This locale has a
diff erent alternate on some platforms.
-#if defined(__APPLE__) || defined(_AIX)
+#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
+# if defined(_WIN32)
+ check(loc, SV("%d=''\t%Od=''\t%e=''\t%Oe=''\n"), lfmt, 0d);
+# else
check(loc, SV("%d='00'\t%Od='00'\t%e=' 0'\t%Oe=' 0'\n"), lfmt, 0d);
+# endif
check(loc, SV("%d='01'\t%Od='01'\t%e=' 1'\t%Oe=' 1'\n"), lfmt, 1d);
check(loc, SV("%d='31'\t%Od='31'\t%e='31'\t%Oe='31'\n"), lfmt, 31d);
-# if defined(_AIX)
+# if defined(_WIN32)
+ check(SV("%d=''\t%Od=''\t%e=''\t%Oe=''\n"), fmt, 255d);
+# elif defined(_AIX)
check(SV("%d='55'\t%Od='55'\t%e='55'\t%Oe='55'\n"), fmt, 255d);
# else
check(SV("%d='255'\t%Od='255'\t%e='255'\t%Oe='255'\n"), fmt, 255d);
# endif
-#else // defined(__APPLE__) || defined(_AIX)
+#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(loc, SV("%d='00'\t%Od='〇'\t%e=' 0'\t%Oe='〇'\n"), lfmt, 0d);
check(loc, SV("%d='01'\t%Od='一'\t%e=' 1'\t%Oe='一'\n"), lfmt, 1d);
check(loc, SV("%d='31'\t%Od='三十一'\t%e='31'\t%Oe='三十一'\n"), lfmt, 31d);
check(loc, SV("%d='255'\t%Od='255'\t%e='255'\t%Oe='255'\n"), lfmt, 255d);
-#endif // defined(__APPLE__) || defined(_AIX)
+#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
std::locale::global(std::locale::classic());
}
diff --git a/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp b/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp
index 2a48893a299c7a..88c3f62c8f269b 100644
--- a/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.duration.pass.cpp
@@ -11,9 +11,6 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
-// TODO FMT Investigate Windows issues.
-// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
-
// XFAIL: availability-fp_to_chars-missing
// REQUIRES: locale.fr_FR.UTF-8
@@ -247,7 +244,7 @@ static void test_valid_positive_integral_values() {
"%R='00:00'\t"
"%T='00:00:00'\t"
#ifdef _WIN32
- "%r='12:00:00'\t"
+ "%r='00:00:00'\t"
#elif defined(_AIX)
"%r='12:00:00 AM'\t"
#elif defined(__APPLE__)
@@ -313,7 +310,7 @@ static void test_valid_positive_integral_values() {
"%R='12:00'\t"
"%T='12:00:00'\t"
#ifdef _WIN32
- "%r='00:00:00'\t"
+ "%r='12:00:00'\t"
#elif defined(_AIX)
"%r='12:00:00 PM'\t"
#elif defined(__APPLE__)
@@ -349,6 +346,8 @@ static void test_valid_positive_integral_values() {
"%r='11:59:59 PM'\t"
#elif defined(__APPLE__)
"%r=''\t"
+#elif defined(_WIN32)
+ "%r='23:59:59'\t"
#else
"%r='11:59:59 '\t"
#endif
@@ -377,11 +376,13 @@ static void test_valid_positive_integral_values() {
"%R='00:00'\t"
"%T='00:00:00'\t"
#ifdef _WIN32
- "%r='12:00:00'\t"
+ "%r='00:00:00'\t"
#elif defined(_AIX)
"%r='12:00:00 AM'\t"
#elif defined(__APPLE__)
"%r=''\t"
+#elif defined(_WIN32)
+ "%r='12:00:00'\t"
#else
"%r='12:00:00 '\t"
#endif
@@ -395,7 +396,7 @@ static void test_valid_positive_integral_values() {
std::chrono::duration<int, std::ratio<86400>>(7));
// Use supplied locale (ja_JP). This locale has a
diff erent alternate.
-#if defined(__APPLE__) || defined(_AIX)
+#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(loc,
SV("%H='00'\t"
"%OH='00'\t"
@@ -416,6 +417,10 @@ static void test_valid_positive_integral_values() {
"%r='12:00:00 AM'\t"
"%X='00時00分00秒'\t"
"%EX='00時00分00秒'\t"
+# elif defined(_WIN32)
+ "%r='0:00:00'\t"
+ "%X='0:00:00'\t"
+ "%EX='0:00:00'\t"
# else
"%r='午前12:00:00'\t"
"%X='00:00:00'\t"
@@ -448,6 +453,10 @@ static void test_valid_positive_integral_values() {
"%r='11:59:59 AM'\t"
"%X='11時59分59秒'\t"
"%EX='11時59分59秒'\t"
+# elif defined(_WIN32)
+ "%r='11:59:59'\t"
+ "%X='11:59:59'\t"
+ "%EX='11:59:59'\t"
# else
"%r='午前11:59:59'\t"
"%X='11:59:59'\t"
@@ -481,7 +490,11 @@ static void test_valid_positive_integral_values() {
"%X='12時00分00秒'\t"
"%EX='12時00分00秒'\t"
# else
+# ifdef _WIN32
+ "%r='12:00:00'\t"
+# else
"%r='午後12:00:00'\t"
+# endif
"%X='12:00:00'\t"
"%EX='12:00:00'\t"
# endif
@@ -513,7 +526,11 @@ static void test_valid_positive_integral_values() {
"%X='23時59分59秒'\t"
"%EX='23時59分59秒'\t"
# else
+# ifdef _WIN32
+ "%r='23:59:59'\t"
+# else
"%r='午後11:59:59'\t"
+# endif
"%X='23:59:59'\t"
"%EX='23:59:59'\t"
# endif
@@ -544,6 +561,10 @@ static void test_valid_positive_integral_values() {
"%r='12:00:00 AM'\t"
"%X='00時00分00秒'\t"
"%EX='00時00分00秒'\t"
+# elif defined(_WIN32)
+ "%r='0:00:00'\t"
+ "%X='0:00:00'\t"
+ "%EX='0:00:00'\t"
# else
"%r='午前12:00:00'\t"
"%X='00:00:00'\t"
@@ -555,7 +576,7 @@ static void test_valid_positive_integral_values() {
"\n"),
lfmt,
std::chrono::duration<int, std::ratio<86400>>(7));
-#else // defined(__APPLE__) || defined(_AIX)
+#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(loc,
SV("%H='00'\t"
"%OH='〇'\t"
@@ -665,8 +686,8 @@ static void test_valid_positive_integral_values() {
"\n"),
lfmt,
std::chrono::duration<int, std::ratio<86400>>(7));
+#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
-#endif // defined(__APPLE__) || defined(_AIX)
std::locale::global(std::locale::classic());
}
@@ -767,6 +788,8 @@ static void test_valid_negative_integral_values() {
"%r='11:59:59 PM'\t"
#elif defined(__APPLE__)
"%r=''\t"
+#elif defined(_WIN32)
+ "%r='23:59:59'\t"
#else
"%r='11:59:59 '\t"
#endif
@@ -780,7 +803,7 @@ static void test_valid_negative_integral_values() {
-(23h + 59min + 59s));
// Use supplied locale (ja_JP). This locale has a
diff erent alternate.
-#if defined(__APPLE__) || defined(_AIX)
+#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(loc,
SV("-%H='23'\t"
"%OH='23'\t"
@@ -801,6 +824,10 @@ static void test_valid_negative_integral_values() {
"%r='11:59:59 PM'\t"
"%X='23時59分59秒'\t"
"%EX='23時59分59秒'\t"
+# elif defined(_WIN32)
+ "%r='23:59:59'\t"
+ "%X='23:59:59'\t"
+ "%EX='23:59:59'\t"
# else
"%r='午後11:59:59'\t"
"%X='23:59:59'\t"
@@ -812,7 +839,7 @@ static void test_valid_negative_integral_values() {
"\n"),
lfmt,
-(23h + 59min + 59s));
-#else // defined(__APPLE__) || defined(_AIX)
+#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(loc,
SV("-%H='23'\t"
"%OH='二十三'\t"
@@ -834,7 +861,7 @@ static void test_valid_negative_integral_values() {
"\n"),
lfmt,
-(23h + 59min + 59s));
-#endif // defined(__APPLE__) || defined(_AIX)
+#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
std::locale::global(std::locale::classic());
}
@@ -987,7 +1014,7 @@ static void test_valid_fractional_values() {
check(loc, SV("00.011"), SV("{:L%S}"), std::chrono::duration<double, std::milli>(11.123456789));
check(loc, SV("01"), SV("{:L%S}"), std::chrono::duration<long double>(61.123456789));
-#if defined(__APPLE__) || defined(_AIX)
+#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(SV("00.000000001"), SV("{:%OS}"), 1ns);
check(SV("00.000000501"), SV("{:%OS}"), 501ns);
check(SV("00.000001000"), SV("{:%OS}"), 1000ns);
@@ -1003,7 +1030,7 @@ static void test_valid_fractional_values() {
check(SV("00.001"), SV("{:%OS}"), std::chrono::duration<float, std::milli>(1.123456789));
check(SV("00.011"), SV("{:%OS}"), std::chrono::duration<double, std::milli>(11.123456789));
check(SV("01"), SV("{:%OS}"), std::chrono::duration<long double>(61.123456789));
-#else // defined(__APPLE__) || defined(_AIX)
+#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(loc, SV("〇.000000001"), SV("{:L%OS}"), 1ns);
check(loc, SV("〇.000000501"), SV("{:L%OS}"), 501ns);
check(loc, SV("〇.000001000"), SV("{:L%OS}"), 1000ns);
@@ -1019,7 +1046,7 @@ static void test_valid_fractional_values() {
check(loc, SV("〇.001"), SV("{:L%OS}"), std::chrono::duration<float, std::milli>(1.123456789));
check(loc, SV("〇.011"), SV("{:L%OS}"), std::chrono::duration<double, std::milli>(11.123456789));
check(loc, SV("一"), SV("{:L%OS}"), std::chrono::duration<long double>(61.123456789));
-#endif // defined(__APPLE__) || defined(_AIX)
+#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(loc, SV("01:05:06.000000001"), SV("{:L%T}"), 1h + 5min + 6s + 1ns);
check(loc, SV("01:05:06.000000501"), SV("{:L%T}"), 1h + 5min + 6s + 501ns);
diff --git a/libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp b/libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp
index 9c2c8f976bfc71..952b9803d82e62 100644
--- a/libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp
@@ -14,9 +14,6 @@
// TODO FMT This test should not require std::to_chars(floating-point)
// XFAIL: availability-fp_to_chars-missing
-// TODO FMT Investigate Windows issues.
-// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
-
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
@@ -245,7 +242,7 @@ static void test_valid_values_day() {
lfmt,
file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
-#endif // _WIN32
+#endif // _WIN32
std::locale::global(std::locale::classic());
}
@@ -336,7 +333,7 @@ static void test_valid_values_day_of_year() {
check(SV("%j='138'\n"), lfmt, file_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033
// Use supplied locale (ja_JP). This locale has a
diff erent alternate.
- check(loc, SV("%j='001'\n"), lfmt, file_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+ check(loc, SV("%j='001'\n"), lfmt, file_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
check(loc, SV("%j='138'\n"), lfmt, file_seconds(2'000'000'000s)); // 03:33:20 UTC on Wednesday, 18 May 2033
@@ -641,6 +638,8 @@ static void test_valid_values_time() {
"%r='11:31:30 PM'\t"
#elif defined(__APPLE__)
"%r=''\t"
+#elif defined(_WIN32)
+ "%r='23:31:30 '\t"
#else
"%r='11:31:30 '\t"
#endif
@@ -652,7 +651,7 @@ static void test_valid_values_time() {
1'234'567'890'123ms)); // 23:31:30 UTC on Friday, 13 February 2009
// Use supplied locale (ja_JP). This locale has a
diff erent alternate.a
-#if defined(__APPLE__) || defined(_AIX)
+#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(loc,
SV("%H='00'\t"
"%OH='00'\t"
@@ -673,6 +672,10 @@ static void test_valid_values_time() {
"%r='12:00:00 AM'\t"
"%X='00時00分00秒'\t"
"%EX='00時00分00秒'\t"
+# elif defined(_WIN32)
+ "%r='0:00:00'\t"
+ "%X='0:00:00'\t"
+ "%EX='0:00:00'\t"
# else
"%r='午前12:00:00'\t"
"%X='00:00:00'\t"
@@ -702,6 +705,10 @@ static void test_valid_values_time() {
"%r='11:31:30 PM'\t"
"%X='23時31分30秒'\t"
"%EX='23時31分30秒'\t"
+# elif defined(_WIN32)
+ "%r='23:31:30'\t"
+ "%X='23:31:30'\t"
+ "%EX='23:31:30'\t"
# else
"%r='午後11:31:30'\t"
"%X='23:31:30'\t"
@@ -710,7 +717,7 @@ static void test_valid_values_time() {
"\n"),
lfmt,
std::chrono::hh_mm_ss(23h + 31min + 30s + 123ms));
-#else // defined(__APPLE__) || defined(_AIX)
+#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(loc,
SV("%H='00'\t"
"%OH='〇'\t"
@@ -749,7 +756,7 @@ static void test_valid_values_time() {
lfmt,
std::chrono::sys_time<std::chrono::milliseconds>(
1'234'567'890'123ms)); // 23:31:30 UTC on Friday, 13 February 2009
-#endif // defined(__APPLE__) || defined(_AIX)
+#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
std::locale::global(std::locale::classic());
}
@@ -782,6 +789,8 @@ static void test_valid_values_date_time() {
SV("%c=' 1 janvier 1970 à 00:00:00 UTC'\t%Ec=' 1 janvier 1970 à 00:00:00 UTC'\n"),
#elif defined(__APPLE__)
SV("%c='Jeu 1 jan 00:00:00 1970'\t%Ec='Jeu 1 jan 00:00:00 1970'\n"),
+#elif defined(_WIN32)
+ SV("%c='01/01/1970 00:00:00'\t%Ec='01/01/1970 00:00:00'\n"),
#else
SV("%c='jeu. 01 janv. 1970 00:00:00'\t%Ec='jeu. 01 janv. 1970 00:00:00'\n"),
#endif
@@ -796,6 +805,8 @@ static void test_valid_values_date_time() {
SV("%c='13 février 2009 à 23:31:30 UTC'\t%Ec='13 février 2009 à 23:31:30 UTC'\n"),
#elif defined(__APPLE__)
SV("%c='Ven 13 fév 23:31:30 2009'\t%Ec='Ven 13 fév 23:31:30 2009'\n"),
+#elif defined(_WIN32)
+ SV("%c='13/02/2009 23:31:30'\t%Ec='13/02/2009 23:31:30'\n"),
#else
SV("%c='ven. 13 févr. 2009 23:31:30'\t%Ec='ven. 13 févr. 2009 23:31:30'\n"),
#endif
@@ -821,6 +832,15 @@ static void test_valid_values_date_time() {
SV("%c='2009年02月13日 23:31:30 UTC'\t%Ec='2009年02月13日 23:31:30 UTC'\n"),
lfmt,
file_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+#elif defined(_WIN32) // __APPLE__
+ check(loc,
+ SV("%c='1970/01/01 0:00:00'\t%Ec='1970/01/01 0:00:00'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+ check(loc,
+ SV("%c='2009/02/13 23:31:30'\t%Ec='2009/02/13 23:31:30'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
#else // __APPLE__
check(loc,
SV("%c='1970年01月01日 00時00分00秒'\t%Ec='昭和45年01月01日 00時00分00秒'\n"),
@@ -866,6 +886,22 @@ static void test_valid_values_time_zone() {
SV("%z='UTC'\t%Ez='UTC'\t%Oz='UTC'\t%Z='UTC'\n"),
lfmt,
file_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+# elif defined(_WIN32) // defined(_AIX)
+ // Non localized output using C-locale
+ check(SV("%z='-0000'\t%Ez='-0000'\t%Oz='-0000'\t%Z='UTC'\n"),
+ fmt,
+ file_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ // Use the global locale (fr_FR)
+ check(SV("%z='-0000'\t%Ez='-0000'\t%Oz='-0000'\t%Z='UTC'\n"),
+ lfmt,
+ file_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ // Use supplied locale (ja_JP). This locale has a
diff erent alternate.a
+ check(loc,
+ SV("%z='-0000'\t%Ez='-0000'\t%Oz='-0000'\t%Z='UTC'\n"),
+ lfmt,
+ file_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
# else // defined(_AIX)
// Non localized output using C-locale
check(SV("%z='+0000'\t%Ez='+0000'\t%Oz='+0000'\t%Z='UTC'\n"),
@@ -884,7 +920,7 @@ static void test_valid_values_time_zone() {
file_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
# endif // defined(_AIX)
std::locale::global(std::locale::classic());
-#endif // !defined(__APPLE__)
+#endif // !defined(__APPLE__)
}
template <class CharT>
diff --git a/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp b/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp
index de415268ea95ee..c141033b4b55e0 100644
--- a/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.hh_mm_ss.pass.cpp
@@ -9,9 +9,6 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
-// TODO FMT Investigate Windows issues.
-// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
-
// XFAIL: LIBCXX-FREEBSD-FIXME
// XFAIL: availability-fp_to_chars-missing
@@ -293,7 +290,7 @@ static void test_valid_values() {
std::chrono::hh_mm_ss(std::chrono::duration<double>(3661.123456)));
// Use supplied locale (ja_JP). This locale has a
diff erent alternate.
-#if defined(__APPLE__) || defined(_AIX)
+#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(loc,
SV("%H='00'\t"
"%OH='00'\t"
@@ -314,6 +311,10 @@ static void test_valid_values() {
"%r='12:00:00 AM'\t"
"%X='00時00分00秒'\t"
"%EX='00時00分00秒'\t"
+# elif defined(_WIN32)
+ "%r='0:00:00'\t"
+ "%X='0:00:00'\t"
+ "%EX='0:00:00'\t"
# else
"%r='午前12:00:00'\t"
"%X='00:00:00'\t"
@@ -343,6 +344,10 @@ static void test_valid_values() {
"%r='11:31:30 PM'\t"
"%X='23時31分30秒'\t"
"%EX='23時31分30秒'\t"
+# elif defined(_WIN32)
+ "%r='23:31:30'\t"
+ "%X='23:31:30'\t"
+ "%EX='23:31:30'\t"
# else
"%r='午後11:31:30'\t"
"%X='23:31:30'\t"
@@ -372,6 +377,10 @@ static void test_valid_values() {
"%r='03:02:01 AM'\t"
"%X='03時02分01秒'\t"
"%EX='03時02分01秒'\t"
+# elif defined(_WIN32)
+ "%r='3:02:01'\t"
+ "%X='3:02:01'\t"
+ "%EX='3:02:01'\t"
# else
"%r='午前03:02:01'\t"
"%X='03:02:01'\t"
@@ -401,6 +410,10 @@ static void test_valid_values() {
"%r='01:01:01 AM'\t"
"%X='01時01分01秒'\t"
"%EX='01時01分01秒'\t"
+# elif defined(_WIN32)
+ "%r='1:01:01'\t"
+ "%X='1:01:01'\t"
+ "%EX='1:01:01'\t"
# else
"%r='午前01:01:01'\t"
"%X='01:01:01'\t"
@@ -409,7 +422,7 @@ static void test_valid_values() {
"\n"),
lfmt,
std::chrono::hh_mm_ss(std::chrono::duration<double>(3661.123456)));
-#else // defined(__APPLE__) || defined(_AIX)
+#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(loc,
SV("%H='00'\t"
"%OH='〇'\t"
@@ -486,7 +499,7 @@ static void test_valid_values() {
"\n"),
lfmt,
std::chrono::hh_mm_ss(std::chrono::duration<double>(3661.123456)));
-#endif // defined(__APPLE__) || defined(_AIX)
+#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
std::locale::global(std::locale::classic());
}
diff --git a/libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp b/libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp
index a7def6bf032f44..ff9222438c4b22 100644
--- a/libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.local_time.pass.cpp
@@ -14,9 +14,6 @@
// TODO FMT This test should not require std::to_chars(floating-point)
// XFAIL: availability-fp_to_chars-missing
-// TODO FMT Investigate Windows issues.
-// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
-
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
@@ -240,7 +237,7 @@ static void test_valid_values_day() {
lfmt,
std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
-#endif // _WIN32
+#endif // _WIN32
std::locale::global(std::locale::classic());
}
@@ -654,7 +651,7 @@ static void test_valid_values_time() {
1'234'567'890'123ms)); // 23:31:30 UTC on Friday, 13 February 2009
// Use supplied locale (ja_JP). This locale has a
diff erent alternate.a
-#if defined(__APPLE__) || defined(_AIX)
+#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(loc,
SV("%H='00'\t"
"%OH='00'\t"
@@ -675,6 +672,10 @@ static void test_valid_values_time() {
"%r='12:00:00 AM'\t"
"%X='00時00分00秒'\t"
"%EX='00時00分00秒'\t"
+# elif defined(_WIN32)
+ "%r='0:00:00'\t"
+ "%X='0:00:00'\t"
+ "%EX='0:00:00'\t"
# else
"%r='午前12:00:00'\t"
"%X='00:00:00'\t"
@@ -704,6 +705,10 @@ static void test_valid_values_time() {
"%r='11:31:30 PM'\t"
"%X='23時31分30秒'\t"
"%EX='23時31分30秒'\t"
+# elif defined(_WIN32)
+ "%r='23:31:30'\t"
+ "%X='23:31:30'\t"
+ "%EX='23:31:30'\t"
# else
"%r='午後11:31:30'\t"
"%X='23:31:30'\t"
@@ -712,7 +717,7 @@ static void test_valid_values_time() {
"\n"),
lfmt,
std::chrono::hh_mm_ss(23h + 31min + 30s + 123ms));
-#else // defined(__APPLE__) || defined(_AIX)
+#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(loc,
SV("%H='00'\t"
"%OH='〇'\t"
@@ -751,7 +756,7 @@ static void test_valid_values_time() {
lfmt,
std::chrono::local_time<std::chrono::milliseconds>(
1'234'567'890'123ms)); // 23:31:30 UTC on Friday, 13 February 2009
-#endif // defined(__APPLE__) || defined(_AIX)
+#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
std::locale::global(std::locale::classic());
}
@@ -784,6 +789,8 @@ static void test_valid_values_date_time() {
SV("%c=' 1 janvier 1970 à 00:00:00 UTC'\t%Ec=' 1 janvier 1970 à 00:00:00 UTC'\n"),
#elif defined(__APPLE__)
SV("%c='Jeu 1 jan 00:00:00 1970'\t%Ec='Jeu 1 jan 00:00:00 1970'\n"),
+#elif defined(_WIN32)
+ SV("%c='01/01/1970 00:00:00'\t%Ec='01/01/1970 00:00:00'\n"),
#else
SV("%c='jeu. 01 janv. 1970 00:00:00'\t%Ec='jeu. 01 janv. 1970 00:00:00'\n"),
#endif
@@ -798,6 +805,8 @@ static void test_valid_values_date_time() {
SV("%c='13 février 2009 à 23:31:30 UTC'\t%Ec='13 février 2009 à 23:31:30 UTC'\n"),
#elif defined(__APPLE__)
SV("%c='Ven 13 fév 23:31:30 2009'\t%Ec='Ven 13 fév 23:31:30 2009'\n"),
+#elif defined(_WIN32)
+ SV("%c='13/02/2009 23:31:30'\t%Ec='13/02/2009 23:31:30'\n"),
#else
SV("%c='ven. 13 févr. 2009 23:31:30'\t%Ec='ven. 13 févr. 2009 23:31:30'\n"),
#endif
@@ -823,6 +832,15 @@ static void test_valid_values_date_time() {
SV("%c='2009年02月13日 23:31:30 UTC'\t%Ec='2009年02月13日 23:31:30 UTC'\n"),
lfmt,
std::chrono::local_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+#elif defined(_WIN32) // __APPLE__
+ check(loc,
+ SV("%c='1970/01/01 0:00:00'\t%Ec='1970/01/01 0:00:00'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+ check(loc,
+ SV("%c='2009/02/13 23:31:30'\t%Ec='2009/02/13 23:31:30'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
#else // __APPLE__
check(loc,
SV("%c='1970年01月01日 00時00分00秒'\t%Ec='昭和45年01月01日 00時00分00秒'\n"),
diff --git a/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp b/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp
index 4153491934a3f5..3741367095a661 100644
--- a/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.month_day.pass.cpp
@@ -11,12 +11,12 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
-// TODO FMT Investigate Windows issues.
-// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
-
// TODO FMT This test should not require std::to_chars(floating-point)
// XFAIL: availability-fp_to_chars-missing
+// TODO FMT Investigate Windows issues.
+// XFAIL: msvc
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
@@ -112,9 +112,15 @@ static void test_valid_values() {
std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
// Non localized output using C-locale
+#ifdef _WIN32
+ check(SV("%b='Jan'\t%B='January'\t%h='Jan'\t%m='01'\t%Om='01'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ fmt,
+ std::chrono::month_day{std::chrono::January, std::chrono::day{0}});
+#else
check(SV("%b='Jan'\t%B='January'\t%h='Jan'\t%m='01'\t%Om='01'\t%d='00'\t%e=' 0'\t%Od='00'\t%Oe=' 0'\n"),
fmt,
std::chrono::month_day{std::chrono::January, std::chrono::day{0}});
+#endif
check(SV("%b='Feb'\t%B='February'\t%h='Feb'\t%m='02'\t%Om='02'\t%d='01'\t%e=' 1'\t%Od='01'\t%Oe=' 1'\n"),
fmt,
std::chrono::month_day{std::chrono::February, std::chrono::day{1}});
@@ -136,27 +142,42 @@ static void test_valid_values() {
check(SV("%b='Aug'\t%B='August'\t%h='Aug'\t%m='08'\t%Om='08'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"),
fmt,
std::chrono::month_day{std::chrono::August, std::chrono::day{31}});
+#ifdef _WIN32
+ check(SV("%b='Sep'\t%B='September'\t%h='Sep'\t%m='09'\t%Om='09'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ fmt,
+ std::chrono::month_day{std::chrono::September, std::chrono::day{32}});
+ check(SV("%b='Oct'\t%B='October'\t%h='Oct'\t%m='10'\t%Om='10'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ fmt,
+ std::chrono::month_day{std::chrono::October, std::chrono::day{99}});
+ check(SV("%b='Nov'\t%B='November'\t%h='Nov'\t%m='11'\t%Om='11'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ fmt,
+ std::chrono::month_day{std::chrono::November, std::chrono::day{100}});
+ check(SV("%b='Dec'\t%B='December'\t%h='Dec'\t%m='12'\t%Om='12'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ fmt,
+ std::chrono::month_day{std::chrono::December, std::chrono::day{255}});
+#else // _WIN32
check(SV("%b='Sep'\t%B='September'\t%h='Sep'\t%m='09'\t%Om='09'\t%d='32'\t%e='32'\t%Od='32'\t%Oe='32'\n"),
fmt,
std::chrono::month_day{std::chrono::September, std::chrono::day{32}});
check(SV("%b='Oct'\t%B='October'\t%h='Oct'\t%m='10'\t%Om='10'\t%d='99'\t%e='99'\t%Od='99'\t%Oe='99'\n"),
fmt,
std::chrono::month_day{std::chrono::October, std::chrono::day{99}});
-#if defined(_AIX)
+# if defined(_AIX)
check(SV("%b='Nov'\t%B='November'\t%h='Nov'\t%m='11'\t%Om='11'\t%d='00'\t%e=' 0'\t%Od='00'\t%Oe=' 0'\n"),
fmt,
std::chrono::month_day{std::chrono::November, std::chrono::day{100}});
check(SV("%b='Dec'\t%B='December'\t%h='Dec'\t%m='12'\t%Om='12'\t%d='55'\t%e='55'\t%Od='55'\t%Oe='55'\n"),
fmt,
std::chrono::month_day{std::chrono::December, std::chrono::day{255}});
-#else // defined(_AIX)
+# else // defined(_AIX)
check(SV("%b='Nov'\t%B='November'\t%h='Nov'\t%m='11'\t%Om='11'\t%d='100'\t%e='100'\t%Od='100'\t%Oe='100'\n"),
fmt,
std::chrono::month_day{std::chrono::November, std::chrono::day{100}});
check(SV("%b='Dec'\t%B='December'\t%h='Dec'\t%m='12'\t%Om='12'\t%d='255'\t%e='255'\t%Od='255'\t%Oe='255'\n"),
fmt,
std::chrono::month_day{std::chrono::December, std::chrono::day{255}});
-#endif // defined(_AIX)
+# endif // defined(_AIX)
+#endif // _WIN32
// Use the global locale (fr_FR)
#if defined(__APPLE__)
@@ -196,10 +217,16 @@ static void test_valid_values() {
check(SV("%b='déc'\t%B='décembre'\t%h='déc'\t%m='12'\t%Om='12'\t%d='255'\t%e='255'\t%Od='255'\t%Oe='255'\n"),
lfmt,
std::chrono::month_day{std::chrono::December, std::chrono::day{255}});
-#else // defined(__APPLE__)
+#else // defined(__APPLE__)
+# if defined(_WIN32)
+ check(SV("%b='janv.'\t%B='janvier'\t%h='janv.'\t%m='01'\t%Om='01'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ lfmt,
+ std::chrono::month_day{std::chrono::January, std::chrono::day{0}});
+# else
check(SV("%b='janv.'\t%B='janvier'\t%h='janv.'\t%m='01'\t%Om='01'\t%d='00'\t%e=' 0'\t%Od='00'\t%Oe=' 0'\n"),
lfmt,
std::chrono::month_day{std::chrono::January, std::chrono::day{0}});
+# endif
check(SV("%b='févr.'\t%B='février'\t%h='févr.'\t%m='02'\t%Om='02'\t%d='01'\t%e=' 1'\t%Od='01'\t%Oe=' 1'\n"),
lfmt,
std::chrono::month_day{std::chrono::February, std::chrono::day{1}});
@@ -226,77 +253,92 @@ static void test_valid_values() {
check(SV("%b='août'\t%B='août'\t%h='août'\t%m='08'\t%Om='08'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"),
lfmt,
std::chrono::month_day{std::chrono::August, std::chrono::day{31}});
+# if defined(_WIN32)
+ check(SV("%b='sept.'\t%B='septembre'\t%h='sept.'\t%m='09'\t%Om='09'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ lfmt,
+ std::chrono::month_day{std::chrono::September, std::chrono::day{32}});
+ check(SV("%b='oct.'\t%B='octobre'\t%h='oct.'\t%m='10'\t%Om='10'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ lfmt,
+ std::chrono::month_day{std::chrono::October, std::chrono::day{99}});
+ check(SV("%b='nov.'\t%B='novembre'\t%h='nov.'\t%m='11'\t%Om='11'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ lfmt,
+ std::chrono::month_day{std::chrono::November, std::chrono::day{100}});
+ check(SV("%b='déc.'\t%B='décembre'\t%h='déc.'\t%m='12'\t%Om='12'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ lfmt,
+ std::chrono::month_day{std::chrono::December, std::chrono::day{255}});
+# else // defined(_WIN32)
check(SV("%b='sept.'\t%B='septembre'\t%h='sept.'\t%m='09'\t%Om='09'\t%d='32'\t%e='32'\t%Od='32'\t%Oe='32'\n"),
lfmt,
std::chrono::month_day{std::chrono::September, std::chrono::day{32}});
check(SV("%b='oct.'\t%B='octobre'\t%h='oct.'\t%m='10'\t%Om='10'\t%d='99'\t%e='99'\t%Od='99'\t%Oe='99'\n"),
lfmt,
std::chrono::month_day{std::chrono::October, std::chrono::day{99}});
-# if defined(_AIX)
+# if defined(_AIX)
check(SV("%b='nov.'\t%B='novembre'\t%h='nov.'\t%m='11'\t%Om='11'\t%d='00'\t%e=' 0'\t%Od='00'\t%Oe=' 0'\n"),
lfmt,
std::chrono::month_day{std::chrono::November, std::chrono::day{100}});
check(SV("%b='déc.'\t%B='décembre'\t%h='déc.'\t%m='12'\t%Om='12'\t%d='55'\t%e='55'\t%Od='55'\t%Oe='55'\n"),
lfmt,
std::chrono::month_day{std::chrono::December, std::chrono::day{255}});
-# else // defined(_AIX)
+# else // defined(_AIX)
check(SV("%b='nov.'\t%B='novembre'\t%h='nov.'\t%m='11'\t%Om='11'\t%d='100'\t%e='100'\t%Od='100'\t%Oe='100'\n"),
lfmt,
std::chrono::month_day{std::chrono::November, std::chrono::day{100}});
check(SV("%b='déc.'\t%B='décembre'\t%h='déc.'\t%m='12'\t%Om='12'\t%d='255'\t%e='255'\t%Od='255'\t%Oe='255'\n"),
lfmt,
std::chrono::month_day{std::chrono::December, std::chrono::day{255}});
-# endif // defined(_AIX)
-#endif // defined(__APPLE__)
+# endif // defined(_AIX)
+# endif // defined(_WIN32)
+#endif // defined(__APPLE__)
// Use supplied locale (ja_JP)
#if defined(_WIN32)
check(loc,
- SV("%b='1'\t%B='1月'\t%h='1'\t%m='01'\t%Om='01'\t%d='00'\t%e=' 0'\t%Od='〇'\t%Oe='〇'\n"),
+ SV("%b='1'\t%B='1月'\t%h='1'\t%m='01'\t%Om='01'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
lfmt,
std::chrono::month_day{std::chrono::January, std::chrono::day{0}});
check(loc,
- SV("%b='2'\t%B='2月'\t%h='2'\t%m='02'\t%Om='02'\t%d='01'\t%e=' 1'\t%Od='一'\t%Oe='一'\n"),
+ SV("%b='2'\t%B='2月'\t%h='2'\t%m='02'\t%Om='02'\t%d='01'\t%e=' 1'\t%Od='01'\t%Oe=' 1'\n"),
lfmt,
std::chrono::month_day{std::chrono::February, std::chrono::day{1}});
check(loc,
- SV("%b='3'\t%B='3月'\t%h='3'\t%m='03'\t%Om='03'\t%d='09'\t%e=' 9'\t%Od='九'\t%Oe='九'\n"),
+ SV("%b='3'\t%B='3月'\t%h='3'\t%m='03'\t%Om='03'\t%d='09'\t%e=' 9'\t%Od='09'\t%Oe=' 9'\n"),
lfmt,
std::chrono::month_day{std::chrono::March, std::chrono::day{9}});
check(loc,
- SV("%b='4'\t%B='4月'\t%h='4'\t%m='04'\t%Om='04'\t%d='10'\t%e='10'\t%Od='十'\t%Oe='十'\n"),
+ SV("%b='4'\t%B='4月'\t%h='4'\t%m='04'\t%Om='04'\t%d='10'\t%e='10'\t%Od='10'\t%Oe='10'\n"),
lfmt,
std::chrono::month_day{std::chrono::April, std::chrono::day{10}});
check(loc,
- SV("%b='5'\t%B='5月'\t%h='5'\t%m='05'\t%Om='05'\t%d='28'\t%e='28'\t%Od='二十八'\t%Oe='二十八'\n"),
+ SV("%b='5'\t%B='5月'\t%h='5'\t%m='05'\t%Om='05'\t%d='28'\t%e='28'\t%Od='28'\t%Oe='28'\n"),
lfmt,
std::chrono::month_day{std::chrono::May, std::chrono::day{28}});
check(loc,
- SV("%b='6'\t%B='6月'\t%h='6'\t%m='06'\t%Om='06'\t%d='29'\t%e='29'\t%Od='二十九'\t%Oe='二十九'\n"),
+ SV("%b='6'\t%B='6月'\t%h='6'\t%m='06'\t%Om='06'\t%d='29'\t%e='29'\t%Od='29'\t%Oe='29'\n"),
lfmt,
std::chrono::month_day{std::chrono::June, std::chrono::day{29}});
check(loc,
- SV("%b='7'\t%B='7月'\t%h='7'\t%m='07'\t%Om='07'\t%d='30'\t%e='30'\t%Od='三十'\t%Oe='三十'\n"),
+ SV("%b='7'\t%B='7月'\t%h='7'\t%m='07'\t%Om='07'\t%d='30'\t%e='30'\t%Od='30'\t%Oe='30'\n"),
lfmt,
std::chrono::month_day{std::chrono::July, std::chrono::day{30}});
check(loc,
- SV("%b='8'\t%B='8月'\t%h='8'\t%m='08'\t%Om='08'\t%d='31'\t%e='31'\t%Od='三十一'\t%Oe='三十一'\n"),
+ SV("%b='8'\t%B='8月'\t%h='8'\t%m='08'\t%Om='08'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"),
lfmt,
std::chrono::month_day{std::chrono::August, std::chrono::day{31}});
check(loc,
- SV("%b='9'\t%B='9月'\t%h='9'\t%m='09'\t%Om='09'\t%d='32'\t%e='32'\t%Od='三十二'\t%Oe='三十二'\n"),
+ SV("%b='9'\t%B='9月'\t%h='9'\t%m='09'\t%Om='09'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
lfmt,
std::chrono::month_day{std::chrono::September, std::chrono::day{32}});
check(loc,
- SV("%b='10'\t%B='10月'\t%h='10'\t%m='10'\t%Om='10'\t%d='99'\t%e='99'\t%Od='九十九'\t%Oe='九十九'\n"),
+ SV("%b='10'\t%B='10月'\t%h='10'\t%m='10'\t%Om='10'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
lfmt,
std::chrono::month_day{std::chrono::October, std::chrono::day{99}});
check(loc,
- SV("%b='11'\t%B='11月'\t%h='11'\t%m='11'\t%Om='11'\t%d='100'\t%e='100'\t%Od='100'\t%Oe='100'\n"),
+ SV("%b='11'\t%B='11月'\t%h='11'\t%m='11'\t%Om='11'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
lfmt,
std::chrono::month_day{std::chrono::November, std::chrono::day{100}});
check(loc,
- SV("%b='12'\t%B='12月'\t%h='12'\t%m='12'\t%Om='12'\t%d='255'\t%e='255'\t%Od='255'\t%Oe='255'\n"),
+ SV("%b='12'\t%B='12月'\t%h='12'\t%m='12'\t%Om='12'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
lfmt,
std::chrono::month_day{std::chrono::December, std::chrono::day{255}});
#elif defined(_AIX) // defined(_WIN32)
diff --git a/libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp b/libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp
index 39a55d8c2970df..782facd2f2c4f7 100644
--- a/libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp
@@ -14,9 +14,6 @@
// TODO FMT This test should not require std::to_chars(floating-point)
// XFAIL: availability-fp_to_chars-missing
-// TODO FMT Investigate Windows issues.
-// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
-
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
@@ -240,7 +237,7 @@ static void test_valid_values_day() {
lfmt,
std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
-#endif // _WIN32
+#endif // _WIN32
std::locale::global(std::locale::classic());
}
@@ -651,8 +648,8 @@ static void test_valid_values_time() {
std::chrono::sys_time<std::chrono::milliseconds>(
1'234'567'890'123ms)); // 23:31:30 UTC on Friday, 13 February 2009
- // Use supplied locale (ja_JP). This locale has a
diff erent alternate.a
-#if defined(__APPLE__) || defined(_AIX)
+ // Use supplied locale (ja_JP). This locale has a
diff erent alternate.
+#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(loc,
SV("%H='00'\t"
"%OH='00'\t"
@@ -673,6 +670,10 @@ static void test_valid_values_time() {
"%r='12:00:00 AM'\t"
"%X='00時00分00秒'\t"
"%EX='00時00分00秒'\t"
+# elif defined(_WIN32)
+ "%r='0:00:00'\t"
+ "%X='0:00:00'\t"
+ "%EX='0:00:00'\t"
# else
"%r='午前12:00:00'\t"
"%X='00:00:00'\t"
@@ -702,6 +703,10 @@ static void test_valid_values_time() {
"%r='11:31:30 PM'\t"
"%X='23時31分30秒'\t"
"%EX='23時31分30秒'\t"
+# elif defined(_WIN32)
+ "%r='23:31:30'\t"
+ "%X='23:31:30'\t"
+ "%EX='23:31:30'\t"
# else
"%r='午後11:31:30'\t"
"%X='23:31:30'\t"
@@ -710,7 +715,7 @@ static void test_valid_values_time() {
"\n"),
lfmt,
std::chrono::hh_mm_ss(23h + 31min + 30s + 123ms));
-#else // defined(__APPLE__) || defined(_AIX)
+#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
check(loc,
SV("%H='00'\t"
"%OH='〇'\t"
@@ -749,7 +754,7 @@ static void test_valid_values_time() {
lfmt,
std::chrono::sys_time<std::chrono::milliseconds>(
1'234'567'890'123ms)); // 23:31:30 UTC on Friday, 13 February 2009
-#endif // defined(__APPLE__) || defined(_AIX)
+#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
std::locale::global(std::locale::classic());
}
@@ -782,6 +787,8 @@ static void test_valid_values_date_time() {
SV("%c=' 1 janvier 1970 à 00:00:00 UTC'\t%Ec=' 1 janvier 1970 à 00:00:00 UTC'\n"),
#elif defined(__APPLE__)
SV("%c='Jeu 1 jan 00:00:00 1970'\t%Ec='Jeu 1 jan 00:00:00 1970'\n"),
+#elif defined(_WIN32)
+ SV("%c='01/01/1970 00:00:00'\t%Ec='01/01/1970 00:00:00'\n"),
#else
SV("%c='jeu. 01 janv. 1970 00:00:00'\t%Ec='jeu. 01 janv. 1970 00:00:00'\n"),
#endif
@@ -796,6 +803,8 @@ static void test_valid_values_date_time() {
SV("%c='13 février 2009 à 23:31:30 UTC'\t%Ec='13 février 2009 à 23:31:30 UTC'\n"),
#elif defined(__APPLE__)
SV("%c='Ven 13 fév 23:31:30 2009'\t%Ec='Ven 13 fév 23:31:30 2009'\n"),
+#elif defined(_WIN32)
+ SV("%c='13/02/2009 23:31:30'\t%Ec='13/02/2009 23:31:30'\n"),
#else
SV("%c='ven. 13 févr. 2009 23:31:30'\t%Ec='ven. 13 févr. 2009 23:31:30'\n"),
#endif
@@ -821,6 +830,15 @@ static void test_valid_values_date_time() {
SV("%c='2009年02月13日 23:31:30 UTC'\t%Ec='2009年02月13日 23:31:30 UTC'\n"),
lfmt,
std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
+#elif defined(_WIN32) // __APPLE__
+ check(loc,
+ SV("%c='1970/01/01 0:00:00'\t%Ec='1970/01/01 0:00:00'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+ check(loc,
+ SV("%c='2009/02/13 23:31:30'\t%Ec='2009/02/13 23:31:30'\n"),
+ lfmt,
+ std::chrono::sys_seconds(1'234'567'890s)); // 23:31:30 UTC on Friday, 13 February 2009
#else // __APPLE__
check(loc,
SV("%c='1970年01月01日 00時00分00秒'\t%Ec='昭和45年01月01日 00時00分00秒'\n"),
@@ -866,6 +884,22 @@ static void test_valid_values_time_zone() {
SV("%z='UTC'\t%Ez='UTC'\t%Oz='UTC'\t%Z='UTC'\n"),
lfmt,
std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+# elif defined(_WIN32) // defined(_AIX)
+ // Non localized output using C-locale
+ check(SV("%z='-0000'\t%Ez='-0000'\t%Oz='-0000'\t%Z='UTC'\n"),
+ fmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ // Use the global locale (fr_FR)
+ check(SV("%z='-0000'\t%Ez='-0000'\t%Oz='-0000'\t%Z='UTC'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
+
+ // Use supplied locale (ja_JP). This locale has a
diff erent alternate.a
+ check(loc,
+ SV("%z='-0000'\t%Ez='-0000'\t%Oz='-0000'\t%Z='UTC'\n"),
+ lfmt,
+ std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
# else // defined(_AIX)
// Non localized output using C-locale
check(SV("%z='+0000'\t%Ez='+0000'\t%Oz='+0000'\t%Z='UTC'\n"),
@@ -884,7 +918,7 @@ static void test_valid_values_time_zone() {
std::chrono::sys_seconds(0s)); // 00:00:00 UTC Thursday, 1 January 1970
# endif // defined(_AIX)
std::locale::global(std::locale::classic());
-#endif // !defined(__APPLE__)
+#endif // !defined(__APPLE__)
}
template <class CharT>
diff --git a/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp b/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp
index 3b8faa41b4d9a3..a8571d542623f2 100644
--- a/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.weekday.pass.cpp
@@ -11,12 +11,12 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
-// TODO FMT Investigate Windows issues.
-// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
-
// TODO FMT This test should not require std::to_chars(floating-point)
// XFAIL: availability-fp_to_chars-missing
+// TODO FMT Investigate Windows issues.
+// XFAIL: msvc
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
@@ -142,7 +142,7 @@ static void test_invalid_values() {
// Use supplied locale (ja_JP). This locale has a
diff erent alternate.
check(loc, SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), lfmt, std::chrono::weekday(8));
check(loc, SV("%u='255'\t%Ou='255'\t%w='255'\t%Ow='255'\n"), lfmt, std::chrono::weekday(255));
-#elif defined(_AIX)
+#elif defined(_AIX) // defined(__APPLE__)
// Non localized output using C-locale
check(SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday(8));
check(SV("%u='5'\t%Ou='5'\t%w='5'\t%Ow='5'\n"), fmt, std::chrono::weekday(255));
@@ -154,7 +154,19 @@ static void test_invalid_values() {
// Use supplied locale (ja_JP). This locale has a
diff erent alternate.
check(loc, SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), lfmt, std::chrono::weekday(8));
check(loc, SV("%u='5'\t%Ou='5'\t%w='5'\t%Ow='5'\n"), lfmt, std::chrono::weekday(255));
-#else
+#elif defined(_WIN32) // defined(__APPLE__)
+ // Non localized output using C-locale
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), fmt, std::chrono::weekday(8));
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), fmt, std::chrono::weekday(255));
+
+ // Use the global locale (fr_FR)
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday(8));
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday(255));
+
+ // Use supplied locale (ja_JP). This locale has a
diff erent alternate.
+ check(loc, SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday(8));
+ check(loc, SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday(255));
+#else // defined(__APPLE__)
// Non localized output using C-locale
check(SV("%u='1'\t%Ou='1'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday(8));
check(SV("%u='3'\t%Ou='3'\t%w='255'\t%Ow='255'\n"), fmt, std::chrono::weekday(255));
@@ -166,8 +178,7 @@ static void test_invalid_values() {
// Use supplied locale (ja_JP). This locale has a
diff erent alternate.
check(loc, SV("%u='1'\t%Ou='一'\t%w='8'\t%Ow='八'\n"), lfmt, std::chrono::weekday(8));
check(loc, SV("%u='3'\t%Ou='三'\t%w='255'\t%Ow='255'\n"), lfmt, std::chrono::weekday(255));
-
-#endif
+#endif // defined(__APPLE__)
std::locale::global(std::locale::classic());
}
diff --git a/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp b/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp
index 76a48694f2c38e..2c014e86c7d97f 100644
--- a/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.weekday_index.pass.cpp
@@ -11,12 +11,12 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
-// TODO FMT Investigate Windows issues.
-// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
-
// TODO FMT This test should not require std::to_chars(floating-point)
// XFAIL: availability-fp_to_chars-missing
+// TODO FMT Investigate Windows issues.
+// XFAIL: msvc
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
@@ -284,6 +284,24 @@ static void test_invalid_values() {
SV("%u='255'\t%Ou='255'\t%w='255'\t%Ow='255'\n"),
lfmt,
std::chrono::weekday_indexed{std::chrono::weekday(255), 1});
+#elif defined(_WIN32) // defined(__APPLE__)
+ // Non localized output using C-locale
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), fmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 0});
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), fmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 1});
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), fmt, std::chrono::weekday_indexed{std::chrono::weekday(255), 0});
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), fmt, std::chrono::weekday_indexed{std::chrono::weekday(255), 1});
+
+ // Use the global locale (fr_FR)
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 0});
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 1});
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(255), 0});
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(255), 1});
+
+ // Use supplied locale (ja_JP). This locale has a
diff erent alternate.
+ check(loc, SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 0});
+ check(loc, SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 1});
+ check(loc, SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(255), 0});
+ check(loc, SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_indexed{std::chrono::weekday(255), 1});
#elif defined(_AIX) // defined(__APPLE__)
// Non localized output using C-locale
check(SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday_indexed{std::chrono::weekday(8), 0});
diff --git a/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp b/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp
index 68cfb4f3734a49..1790e132c43f05 100644
--- a/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.weekday_last.pass.cpp
@@ -11,12 +11,12 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
-// TODO FMT Investigate Windows issues.
-// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
-
// TODO FMT This test should not require std::to_chars(floating-point)
// XFAIL: availability-fp_to_chars-missing
+// TODO FMT Investigate Windows issues.
+// XFAIL: msvc
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
@@ -248,6 +248,18 @@ static void test_invalid_values() {
SV("%u='255'\t%Ou='255'\t%w='255'\t%Ow='255'\n"),
lfmt,
std::chrono::weekday_last{std::chrono::weekday(255)});
+#elif defined(_WIN32) // defined(__APPLE__)
+ // Non localized output using C-locale
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), fmt, std::chrono::weekday_last{std::chrono::weekday(8)});
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), fmt, std::chrono::weekday_last{std::chrono::weekday(255)});
+
+ // Use the global locale (fr_FR)
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_last{std::chrono::weekday(8)});
+ check(SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_last{std::chrono::weekday(255)});
+
+ // Use supplied locale (ja_JP). This locale has a
diff erent alternate.
+ check(loc, SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_last{std::chrono::weekday(8)});
+ check(loc, SV("%u=''\t%Ou=''\t%w=''\t%Ow=''\n"), lfmt, std::chrono::weekday_last{std::chrono::weekday(255)});
#elif defined(_AIX) // defined(__APPLE__)
// Non localized output using C-locale
check(SV("%u='8'\t%Ou='8'\t%w='8'\t%Ow='8'\n"), fmt, std::chrono::weekday_last{std::chrono::weekday(8)});
diff --git a/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp b/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp
index dfedcdf01105e6..7f86e81d8586b6 100644
--- a/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp
+++ b/libcxx/test/std/time/time.syn/formatter.year_month_day.pass.cpp
@@ -11,12 +11,12 @@
// UNSUPPORTED: no-localization
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
-// TODO FMT Investigate Windows issues.
-// UNSUPPORTED: msvc, target={{.+}}-windows-gnu
-
// TODO FMT This test should not require std::to_chars(floating-point)
// XFAIL: availability-fp_to_chars-missing
+// TODO FMT Investigate Windows issues.
+// XFAIL: msvc
+
// REQUIRES: locale.fr_FR.UTF-8
// REQUIRES: locale.ja_JP.UTF-8
@@ -64,6 +64,17 @@ static void test_no_chrono_specs() {
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{2}, std::chrono::day{31}});
// Valid year, invalid month, valid day
+#ifdef _WIN32
+ check(SV(" is not a valid date"),
+ SV("{}"),
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
+ check(SV("****** is not a valid date******"),
+ SV("{:*^32}"),
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
+ check(SV("*********** is not a valid date"),
+ SV("{:*>31}"),
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
+#else // _WIN32
check(SV("1970-00-31 is not a valid date"),
SV("{}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
@@ -73,8 +84,20 @@ static void test_no_chrono_specs() {
check(SV("*1970-00-31 is not a valid date"),
SV("{:*>31}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{31}});
+#endif // _WIN32
// Valid year, invalid month, invalid day
+#ifdef _WIN32
+ check(SV(" is not a valid date"),
+ SV("{}"),
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{32}});
+ check(SV("****** is not a valid date******"),
+ SV("{:*^32}"),
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{32}});
+ check(SV("*********** is not a valid date"),
+ SV("{:*>31}"),
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{32}});
+#else // _WIN32
check(SV("1970-00-32 is not a valid date"),
SV("{}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{32}});
@@ -84,6 +107,7 @@ static void test_no_chrono_specs() {
check(SV("*1970-00-32 is not a valid date"),
SV("{:*>31}"),
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::month{0}, std::chrono::day{32}});
+#endif // _WIN32
// Invalid year, valid month, valid day
check(SV("-32768-01-31 is not a valid date"),
@@ -397,9 +421,15 @@ static void test_valid_md_values() {
std::locale::global(std::locale(LOCALE_fr_FR_UTF_8));
// Non localized output using C-locale
+#ifdef _WIN32
+ check(SV("%b='Jan'\t%B='January'\t%h='Jan'\t%m='01'\t%Om='01'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ fmt,
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::January, std::chrono::day{0}});
+#else
check(SV("%b='Jan'\t%B='January'\t%h='Jan'\t%m='01'\t%Om='01'\t%d='00'\t%e=' 0'\t%Od='00'\t%Oe=' 0'\n"),
fmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::January, std::chrono::day{0}});
+#endif
check(SV("%b='Feb'\t%B='February'\t%h='Feb'\t%m='02'\t%Om='02'\t%d='01'\t%e=' 1'\t%Od='01'\t%Oe=' 1'\n"),
fmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::February, std::chrono::day{1}});
@@ -421,27 +451,42 @@ static void test_valid_md_values() {
check(SV("%b='Aug'\t%B='August'\t%h='Aug'\t%m='08'\t%Om='08'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"),
fmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::August, std::chrono::day{31}});
+#ifdef _WIN32
+ check(SV("%b='Sep'\t%B='September'\t%h='Sep'\t%m='09'\t%Om='09'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ fmt,
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::September, std::chrono::day{32}});
+ check(SV("%b='Oct'\t%B='October'\t%h='Oct'\t%m='10'\t%Om='10'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ fmt,
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::October, std::chrono::day{99}});
+ check(SV("%b='Nov'\t%B='November'\t%h='Nov'\t%m='11'\t%Om='11'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ fmt,
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::November, std::chrono::day{100}});
+ check(SV("%b='Dec'\t%B='December'\t%h='Dec'\t%m='12'\t%Om='12'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ fmt,
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::December, std::chrono::day{255}});
+#else // _WIN32
check(SV("%b='Sep'\t%B='September'\t%h='Sep'\t%m='09'\t%Om='09'\t%d='32'\t%e='32'\t%Od='32'\t%Oe='32'\n"),
fmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::September, std::chrono::day{32}});
check(SV("%b='Oct'\t%B='October'\t%h='Oct'\t%m='10'\t%Om='10'\t%d='99'\t%e='99'\t%Od='99'\t%Oe='99'\n"),
fmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::October, std::chrono::day{99}});
-#if defined(_AIX)
+# if defined(_AIX)
check(SV("%b='Nov'\t%B='November'\t%h='Nov'\t%m='11'\t%Om='11'\t%d='00'\t%e=' 0'\t%Od='00'\t%Oe=' 0'\n"),
fmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::November, std::chrono::day{100}});
check(SV("%b='Dec'\t%B='December'\t%h='Dec'\t%m='12'\t%Om='12'\t%d='55'\t%e='55'\t%Od='55'\t%Oe='55'\n"),
fmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::December, std::chrono::day{255}});
-#else // defined(_AIX)
+# else // defined(_AIX)
check(SV("%b='Nov'\t%B='November'\t%h='Nov'\t%m='11'\t%Om='11'\t%d='100'\t%e='100'\t%Od='100'\t%Oe='100'\n"),
fmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::November, std::chrono::day{100}});
check(SV("%b='Dec'\t%B='December'\t%h='Dec'\t%m='12'\t%Om='12'\t%d='255'\t%e='255'\t%Od='255'\t%Oe='255'\n"),
fmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::December, std::chrono::day{255}});
-#endif // defined(_AIX)
+# endif // defined(_AIX)
+#endif // _WIN32
// Use the global locale (fr_FR)
#if defined(__APPLE__)
@@ -481,10 +526,16 @@ static void test_valid_md_values() {
check(SV("%b='déc'\t%B='décembre'\t%h='déc'\t%m='12'\t%Om='12'\t%d='255'\t%e='255'\t%Od='255'\t%Oe='255'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::December, std::chrono::day{255}});
-#else // defined(__APPLE__)
+#else // defined(__APPLE__)
+# ifdef _WIN32
+ check(SV("%b='janv.'\t%B='janvier'\t%h='janv.'\t%m='01'\t%Om='01'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ lfmt,
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::January, std::chrono::day{0}});
+# else
check(SV("%b='janv.'\t%B='janvier'\t%h='janv.'\t%m='01'\t%Om='01'\t%d='00'\t%e=' 0'\t%Od='00'\t%Oe=' 0'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::January, std::chrono::day{0}});
+# endif
check(SV("%b='févr.'\t%B='février'\t%h='févr.'\t%m='02'\t%Om='02'\t%d='01'\t%e=' 1'\t%Od='01'\t%Oe=' 1'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::February, std::chrono::day{1}});
@@ -511,77 +562,92 @@ static void test_valid_md_values() {
check(SV("%b='août'\t%B='août'\t%h='août'\t%m='08'\t%Om='08'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::August, std::chrono::day{31}});
+# ifdef _WIN32
+ check(SV("%b='sept.'\t%B='septembre'\t%h='sept.'\t%m='09'\t%Om='09'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ lfmt,
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::September, std::chrono::day{32}});
+ check(SV("%b='oct.'\t%B='octobre'\t%h='oct.'\t%m='10'\t%Om='10'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ lfmt,
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::October, std::chrono::day{99}});
+ check(SV("%b='nov.'\t%B='novembre'\t%h='nov.'\t%m='11'\t%Om='11'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ lfmt,
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::November, std::chrono::day{100}});
+ check(SV("%b='déc.'\t%B='décembre'\t%h='déc.'\t%m='12'\t%Om='12'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
+ lfmt,
+ std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::December, std::chrono::day{255}});
+# else // _WIN32
check(SV("%b='sept.'\t%B='septembre'\t%h='sept.'\t%m='09'\t%Om='09'\t%d='32'\t%e='32'\t%Od='32'\t%Oe='32'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::September, std::chrono::day{32}});
check(SV("%b='oct.'\t%B='octobre'\t%h='oct.'\t%m='10'\t%Om='10'\t%d='99'\t%e='99'\t%Od='99'\t%Oe='99'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::October, std::chrono::day{99}});
-# if defined(_AIX)
+# if defined(_AIX)
check(SV("%b='nov.'\t%B='novembre'\t%h='nov.'\t%m='11'\t%Om='11'\t%d='00'\t%e=' 0'\t%Od='00'\t%Oe=' 0'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::November, std::chrono::day{100}});
check(SV("%b='déc.'\t%B='décembre'\t%h='déc.'\t%m='12'\t%Om='12'\t%d='55'\t%e='55'\t%Od='55'\t%Oe='55'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::December, std::chrono::day{255}});
-# else // defined(_AIX)
+# else // defined(_AIX)
check(SV("%b='nov.'\t%B='novembre'\t%h='nov.'\t%m='11'\t%Om='11'\t%d='100'\t%e='100'\t%Od='100'\t%Oe='100'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::November, std::chrono::day{100}});
check(SV("%b='déc.'\t%B='décembre'\t%h='déc.'\t%m='12'\t%Om='12'\t%d='255'\t%e='255'\t%Od='255'\t%Oe='255'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::December, std::chrono::day{255}});
-# endif // defined(_AIX)
-#endif // defined(__APPLE__)
+# endif // defined(_AIX)
+# endif // _WIN32
+#endif // defined(__APPLE__)
// Use supplied locale (ja_JP)
#if defined(_WIN32)
check(loc,
- SV("%b='1'\t%B='1月'\t%h='1'\t%m='01'\t%Om='01'\t%d='00'\t%e=' 0'\t%Od='〇'\t%Oe='〇'\n"),
+ SV("%b='1'\t%B='1月'\t%h='1'\t%m='01'\t%Om='01'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::January, std::chrono::day{0}});
check(loc,
- SV("%b='2'\t%B='2月'\t%h='2'\t%m='02'\t%Om='02'\t%d='01'\t%e=' 1'\t%Od='一'\t%Oe='一'\n"),
+ SV("%b='2'\t%B='2月'\t%h='2'\t%m='02'\t%Om='02'\t%d='01'\t%e=' 1'\t%Od='01'\t%Oe=' 1'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::February, std::chrono::day{1}});
check(loc,
- SV("%b='3'\t%B='3月'\t%h='3'\t%m='03'\t%Om='03'\t%d='09'\t%e=' 9'\t%Od='九'\t%Oe='九'\n"),
+ SV("%b='3'\t%B='3月'\t%h='3'\t%m='03'\t%Om='03'\t%d='09'\t%e=' 9'\t%Od='09'\t%Oe=' 9'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::March, std::chrono::day{9}});
check(loc,
- SV("%b='4'\t%B='4月'\t%h='4'\t%m='04'\t%Om='04'\t%d='10'\t%e='10'\t%Od='十'\t%Oe='十'\n"),
+ SV("%b='4'\t%B='4月'\t%h='4'\t%m='04'\t%Om='04'\t%d='10'\t%e='10'\t%Od='10'\t%Oe='10'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::April, std::chrono::day{10}});
check(loc,
- SV("%b='5'\t%B='5月'\t%h='5'\t%m='05'\t%Om='05'\t%d='28'\t%e='28'\t%Od='二十八'\t%Oe='二十八'\n"),
+ SV("%b='5'\t%B='5月'\t%h='5'\t%m='05'\t%Om='05'\t%d='28'\t%e='28'\t%Od='28'\t%Oe='28'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::May, std::chrono::day{28}});
check(loc,
- SV("%b='6'\t%B='6月'\t%h='6'\t%m='06'\t%Om='06'\t%d='29'\t%e='29'\t%Od='二十九'\t%Oe='二十九'\n"),
+ SV("%b='6'\t%B='6月'\t%h='6'\t%m='06'\t%Om='06'\t%d='29'\t%e='29'\t%Od='29'\t%Oe='29'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::June, std::chrono::day{29}});
check(loc,
- SV("%b='7'\t%B='7月'\t%h='7'\t%m='07'\t%Om='07'\t%d='30'\t%e='30'\t%Od='三十'\t%Oe='三十'\n"),
+ SV("%b='7'\t%B='7月'\t%h='7'\t%m='07'\t%Om='07'\t%d='30'\t%e='30'\t%Od='30'\t%Oe='30'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::July, std::chrono::day{30}});
check(loc,
- SV("%b='8'\t%B='8月'\t%h='8'\t%m='08'\t%Om='08'\t%d='31'\t%e='31'\t%Od='三十一'\t%Oe='三十一'\n"),
+ SV("%b='8'\t%B='8月'\t%h='8'\t%m='08'\t%Om='08'\t%d='31'\t%e='31'\t%Od='31'\t%Oe='31'\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::August, std::chrono::day{31}});
check(loc,
- SV("%b='9'\t%B='9月'\t%h='9'\t%m='09'\t%Om='09'\t%d='32'\t%e='32'\t%Od='三十二'\t%Oe='三十二'\n"),
+ SV("%b='9'\t%B='9月'\t%h='9'\t%m='09'\t%Om='09'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::September, std::chrono::day{32}});
check(loc,
- SV("%b='10'\t%B='10月'\t%h='10'\t%m='10'\t%Om='10'\t%d='99'\t%e='99'\t%Od='九十九'\t%Oe='九十九'\n"),
+ SV("%b='10'\t%B='10月'\t%h='10'\t%m='10'\t%Om='10'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::October, std::chrono::day{99}});
check(loc,
- SV("%b='11'\t%B='11月'\t%h='11'\t%m='11'\t%Om='11'\t%d='100'\t%e='100'\t%Od='100'\t%Oe='100'\n"),
+ SV("%b='11'\t%B='11月'\t%h='11'\t%m='11'\t%Om='11'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::November, std::chrono::day{100}});
check(loc,
- SV("%b='12'\t%B='12月'\t%h='12'\t%m='12'\t%Om='12'\t%d='255'\t%e='255'\t%Od='255'\t%Oe='255'\n"),
+ SV("%b='12'\t%B='12月'\t%h='12'\t%m='12'\t%Om='12'\t%d=''\t%e=''\t%Od=''\t%Oe=''\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::December, std::chrono::day{255}});
#elif defined(_AIX) // defined(_WIN32)
@@ -945,14 +1011,14 @@ static void test_valid_ymd_values() {
"%V='01'\t"
"%w='4'\t"
"%W='00'\t"
-#if defined(__APPLE__) || defined(_AIX)
+#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
"%x='1970/01/01'\t"
-#else // defined(__APPLE__) || defined(_AIX)
+#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
"%x='1970年01月01日'\t"
-#endif // defined(__APPLE__) || defined(_AIX)
+#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
"%y='70'\t"
"%Y='1970'\t"
-#if defined(__APPLE__) || defined(_AIX)
+#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
"%Ex='1970/01/01'\t"
"%EC='19'\t"
"%Ey='70'\t"
@@ -963,7 +1029,7 @@ static void test_valid_ymd_values() {
"%Ow='4'\t"
"%OW='00'\t"
"%Oy='70'\t"
-#else // defined(__APPLE__) || defined(_AIX)
+#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
"%Ex='昭和45年01月01日'\t"
"%EC='昭和'\t"
"%Ey='45'\t"
@@ -974,7 +1040,7 @@ static void test_valid_ymd_values() {
"%Ow='四'\t"
"%OW='〇'\t"
"%Oy='七十'\t"
-#endif // defined(__APPLE__) || defined(_AIX)
+#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
"\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{1970}, std::chrono::January, std::chrono::day{1}});
@@ -992,14 +1058,14 @@ static void test_valid_ymd_values() {
"%V='22'\t"
"%w='6'\t"
"%W='21'\t"
-#if defined(__APPLE__) || defined(_AIX)
+#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
"%x='2004/05/29'\t"
-#else // defined(__APPLE__) || defined(_AIX)
+#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
"%x='2004年05月29日'\t"
-#endif // defined(__APPLE__) || defined(_AIX)
+#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
"%y='04'\t"
"%Y='2004'\t"
-#if defined(__APPLE__) || defined(_AIX)
+#if defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
"%Ex='2004/05/29'\t"
"%EC='20'\t"
"%Ey='04'\t"
@@ -1010,7 +1076,7 @@ static void test_valid_ymd_values() {
"%Ow='6'\t"
"%OW='21'\t"
"%Oy='04'\t"
-#else // defined(__APPLE__) || defined(_AIX)
+#else // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
"%Ex='平成16年05月29日'\t"
"%EC='平成'\t"
"%Ey='16'\t"
@@ -1021,7 +1087,7 @@ static void test_valid_ymd_values() {
"%Ow='六'\t"
"%OW='二十一'\t"
"%Oy='四'\t"
-#endif // defined(__APPLE__) || defined(_AIX)
+#endif // defined(__APPLE__) || defined(_AIX) || defined(_WIN32)
"\n"),
lfmt,
std::chrono::year_month_day{std::chrono::year{2004}, std::chrono::May, std::chrono::day{29}});
More information about the libcxx-commits
mailing list