[PATCH] D155182: [libcxx] [test] Skip timezone formatting tests on Windows

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 23:54:22 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG3277aaae6fec: [libcxx] [test] Skip timezone formatting tests on Windows (authored by mstorsjo).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155182

Files:
  libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp
  libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp


Index: libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp
===================================================================
--- libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp
+++ libcxx/test/std/time/time.syn/formatter.sys_time.pass.cpp
@@ -859,7 +859,9 @@
 // The Apple CI gives %z='-0700'	%Ez='-0700'	%Oz='-0700'	%Z='UTC'
 // -0700 looks like the local time where the CI happens to recide, therefore
 // omit this test on Apple.
-#if !defined(__APPLE__)
+// The Windows CI gives %z='-0000', but on local machines set to a different
+// timezone, it gives e.g. %z='+0200'.
+#if !defined(__APPLE__) && !defined(_WIN32)
   using namespace std::literals::chrono_literals;
 
   constexpr std::basic_string_view<CharT> fmt  = SV("{:%%z='%z'%t%%Ez='%Ez'%t%%Oz='%Oz'%t%%Z='%Z'%n}");
@@ -884,22 +886,6 @@
         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 different 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"),
@@ -918,7 +904,7 @@
         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__) && !defined(_WIN32)
 }
 
 template <class CharT>
Index: libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp
===================================================================
--- libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp
+++ libcxx/test/std/time/time.syn/formatter.file_time.pass.cpp
@@ -861,7 +861,9 @@
 // The Apple CI gives %z='-0700'	%Ez='-0700'	%Oz='-0700'	%Z='UTC'
 // -0700 looks like the local time where the CI happens to recide, therefore
 // omit this test on Apple.
-#if !defined(__APPLE__)
+// The Windows CI gives %z='-0000', but on local machines set to a different
+// timezone, it gives e.g. %z='+0200'.
+#if !defined(__APPLE__) && !defined(_WIN32)
   using namespace std::literals::chrono_literals;
 
   constexpr std::basic_string_view<CharT> fmt  = SV("{:%%z='%z'%t%%Ez='%Ez'%t%%Oz='%Oz'%t%%Z='%Z'%n}");
@@ -886,22 +888,6 @@
         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 different 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"),
@@ -920,7 +906,7 @@
         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__) && !defined(_WIN32)
 }
 
 template <class CharT>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155182.540289.patch
Type: text/x-patch
Size: 4235 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230714/2c29ce5f/attachment.bin>


More information about the llvm-commits mailing list