summaryrefslogtreecommitdiffstats
path: root/tests/grid.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-04-12 17:35:21 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-04-12 17:35:21 (GMT)
commit6be2d762849f33424837b70b6e0b36824259a50a (patch)
tree912815045d9b73530bf5ee43ac95fbdf6c8de588 /tests/grid.test
parent47a1f9b80207250b1f1933dec92f4031dc281f70 (diff)
downloadtk-6be2d762849f33424837b70b6e0b36824259a50a.zip
tk-6be2d762849f33424837b70b6e0b36824259a50a.tar.gz
tk-6be2d762849f33424837b70b6e0b36824259a50a.tar.bz2
* generic/tkGrid.c: Fixed handling of out of bounds row or column.
* tests/grid.test: [Bug 1432666]
Diffstat (limited to 'tests/grid.test')
-rw-r--r--tests/grid.test53
1 files changed, 52 insertions, 1 deletions
diff --git a/tests/grid.test b/tests/grid.test
index 1e07028..ccf2eca 100644
--- a/tests/grid.test
+++ b/tests/grid.test
@@ -5,7 +5,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: grid.test,v 1.17.2.2 2006/04/05 19:49:20 hobbs Exp $
+# RCS: @(#) $Id: grid.test,v 1.17.2.3 2006/04/12 17:35:21 dgp Exp $
package require tcltest 2.1
namespace import -force tcltest::configure
@@ -713,6 +713,57 @@ test grid-10.33 {column/row configure - invalid indices} {
list [catch {grid rowconfigure . {0 1 2} -weight} msg] $msg
} {1 {grid rowconfigure: must specify a single element on retrieval}}
+test grid-10.37 {column/row configure} {
+ list [catch {grid columnconfigure . 100000} msg] $msg
+} {0 {-minsize 0 -pad 0 -uniform {} -weight 0}}
+grid_reset 10.37
+
+test grid-10.38 {column/row configure} -body {
+ # This is a test for bug 1423666 where a column >= 10000 caused
+ # a crash in layout. The update is needed to reach the layout stage.
+ # Test different combinations of row/column overflow
+ frame .f
+ set res {}
+ lappend res [catch {grid .f -row 10 -column 9999} msg] $msg ; update
+ lappend res [catch {grid .f -row 9999 -column 10} msg] $msg ; update
+ lappend res [catch {grid .f -columnspan 2 -column 9998} msg] $msg ; update
+ lappend res [catch {grid .f -rowspan 2 -row 9998} msg] $msg ; update
+ lappend res [catch {grid .f -column 9998 -columnspan 2} msg] $msg ; update
+ lappend res [catch {grid .f -row 9998 -rowspan 2} msg] $msg ; update
+ set res
+} -cleanup {destroy .f} -result [lrange {
+ 1 {Column out of bounds}
+ 1 {Row out of bounds}
+ 1 {Column out of bounds}
+ 1 {Row out of bounds}
+ 1 {Column out of bounds}
+ 1 {Row out of bounds}
+} 0 end]
+grid_reset 10.38
+
+test grid-10.39 {column/row configure} -body {
+ # Additional tests for row/column overflow
+ frame .f
+ frame .g
+ set res {}
+ grid .f -row 9998 -column 0
+ lappend res [catch {grid ^ .g} msg] $msg ; update
+ grid forget .g
+ lappend res [catch {grid .g} msg] $msg ; update
+ grid forget .f .g
+ lappend res [catch {grid .f - -column 9998} msg] $msg ; update
+ grid forget .f .g
+ lappend res [catch {eval grid [string repeat " x " 9999] .f} msg] $msg
+ update
+ set res
+} -cleanup {destroy .f .g} -result [lrange {
+ 1 {Row out of bounds}
+ 1 {Row out of bounds}
+ 1 {Column out of bounds}
+ 1 {Column out of bounds}
+} 0 end]
+grid_reset 10.39
+
# auto-placement tests
test grid-11.1 {default widget placement} {