From ce0022054c0176b268c48a6bc140cec484e6cc81 Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Sun, 30 Jul 2006 17:05:42 +0000 Subject: Bug 1513489 --- ChangeLog | 7 +++++++ tests/clock.test | 54 ++++++++++++++++++++++++++++++------------------------ 2 files changed, 37 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0f13d84..5e138d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-07-30 Kevin Kenny + + * tests/clock.test: Allowed UTC as a synonym for GMT in two + tests that indirectly invoke 'strftime' with the result of + 'gmtime' to fix a bogus test failure on FreeBSD systems. + [Bug 1513489]. + 2006-07-30 Joe English * doc/AppInit.3: Fix typo [Bug 1496886] diff --git a/tests/clock.test b/tests/clock.test index 6599218..c526771 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.6 2004/09/08 18:32:20 kennykb Exp $ +# RCS: @(#) $Id: clock.test,v 1.22.2.7 2006/07/30 17:05:43 kennykb Exp $ set env(LC_TIME) POSIX @@ -63,17 +63,20 @@ test clock-3.1 {clock format tests} {unixOnly} { set clockval 657687766 clock format $clockval -format {%a %b %d %I:%M:%S %p %Y} -gmt true } {Sun Nov 04 03:02:46 AM 1990} -test clock-3.2 {clock format tests} { - # TCL_USE_TIMEZONE_VAR - - catch {set oldtz $env(TZ)} - set env(TZ) PST - set x {} - append x [clock format 863800000 -format %Z -gmt 1] - append x [set env(TZ)] - catch {unset env(TZ); set env(TZ) $oldtz} - set x -} {GMTPST} +test clock-3.2 {clock format tests} \ + -body { + # TCL_USE_TIMEZONE_VAR + + catch {set oldtz $env(TZ)} + set env(TZ) PST + set x {} + append x [clock format 863800000 -format %Z -gmt 1] + append x [set env(TZ)] + catch {unset env(TZ); set env(TZ) $oldtz} + set x + } \ + -match regexp \ + -result {(?:GMT|UTC)PST} test clock-3.3 {clock format tests} { # tzset() under Borland doesn't seem to set up tzname[] for local # timezone, which caused "clock format" to think that %Z was an invalid @@ -82,18 +85,21 @@ test clock-3.3 {clock format tests} { clock format 863800000 -format %Z set x {} } {} -test clock-3.4 {clock format tests} { - # tzset() under Borland doesn't seem to set up tzname[] for gmt timezone. - # tzset() under MSVC has the following weird observed behavior: - # First time we call "clock format [clock seconds] -format %Z -gmt 1" - # we get "GMT", but on all subsequent calls we get the current time - # zone string, even though env(TZ) is GMT and the variable _timezone - # is 0. - - set x {} - append x [clock format 863800000 -format %Z -gmt 1] - append x [clock format 863800000 -format %Z -gmt 1] -} {GMTGMT} +test clock-3.4 {clock format tests} \ + -body { + # tzset() under Borland doesn't seem to set up tzname[] for gmt + # timezone. tzset() under MSVC has the following weird observed + # behavior: + # First time we call "clock format [clock seconds] -format %Z -gmt 1" + # we get "GMT", but on all subsequent calls we get the current time + # zone string, even though env(TZ) is GMT and the variable _timezone + # is 0. + set x {} + append x [clock format 863800000 -format %Z -gmt 1] + append x [clock format 863800000 -format %Z -gmt 1] + } \ + -match regexp \ + -result {GMTGMT|UTCUTC} test clock-3.5 {clock format tests} { list [catch {clock format} msg] $msg } {1 {wrong # args: should be "clock format clockval ?-format string? ?-gmt boolean?"}} -- cgit v0.12