From fccf00aa146f98b1d9e3461a5fb7076f2956ba6f Mon Sep 17 00:00:00 2001 From: cuz Date: Wed, 13 Nov 2002 13:36:28 +0000 Subject: [PATCH] Extended the test git-svn-id: svn://svn.cc65.org/cc65/trunk@1516 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- testcode/lib/time-test.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/testcode/lib/time-test.c b/testcode/lib/time-test.c index ab473b3bd..99d16be01 100644 --- a/testcode/lib/time-test.c +++ b/testcode/lib/time-test.c @@ -7,6 +7,8 @@ int main (void) { struct tm tm; time_t t; + char buf[64]; + tm.tm_sec = 9; tm.tm_min = 34; @@ -20,10 +22,14 @@ int main (void) /* Convert this broken down time into a time_t and back */ t = mktime (&tm); printf ("Test passes if the following lines are\n" - "identical:\n"); + "all identical:\n"); printf ("3DD173D1 - Tue Nov 12 21:34:09 2002\n"); printf ("%08lX - %s", t, asctime (&tm)); printf ("%08lX - %s", t, asctime (gmtime (&t))); + strftime (buf, sizeof (buf), "%c", &tm); + printf ("%08lX - %s\n", t, buf); + strftime (buf, sizeof (buf), "%a %b %d %H:%M:%S %Y", &tm); + printf ("%08lX - %s\n", t, buf); return 0; } -- 2.39.5