summaryrefslogtreecommitdiffstats
path: root/tests/visual.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-06-17 22:38:55 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-06-17 22:38:55 (GMT)
commit68c988ff855b9dbfb491f6986db826f591b6f1d2 (patch)
tree6b824bed75789a3a95889126d5c52a7d76e579af /tests/visual.test
parentc5b74b100d335256f82be758f49ce8425fe2ac18 (diff)
downloadtk-68c988ff855b9dbfb491f6986db826f591b6f1d2.zip
tk-68c988ff855b9dbfb491f6986db826f591b6f1d2.tar.gz
tk-68c988ff855b9dbfb491f6986db826f591b6f1d2.tar.bz2
Steps towards systematization of test constraints in Tk test suite
Diffstat (limited to 'tests/visual.test')
-rw-r--r--tests/visual.test15
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/visual.test b/tests/visual.test
index 31a2f53..b54a8e6 100644
--- a/tests/visual.test
+++ b/tests/visual.test
@@ -7,7 +7,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: visual.test,v 1.9 2004/06/04 19:55:31 dgp Exp $
+# RCS: @(#) $Id: visual.test,v 1.10 2004/06/17 22:38:57 dkf Exp $
package require tcltest 2.1
eval tcltest::configure $argv
@@ -69,12 +69,9 @@ if {[llength $avail] > 1} {
}
}
}
-tcltest::testConstraint haveOtherVisual [expr {$other ne ""}]
-tcltest::testConstraint havePseudocolorVisual [string match *pseudocolor* $avail]
-tcltest::testConstraint haveMultipleVisuals [expr {[llength $avail] > 1}]
-tcltest::testConstraint defaultPseudocolor8 [expr {
- ([winfo visual .] == "pseudocolor") && ([winfo depth .] == 8)
-}]
+testConstraint haveOtherVisual [expr {$other ne ""}]
+testConstraint havePseudocolorVisual [string match *pseudocolor* $avail]
+testConstraint haveMultipleVisuals [expr {[llength $avail] > 1}]
test visual-1.1 {Tk_GetVisual, copying from other window} {
list [catch {toplevel .t -visual .foo.bar} msg] $msg
@@ -211,7 +208,7 @@ test visual-6.1 {Tk_GetVisual, no matching visual} {havePseudocolorVisual haveMu
# These tests are non-portable due to variations in how many colors
# are already in use on the screen.
-if {[tcltest::testConstraint defaultPseudocolor8]} {
+if {[testConstraint defaultPseudocolor8]} {
eatColors .t1
}
test visual-7.1 {Tk_GetColormap, "new"} {defaultPseudocolor8 nonPortable} {
@@ -262,7 +259,7 @@ test visual-7.6 {Tk_GetColormap, copy from other window} {defaultPseudocolor8 ha
wm geometry .t1 +0+0
list [catch {toplevel .t2 -width 400 -height 50 -colormap .t1} msg] $msg
} {1 {can't use colormap for .t1: incompatible visuals}}
-if {[tcltest::testConstraint defaultPseudocolor8]} {
+if {[testConstraint defaultPseudocolor8]} {
catch {destroy .t1}
catch {destroy .t2}
}