From 0b4c0fa7390351fb221ff5a0938a0ed5133aea4e Mon Sep 17 00:00:00 2001 From: hobbs Date: Fri, 13 Feb 2004 01:43:05 +0000 Subject: simple code cleanup --- tests/window.test | 57 ++++++++++++------------------------------------------- 1 file changed, 12 insertions(+), 45 deletions(-) diff --git a/tests/window.test b/tests/window.test index 51bacbc..9239914 100644 --- a/tests/window.test +++ b/tests/window.test @@ -5,7 +5,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: window.test,v 1.7 2002/11/14 17:30:20 mdejong Exp $ +# RCS: @(#) $Id: window.test,v 1.7.2.1 2004/02/13 01:43:05 hobbs Exp $ package require tcltest 2.1 namespace import -force tcltest::configure @@ -87,11 +87,7 @@ test window-2.4 {Tk_DestroyWindow, cleanup half dead window at exit} \ bind . exit destroy . } script] - if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 - } else { - set error 0 - } + set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg] removeFile script list $error $msg } {0 {}} @@ -104,11 +100,7 @@ test window-2.5 {Tk_DestroyWindow, cleanup half dead windows at exit} \ bind .t exit destroy .t } script] - if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 - } else { - set error 0 - } + set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg] removeFile script list $error $msg } {0 {}} @@ -121,11 +113,7 @@ test window-2.6 {Tk_DestroyWindow, cleanup half dead windows at exit} \ bind .t exit destroy . } script] - if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 - } else { - set error 0 - } + set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg] removeFile script list $error $msg } {0 {}} @@ -139,11 +127,7 @@ test window-2.7 {Tk_DestroyWindow, cleanup half dead windows at exit} \ bind .t.f exit destroy . } script] - if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 - } else { - set error 0 - } + set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg] removeFile script list $error $msg } {0 {}} @@ -160,17 +144,13 @@ test window-2.8 {Tk_DestroyWindow, cleanup half dead windows at exit} \ bind .t1 {exit 0} destroy .t3 } script] - if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 - } else { - set error 0 - } + set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg] removeFile script list $error $msg } {0 {}} -test window-2.9 {Tk_DestroyWindow, Destroy bindings - evaluated after exit} unixOrWin { +test window-2.9 {Tk_DestroyWindow, Destroy bindings evaluated after exit} \ + unixOrWin { set script [makeFile { toplevel .t1 toplevel .t2 @@ -179,18 +159,13 @@ test window-2.9 {Tk_DestroyWindow, Destroy bindings bind .t1 {puts "Destroy .t1" ; exit 0} destroy .t2 } script] - if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 - } else { - set error 0 - } + set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg] removeFile script list $error $msg } {0 {Destroy .t2 Destroy .t1}} -test window-2.10 {Tk_DestroyWindow, Destroy binding - evaluated once} unixOrWin { +test window-2.10 {Tk_DestroyWindow, Destroy binding evaluated once} unixOrWin { set script [makeFile { update bind . { @@ -200,11 +175,7 @@ test window-2.10 {Tk_DestroyWindow, Destroy binding } destroy . } script] - if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 - } else { - set error 0 - } + set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg] removeFile script list $error $msg } {0 {Destroy .}} @@ -225,11 +196,7 @@ test window-2.11 {Tk_DestroyWindow, don't reanimate a half-dead window} \ bind .t2 {exit} destroy .t2 } script] - if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} { - set error 1 - } else { - set error 0 - } + set error [catch {exec [interpreter] $script -geometry 10x10+0+0} msg] removeFile script list $error $msg } {0 YES} -- cgit v0.12