aboutsummaryrefslogtreecommitdiff
path: root/timezone
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-11-13 13:25:47 +0000
committerUlrich Drepper <drepper@redhat.com>1998-11-13 13:25:47 +0000
commita3e0e9ae473ae52861c5bceb8a6feb624bf30c61 (patch)
tree3ab4a7213bedeb7a7995d53867cd7d0c72d76ef0 /timezone
parent7f2a1e3cf8077faa2c5de78f081890302a4c8362 (diff)
downloadglibc-a3e0e9ae473ae52861c5bceb8a6feb624bf30c61.tar
glibc-a3e0e9ae473ae52861c5bceb8a6feb624bf30c61.tar.gz
glibc-a3e0e9ae473ae52861c5bceb8a6feb624bf30c61.tar.bz2
glibc-a3e0e9ae473ae52861c5bceb8a6feb624bf30c61.zip
Update.
1998-11-13 Ulrich Drepper <drepper@cygnus.com> * libio/bits/stdio.h: Correct and improve fread_unlocked and fwrite_unlocked optimizations. * time/tzfile.c (__tzfile_read): Set __tzname based on last names in time not to last entries in the file. (__tzfile_compute): Likewise. Fix for PR libc/863. * timezone/Makefile: Generate GB timezone data for test. * timezone/tst-timezone.c: More tests for DST switching time (disabled for now). 1998-11-13 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * sysdeps/gnu/bits/utmp.h: Rename pad member of struct utmp to
Diffstat (limited to 'timezone')
-rw-r--r--timezone/Makefile6
-rw-r--r--timezone/tst-timezone.c39
2 files changed, 43 insertions, 2 deletions
diff --git a/timezone/Makefile b/timezone/Makefile
index c0a9bc166e..642086299a 100644
--- a/timezone/Makefile
+++ b/timezone/Makefile
@@ -53,7 +53,7 @@ define nl
endef
-ifndef avoid-generated
+ifndef no_deps
-include $(addprefix $(objpfx)z.,$(tzfiles))
endif
@@ -178,7 +178,7 @@ $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC)
$(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \
Europe/Berlin Universal \
Australia/Melbourne \
- America/Sao_Paulo Asia/Tokyo)
+ America/Sao_Paulo Asia/Tokyo GB)
test-tz-ENV = TZDIR=$(testdata)
tst-timezone-ENV = TZDIR=$(testdata)
@@ -204,6 +204,8 @@ $(testdata)/America/Sao_Paulo: southamerica $(objpfx)zic $(leapseconds) \
$(build-testdata)
$(testdata)/Asia/Tokyo: asia $(objpfx)zic $(leapseconds) yearistype
$(build-testdata)
+$(testdata)/GB: europe $(objpfx)zic $(leapseconds) yearistype
+ $(build-testdata)
$(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
diff --git a/timezone/tst-timezone.c b/timezone/tst-timezone.c
index e866b94d10..94b9d2d72e 100644
--- a/timezone/tst-timezone.c
+++ b/timezone/tst-timezone.c
@@ -39,6 +39,7 @@ static const struct test_times tests[] =
{ "Universal", 0, 0, {"UTC", "UTC" }},
{ "Australia/Melbourne", 1, -36000, { "EST", "EST" }},
{ "America/Sao_Paulo", 1, 10800, {"EST", "EDT" }},
+ { "America/Chicago", 1, 21600, {"CST", "CDT" }},
{ "America/Los_Angeles", 1, 28800, {"PST", "PDT" }},
{ "Asia/Tokyo", 0, -32400, {"JST", "JST" }},
{ NULL, 0, 0 }
@@ -113,5 +114,43 @@ main (int argc, char ** argv)
check_tzvars (pt->name, pt->daylight, pt->timezone, pt->tzname);
}
+#if 0
+ /* From a port of Scott Harrington <seh4@ix.netcom.com> to the timezone
+ mailing list. */
+ {
+ struct tm tmBuf = {0, 0, 0, 10, 3, 98, 0, 0, -1};
+ char buf[200];
+ putenv ("TZ=GB");
+ t = mktime (&tmBuf);
+ snprintf (buf, sizeof (buf), "TZ=%s %ld %d %d %d %d %d %d %d %d %d",
+ getenv ("TZ"), t,
+ tmBuf.tm_sec, tmBuf.tm_min, tmBuf.tm_hour,
+ tmBuf.tm_mday, tmBuf.tm_mon, tmBuf.tm_year,
+ tmBuf.tm_wday, tmBuf.tm_yday, tmBuf.tm_isdst);
+ fputs (buf, stdout);
+ puts (" should be");
+ puts ("TZ=GB 892162800 0 0 0 10 3 98 5 99 1");
+ failed |= strcmp (buf, "TZ=GB 892162800 0 0 0 10 3 98 5 99 1") != 0;
+ }
+
+ printf("\n");
+
+ {
+ struct tm tmBuf = {0, 0, 0, 10, 3, 98, 0, 0, -1};
+ char buf[200];
+ putenv ("TZ=GMT");
+ t = mktime (&tmBuf);
+ snprintf (buf, sizeof (buf), "TZ=%s %ld %d %d %d %d %d %d %d %d %d",
+ getenv ("TZ"), t,
+ tmBuf.tm_sec, tmBuf.tm_min, tmBuf.tm_hour,
+ tmBuf.tm_mday, tmBuf.tm_mon, tmBuf.tm_year,
+ tmBuf.tm_wday, tmBuf.tm_yday, tmBuf.tm_isdst);
+ fputs (buf, stdout);
+ puts (" should be");
+ puts ("TZ=GMT 892166400 0 0 0 10 3 98 5 99 0");
+ failed |= strcmp (buf, "TZ=GMT 892166400 0 0 0 10 3 98 5 99 0") != 0;
+ }
+#endif
+
return failed ? EXIT_FAILURE : EXIT_SUCCESS;
}