From 14ea22e96c0b6fce54e2451c69c96c429177b62c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 15 Feb 1998 19:31:34 +0000 Subject: Update. 1998-02-15 Ulrich Drepper * nss/nsswitch.c (__nss_lookup): Return 1 if this was the last module. * nss/getXXent_r.c: If no more module is found don't try to call setXXent functions but leave unsuccessfully. * malloc/obstack.h: Cleanups. * sysdeps/wordsize-32/stdint.h: New file. * sysdeps/wordsize-64/stdint.h: New file. * sysdeps/generic/stdint.h: New file. * sysdeps/wordsize-32/inttypes.h: Adopt to use stdint.h. * sysdeps/wordsize-64/inttypes.h: Likewise. * stdlib/Makefile (headers): Add stdint.h. 1998-02-03 Paul Eggert * malloc/obstack.h (PTR_INT_TYPE): Use __PTRDIFF_TYPE__ if available. 1998-02-13 17:59 Zack Weinberg * timezone: New directory. * time/README, time/africa, time/antarctica, time/asia, time/australasia, time/backward, time/checktab.awk, time/etcetera, time/europe, time/factory, time/ialloc.c, time/iso3166.tab, time/leapseconds, time/northamerica, time/pacificnew, time/private.h, time/scheck.c, time/solar87, time/solar88, time/solar89, time/southamerica, time/systemv, time/test-tz.c, time/tzfile.h, time/tzselect.ksh, time/yearistype, time/zdump.c, time/zic.c, time/zone.tab: Moved to timezone. * time/tzfile.c: Include tzfile.h from timezone subdir. * time/tzset.c: Likewise. * time/Makefile: Cut out all code relating to timezones... * timezone/Makefile: ...and paste it in here. * Makefile (subdirs): Add timezone. 1998-02-13 18:45 H.J. Lu * libc.map (_sys_nerr): Added. * sysdeps/unix/sysv/linux/errlist.c (_sys_nerr): Make it versioned symbol. 1998-02-15 17:16 Ulrich Drepper * sysdeps/unix/sysv/linux/bits/socket.h: Define PF_KEY and pseudo_AF_KEY instead of pseudo_PF_KEY and AF_KEY. Reported by Craig Metz . 1998-01-22 Andreas Schwab * nss/nss_files/files-parse.c (LOOKUP_NAME_CASE): Use __strcasecmp instead of strcasecmp. * nss/nss_files/files-alias.c (get_next_alias): Likewise. * wctype/wctype.h (_ISwbit): Avoid warning with gcc before 2.8. 1998-02-15 16:55 Ulrich Drepper * socket/sys/socket.h (setsockopt): Make OPTVAL parameter const. Patch by Dean Gaudet . 1998-02-15 16:53 Ulrich Drepper * sysdeps/generic/Dist: Add getresgid.c and getresuid.c. 1998-02-15 10:49 Zack Weinberg * sysdeps/unix/sysv/linux/poll.c: If compiled against a kernel with no poll syscall, just include the BSD version. * sysdeps/unix/sysv/linux/getresuid.c: If compiled against a kernel without the syscall, include the stub version. * sysdeps/unix/sysv/linux/getresgid.c: Likewise. * sysdeps/generic/getresuid.c: New file. * sysdeps/generic/getresgid.c: New file. 1998-02-15 Ulrich Drepper * stdio-common/vfscanf.c: Correct last change a bit. --- timezone/test-tz.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 timezone/test-tz.c (limited to 'timezone/test-tz.c') diff --git a/timezone/test-tz.c b/timezone/test-tz.c new file mode 100644 index 0000000..528aa6f --- /dev/null +++ b/timezone/test-tz.c @@ -0,0 +1,57 @@ +#include +#include +#include +#include + +struct { + const char * env; + time_t expected; +} tests[] = { + {"TZ=MST", 832935315}, + {"TZ=", 832910115}, + {"TZ=:UTC", 832910115}, + {"TZ=UTC", 832910115}, + /* PROBLEM ahead. I fear the tzset code is somehow broken. */ + /* {"TZ=UTC0", 832910115}*/ +}; + + +int +main (int argc, char ** argv) +{ + int errors = 0; + struct tm tm; + time_t t; + unsigned int i; + + memset (&tm, 0, sizeof (tm)); + tm.tm_isdst = 0; + tm.tm_year = 96; /* years since 1900 */ + tm.tm_mon = 4; + tm.tm_mday = 24; + tm.tm_hour = 3; + tm.tm_min = 55; + tm.tm_sec = 15; + + for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i) + { + putenv (tests[i].env); + t = mktime (&tm); + if (t != tests[i].expected) + { + printf ("%s: flunked test %u (expected %lu, got %lu)\n", + argv[0], i, (long) tests[i].expected, (long) t); + ++errors; + } + } + if (errors == 0) + { + puts ("No errors."); + exit (EXIT_SUCCESS); + } + else + { + printf ("%d errors.\n", errors); + exit (EXIT_FAILURE); + } +} -- cgit v1.1