summaryrefslogtreecommitdiff
path: root/time/tst-y2039.c
diff options
context:
space:
mode:
Diffstat (limited to 'time/tst-y2039.c')
-rw-r--r--time/tst-y2039.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/time/tst-y2039.c b/time/tst-y2039.c
index ef024c0a77..66a22d4c2c 100644
--- a/time/tst-y2039.c
+++ b/time/tst-y2039.c
@@ -37,6 +37,16 @@ do_test (void)
> 0);
puts (buf);
TEST_VERIFY (strcmp (buf, "2039-04-30 14:00:00 PDT") == 0);
+
+ /* Same as before but for localtime_r. */
+ struct tm tmd;
+ tm = localtime_r (&ouch, &tmd);
+ TEST_VERIFY_EXIT (tm == &tmd);
+
+ TEST_VERIFY_EXIT (strftime (buf, sizeof buf, "%Y-%m-%d %H:%M:%S %Z", tm)
+ > 0);
+ puts (buf);
+ TEST_VERIFY (strcmp (buf, "2039-04-30 14:00:00 PDT") == 0);
}
else
FAIL_UNSUPPORTED ("32-bit time_t");