diff options
Diffstat (limited to 'tests/visual.test')
| -rw-r--r-- | tests/visual.test | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/tests/visual.test b/tests/visual.test index 05bfcf7..dd6df2a 100644 --- a/tests/visual.test +++ b/tests/visual.test @@ -1,20 +1,35 @@ # This file is a Tcl script to test the visual- and colormap-handling -# procedures in the file tkVisual.c. It is organized in the standard -# fashion for Tcl tests. +# procedures in the file tkVisual.c. # # Copyright © 1994 The Regents of the University of California. # Copyright © 1994-1995 Sun Microsystems, Inc. # Copyright © 1998-1999 Scriptics Corporation. # All rights reserved. -package require tcltest 2.2 -namespace import ::tcltest::* -tcltest::configure {*}$argv -tcltest::loadTestedCommands +# +# TESTFILE INITIALIZATION +# + +package require tcltest 2.2; # needed in mode -singleproc 0 + +# Load the main script main.tcl, which takes care of: +# - setup for the application and the root window +# - importing commands from the tcltest namespace +# - loading of the testutils mechanism along with its utility procs +# - loading of Tk specific test constraints (additionally to constraints +# provided by the package tcltest) +source [file join [tcltest::configure -testdir] main.tcl] + +# Ensure a pristine initial window state +resetWindows # Import utility procs for specific functional areas testutils import colors +# +# COMMON TEST SETUP +# + update # If more than one visual type is available for the screen, pick one @@ -31,11 +46,18 @@ if {[llength $avail] > 1} { } } } + +# +# LOCAL TEST CONSTRAINTS +# + testConstraint haveOtherVisual [expr {$other ne ""}] testConstraint havePseudocolorVisual [string match *pseudocolor* $avail] testConstraint haveMultipleVisuals [expr {[llength $avail] > 1}] -# ---------------------------------------------------------------------- +# +# TESTS +# test visual-1.1 {Tk_GetVisual, copying from other window} -body { toplevel .t -visual .foo.bar @@ -520,13 +542,12 @@ test visual-8.2 {Tk_FreeColormap procedure} -constraints haveOtherVisual -setup } -result {} # -# CLEANUP +# TESTFILE CLEANUP # deleteWindows testutils forget colors cleanupTests -return # Local variables: # mode: tcl |
