diff options
author | stanton <stanton> | 1999-01-06 21:10:45 (GMT) |
---|---|---|
committer | stanton <stanton> | 1999-01-06 21:10:45 (GMT) |
commit | e904bc5e620774bea43638c8cd679affbc36fa2e (patch) | |
tree | f3b0b77980dea9353ef24843caa0eacb634e1ffb /tests | |
parent | 5519b5f36b63e8e841ed3b31293e5eaaf42dfc47 (diff) | |
download | tk-e904bc5e620774bea43638c8cd679affbc36fa2e.zip tk-e904bc5e620774bea43638c8cd679affbc36fa2e.tar.gz tk-e904bc5e620774bea43638c8cd679affbc36fa2e.tar.bz2 |
* generic/tkGrid.c: Fixed bug in "grid forget" that failed to cancelscriptics_tclpro_1_2_b1
pending idle handlers, resulting in a crash in a few odd cases.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/grid.test | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/tests/grid.test b/tests/grid.test index 61cc661..85464d7 100644 --- a/tests/grid.test +++ b/tests/grid.test @@ -2,29 +2,16 @@ # of Tk. It is (almost) organized in the standard fashion for Tcl tests. # # Copyright (c) 1996 Sun Microsystems, Inc. +# Copyright (c) 1998-1999 by Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: grid.test,v 1.2 1998/09/14 18:23:47 stanton Exp $ +# RCS: @(#) $Id: grid.test,v 1.3 1999/01/06 21:10:46 stanton Exp $ if {[string compare test [info procs test]] == 1} then \ {source ../tests/defs} -# Test Arguments: -# name - Name of test, in the form foo-1.2. -# description - Short textual description of the test, to -# help humans understand what it does. -# constraints - A list of one or more keywords, each of -# which must be the name of an element in -# the array "testConfig". If any of these -# elements is zero, the test is skipped. -# This argument may be omitted. -# script - Script to run to carry out the test. It must -# return a result that can be checked for -# correctness. -# answer - Expected result from script. - # helper routine to return "." to a sane state after a test # The variable GRID_VERBOSE can be used to "look" at the result # of one or all of the tests @@ -310,18 +297,18 @@ test grid-6.7 {location (y)} { grid_reset 6.7 test grid-6.8 {location (weights)} { - frame .f -width 200 -height 100 -highlightthickness 0 -bg red + frame .f -width 300 -height 100 -highlightthickness 0 -bg red frame .a grid .a grid .f -in .a grid rowconfigure .f 0 -weight 1 grid columnconfigure .f 0 -weight 1 grid propagate .a 0 - .a configure -width 110 -height 15 + .a configure -width 200 -height 15 update set got "" set result "" - for {set y -10} { $y < 120} { incr y} { + for {set y -10} { $y < 210} { incr y} { set a [grid location . $y $y] if {$a != $got} { lappend result $y->$a @@ -329,7 +316,7 @@ test grid-6.8 {location (weights)} { } } set result -} {{-10->-1 -1} {0->0 0} {16->0 1} {111->1 1}} +} {{-10->-1 -1} {0->0 0} {16->0 1} {201->1 1}} grid_reset 6.8 test grid-6.9 {location: check updates pending} { @@ -1203,3 +1190,25 @@ test grid-16.8 {layout internal constraints} { } set a } {0 30 70 250 280 , 0 30 130 230 260 , 0 30 113 197 280 , 0 30 60 90 120 } + +test grid-17.1 {forget and pending idle handlers} { + # This test is intended to detect a crash caused by a failure to remove + # pending idle handlers when grid forget is invoked. + + toplevel .t + frame .t.f + label .t.f.l -text foobar + grid .t.f.l + grid .t.f + update + grid forget .t.f.l + grid forget .t.f + destroy .t + + toplevel .t + frame .t.f + label .t.f.l -text foobar + grid .t.f.l + destroy .t + set result ok +} ok |