aboutsummaryrefslogtreecommitdiff
path: root/tests/timestamp
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-06-29 21:17:43 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-07-01 16:01:31 +0300
commitbac02200267495741e85db90607186ce4e0593b3 (patch)
treed01cd65d0019a7be916c3c8a5d9f4780f91afdb1 /tests/timestamp
parente0b126d8c7f691856ec4d80bb57cb1ba5c71fd69 (diff)
Port to MSVC
Diffstat (limited to 'tests/timestamp')
-rw-r--r--tests/timestamp/driver.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/timestamp/driver.cxx b/tests/timestamp/driver.cxx
index f5f30b9..e732629 100644
--- a/tests/timestamp/driver.cxx
+++ b/tests/timestamp/driver.cxx
@@ -108,7 +108,17 @@ main ()
// Invalid input (%[] unrelated).
//
assert (fail ("Apr 08 19:31:10.123456789 ABC", "%b %d %H:%M:%S%[.N] %Y"));
+
+// This doesn't work in VC 19 because their implementation of std::get_time()
+// has a bug. Due to this bug std::get_time() parses the input
+// "Apr 19:31:10 2016" for the format "%b %d %H:%M:%S %Y" as if the input were
+// "Apr 19 00:31:10 2016".
+//
+#if !defined(_MSC_VER) || _MSC_VER > 1900
assert (fail ("Apr 19:31:10 2016", "%b %d %H:%M:%S %Y"));
+ assert (fail (":31 2016", "%H:%M %Y"));
+#endif
+
assert (fail ("Opr 08 19:31:10 2016", "%b %d %H:%M:%S %Y"));
// Parse valid input with a valid format.