about summary refs log tree commit diff
path: root/absl/time/format_test.cc
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2017-09-25T22·35-0700
committerkatzdm <katzdm@google.com>2017-09-25T22·36-0400
commit2a62fbdedf64673f7c858bc6487bd15bcd2ca180 (patch)
treef77d635ce2247cca963fcb35e8816a1787f0f7eb /absl/time/format_test.cc
parentcf6ab6bb2b800fae859ccc735f398d22a7336a00 (diff)
Changes imported from Abseil "staging" branch:
  - 76fcc6eebc6a5b5a885f04e1579762573c2bf9bc Fix broken links, and remove old README files from Git. by Daniel Katz <katzdm@google.com>
  - 174287df7bc7c1832fe4a66d82ee0f61a8788460 Remove "test_dependencies.bzl" file. Not needed. by Daniel Katz <katzdm@google.com>
  - 4e9416b389e61f5258c3a7fc0f7966f03d9ae086 Fix broken about/intro link in README.md by Abseil Team <absl-team@google.com>
  - 2a662ff187987246cf8f3c1de83eaa23f1d2c034 Delete extraneous comments. by Abseil Team <absl-team@google.com>
  - 3bdc2d15af21e0297ccf39c90c0ed51a35900679 Cleanup usage of GUNIT_DEPS_SELECTOR/GUNIT_MAIN_DEPS_SELE... by Gennadiy Rozental <rogeeff@google.com>
  - bec32fc8efee3ae5b67c07dcae08d74540c944d0 Enable time_test on windows: by Xiaoyi Zhang <zhangxy@google.com>

GitOrigin-RevId: 76fcc6eebc6a5b5a885f04e1579762573c2bf9bc
Change-Id: I9556164f6b48dae1fa02b2ec6444517faed23e1f
Diffstat (limited to 'absl/time/format_test.cc')
-rw-r--r--absl/time/format_test.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/absl/time/format_test.cc b/absl/time/format_test.cc
index b139ff6f1b99..09d1fe66667d 100644
--- a/absl/time/format_test.cc
+++ b/absl/time/format_test.cc
@@ -392,6 +392,11 @@ TEST(FormatParse, RoundTrip) {
     EXPECT_EQ(in, out);  // RFC1123_full includes %z
   }
 
+  // `absl::FormatTime()` falls back to strftime() for "%c", which appears to
+  // work. On Windows, `absl::ParseTime()` falls back to std::get_time() which
+  // appears to fail on "%c" (or at least on the "%c" text produced by
+  // `strftime()`). This makes it fail the round-trip test.
+#ifndef _MSC_VER
   // Even though we don't know what %c will produce, it should roundtrip,
   // but only in the 0-offset timezone.
   {
@@ -400,6 +405,7 @@ TEST(FormatParse, RoundTrip) {
     EXPECT_TRUE(absl::ParseTime("%c", s, &out, &err)) << s << ": " << err;
     EXPECT_EQ(in, out);
   }
+#endif  // _MSC_VER
 }
 
 TEST(FormatParse, RoundTripDistantFuture) {