summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2004-05-14 21:41:04 (GMT)
committerKevin B Kenny <kennykb@acm.org>2004-05-14 21:41:04 (GMT)
commit1f09368b39073bc30f3957f2f70911a722f5c781 (patch)
treec43bfd28868eb27530e825eb959a36371420aeb7 /tests
parentb8fec065a49ccae81c772930a794083e9fb8fc10 (diff)
downloadtcl-1f09368b39073bc30f3957f2f70911a722f5c781.zip
tcl-1f09368b39073bc30f3957f2f70911a722f5c781.tar.gz
tcl-1f09368b39073bc30f3957f2f70911a722f5c781.tar.bz2
2004-05-14 Kevin B. Kenny <kennykb@acm.org>
* generic/tclInt.decls: Promoted TclpLocaltime and TclpGmtime * generic/tclIntDecls.h: from Unix-specific stubs to the generic * generic/tclIntPlatDecls.h: internal Stubs table. Reran 'genstubs' * generic/tclStubInit.c: * unix/tclUnixPort.h: * generic/tclClock.c: Changed a buggy 'GMT' timezone specification to the correct 'GMT0'. [Bug #922848] * unix/tclUnixThrd.c: Moved TclpGmtime and TclpLocaltime to unix/tclUnixTime.c where they belong. * unix/tclUnixTime.c (TclpGmtime, TclpLocaltime, TclpGetTimeZone, ThreadSafeGMTime [removed], ThreadSafeLocalTime [removed], SetTZIfNecessary, CleanupMemory): Restructured to make sure that the same mutex protects all calls to localtime, gmtime, and tzset. Added a check in front of those calls to make sure that the TZ env var hasn't changed since the last call to tzset, and repeat tzset if necessary. [Bug #942078] Removed a buggy test of the Daylight Saving Time information in 'gettimeofday' in favor of applying 'localtime' to a known value. [Bug #922848] * tests/clock.test (clock-3.14): Added test to make sure that changes to $env(TZ) take effect immediately. * win/tclWinTime.c (TclpLocaltime, TclpGmtime): Added porting layer for 'localtime' and 'gmtime' calls.
Diffstat (limited to 'tests')
-rw-r--r--tests/clock.test24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/clock.test b/tests/clock.test
index 3b2ad27..72c254e 100644
--- a/tests/clock.test
+++ b/tests/clock.test
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: clock.test,v 1.22.2.1 2003/04/12 20:11:34 kennykb Exp $
+# RCS: @(#) $Id: clock.test,v 1.22.2.2 2004/05/14 21:41:11 kennykb Exp $
set env(LC_TIME) POSIX
@@ -129,6 +129,28 @@ test clock-3.13 {clock format with non-ASCII character in the format string} {
set res
} "\u00c4"
+# Bug 942078
+
+test clock-3.14 {change of time zone} -setup {
+ catch { unset oldTZ }
+ if { [info exists env(TZ)] } {
+ set oldTZ $env(TZ)
+ }
+} -body {
+ set env(TZ) PST8PDT
+ set s [clock format 0 -format %H%M]
+ set env(TZ) GMT0
+ append s -[clock format 0 -format %H%M]
+} -cleanup {
+ if { [info exists oldTZ] } {
+ set env(TZ) $oldTZ
+ unset oldTZ
+ } else {
+ unset env(TZ)
+ }
+} -result {1600-0000}
+
+
# clock scan
test clock-4.1 {clock scan tests} {
list [catch {clock scan} msg] $msg