summaryrefslogtreecommitdiffstats
path: root/tests/menubut.test
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@noemail.net>2009-01-13 01:46:04 (GMT)
committerpatthoyts <patthoyts@noemail.net>2009-01-13 01:46:04 (GMT)
commit5c140536e578ada27c7436dd2574939b236e9b3a (patch)
tree2bb2e17fa91b47afa565195e5553ba50edf99aa9 /tests/menubut.test
parentcd0cd6487c3491d72494c4bcb27574df76c9cc99 (diff)
downloadtk-5c140536e578ada27c7436dd2574939b236e9b3a.zip
tk-5c140536e578ada27c7436dd2574939b236e9b3a.tar.gz
tk-5c140536e578ada27c7436dd2574939b236e9b3a.tar.bz2
Tk tests that create images need to be independent of the interpreter environment.
FossilOrigin-Name: 1cd8c350b2aa943a22045a8141599f169bb17c53
Diffstat (limited to 'tests/menubut.test')
-rw-r--r--tests/menubut.test31
1 files changed, 17 insertions, 14 deletions
diff --git a/tests/menubut.test b/tests/menubut.test
index 4932c31..17bf013 100644
--- a/tests/menubut.test
+++ b/tests/menubut.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: menubut.test,v 1.12 2008/08/18 16:09:10 aniap Exp $
+# RCS: @(#) $Id: menubut.test,v 1.13 2009/01/13 01:46:06 patthoyts Exp $
# XXX This test file is woefully incomplete right now. If any part
# XXX of a procedure has tests then the whole procedure has tests,
@@ -16,6 +16,7 @@ package require tcltest 2.2
eval tcltest::configure $argv
tcltest::loadTestedCommands
namespace import -force tcltest::test
+imageInit
# Create entries in the option database to be sure that geometry options
# like border width have predictable values.
@@ -455,20 +456,20 @@ test menubutton-4.7 {ConfigureMenuButton procedure} -constraints {
testImageType
} -setup {
deleteWindows
- eval image delete [image names]
+ imageCleanup
} -body {
image create test image1
button .mb1 -image image1
.mb1 configure -height 0.5x
} -cleanup {
deleteWindows
- eval image delete [image names]
+ imageCleanup
} -returnCodes error -result {bad screen distance "0.5x"}
test menubutton-4.8 {ConfigureMenuButton procedure} -constraints {
testImageType
} -setup {
deleteWindows
- eval image delete [image names]
+ imageCleanup
} -body {
image create test image1
button .mb1 -image image1
@@ -476,7 +477,7 @@ test menubutton-4.8 {ConfigureMenuButton procedure} -constraints {
return $errorInfo
} -cleanup {
deleteWindows
- eval image delete [image names]
+ imageCleanup
} -result {bad screen distance "0.5x"
(processing -height option)
invoked from within
@@ -555,7 +556,7 @@ test menubutton-7.1 {ComputeMenuButtonGeometry procedure} -constraints {
list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
deleteWindows
- eval image delete [image names]
+ imageCleanup
} -result {38 23}
test menubutton-7.2 {ComputeMenuButtonGeometry procedure} -constraints {
testImageType
@@ -568,7 +569,7 @@ test menubutton-7.2 {ComputeMenuButtonGeometry procedure} -constraints {
list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
deleteWindows
- eval image delete [image names]
+ imageCleanup
} -result {36 21}
test menubutton-7.3 {ComputeMenuButtonGeometry procedure} -constraints {
testImageType
@@ -581,7 +582,7 @@ test menubutton-7.3 {ComputeMenuButtonGeometry procedure} -constraints {
list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
deleteWindows
- eval image delete [image names]
+ imageCleanup
} -result {34 19}
test menubutton-7.4 {ComputeMenuButtonGeometry procedure} -constraints {
testImageType
@@ -595,7 +596,7 @@ test menubutton-7.4 {ComputeMenuButtonGeometry procedure} -constraints {
list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
deleteWindows
- eval image delete [image names]
+ imageCleanup
} -result {48 23}
test menubutton-7.5 {ComputeMenuButtonGeometry procedure} -constraints {
testImageType
@@ -609,7 +610,7 @@ test menubutton-7.5 {ComputeMenuButtonGeometry procedure} -constraints {
list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
deleteWindows
- eval image delete [image names]
+ imageCleanup
} -result {38 38}
test menubutton-7.6 {ComputeMenuButtonGeometry procedure} -setup {
deleteWindows
@@ -716,7 +717,7 @@ test menubutton-7.14 {ComputeMenuButtonGeometry procedure} -constraints {
list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
deleteWindows
- eval image delete [image names]
+ imageCleanup
} -result {64 23}
test menubutton-7.15 {ComputeMenuButtonGeometry procedure} -constraints {
testImageType win nonPortable
@@ -733,7 +734,7 @@ test menubutton-7.15 {ComputeMenuButtonGeometry procedure} -constraints {
list [winfo reqwidth .mb] [winfo reqheight .mb]
} -cleanup {
deleteWindows
- eval image delete [image names]
+ imageCleanup
} -result {65 23}
@@ -752,10 +753,12 @@ test menubutton-8.1 {menubutton vs hidden commands} -body {
deleteWindows
option clear
+imageFinish
# cleanup
cleanupTests
return
-
-
+# Local variables:
+# mode: tcl
+# End: \ No newline at end of file