@@ -11,34 +11,12 @@ namespace import ::tcltest::*
1111tcltest::configure {*}$argv
1212tcltest::loadTestedCommands
1313
14+ # Import utility procs for specific functional areas
15+ namespace import -force ::tk::test::colors::*
16+
1417testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}]
1518testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
1619
17- # eatColors --
18- # Creates a toplevel window and allocates enough colors in it to
19- # use up all the slots in the colormap.
20- #
21- # Arguments:
22- # w - Name of toplevel window to create.
23- # options - Options for w, such as "-colormap new".
24-
25- proc eatColors {w {options ""}} {
26- destroy $w
27- eval toplevel $w $options
28- wm geom $w +0+0
29- canvas $w.c -width 400 -height 200 -bd 0
30- pack $w.c
31- for {set y 0} {$y < 8} {incr y} {
32- for {set x 0} {$x < 40} {incr x} {
33- set color [format #%02x%02x%02x [expr {$x*6}] [expr {$y*30}] 0]
34- $w.c create rectangle [expr {10*$x}] [expr {20*$y}] \
35- [expr {10*$x + 10}] [expr {20*$y + 20}] -outline {} \
36- -fill $color
37- }
38- }
39- update
40- }
41-
4220# XXX - This test file is woefully incomplete. At present, only a
4321# few of the winfo options are tested.
4422
@@ -487,8 +465,12 @@ test winfo-14.4 {mapped at idle time} -setup {
487465 destroy .t
488466} -result 1
489467
468+ #
469+ # CLEANUP
470+ #
471+
490472deleteWindows
491- # cleanup
473+ namespace forget ::tk::test::colors::*
492474cleanupTests
493475return
494476
0 commit comments