summaryrefslogtreecommitdiffstats
path: root/tests/clock.test
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-05-29 00:19:39 (GMT)
committerhobbs <hobbs>2002-05-29 00:19:39 (GMT)
commitacc98cfd629f847b6e4b3e7eee967d7fe3f9bcdf (patch)
tree29125ebe484614a6acad3335d784da4ad422b93a /tests/clock.test
parent255468e31d6c18b6e10f63c0d914101824c2ce7f (diff)
downloadtcl-acc98cfd629f847b6e4b3e7eee967d7fe3f9bcdf.zip
tcl-acc98cfd629f847b6e4b3e7eee967d7fe3f9bcdf.tar.gz
tcl-acc98cfd629f847b6e4b3e7eee967d7fe3f9bcdf.tar.bz2
* tests/clock.test: added clock-9.1
* compat/strftime.c: * generic/tclClock.c: * generic/tclInt.decls: * generic/tclIntDecls.h: * unix/tclUnixTime.c: fix for Windows msvcrt mem leak caused by using an env(TZ) setting trick for in clock format -gmt 1. This also makes %s seem to work correctly with -gmt 1 as well as making it a lot faster by avoid the env(TZ) hack. TclpStrftime now takes useGMT as an arg. [Bug #559376]
Diffstat (limited to 'tests/clock.test')
-rw-r--r--tests/clock.test15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/clock.test b/tests/clock.test
index c96c2e7..ac93cb6 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.17 2001/10/18 20:20:28 hobbs Exp $
+# RCS: @(#) $Id: clock.test,v 1.18 2002/05/29 00:19:39 hobbs Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -427,6 +427,19 @@ test clock-8.1 {clock scan midnight/gmt range bug 413397} {
[clock format [clock scan year -base $5amPST -gmt 1] -format $fmt]
} {12/31 12/31}
+set ::tcltest::testConstraints(needPST) \
+ [regexp {^(Pacific.*|P[DS]T)$} [clock format 1 -format %Z]]
+test clock-9.1 {%s gmt testing} {needPST} {
+ # We need PST to guarantee the difference value below.
+ set s 100000
+ set a [clock format $s -format %s -gmt 0]
+ set b [clock format $s -format %s -gmt 1]
+ # This should be the offset in seconds between current locale and GMT.
+ # This didn't seem to be correctly on Windows until the fix for
+ # Bug #559376, which fiddled with env(TZ) when -gmt 1 was used.
+ # It's hard-coded to check P[SD]T now. (8 hours)
+ set c [expr {$b-$a}]
+} {28800}
# cleanup
::tcltest::cleanupTests