summaryrefslogtreecommitdiffstats
path: root/tests/image.test
diff options
context:
space:
mode:
authorandreask <andreask>2013-01-22 19:30:43 (GMT)
committerandreask <andreask>2013-01-22 19:30:43 (GMT)
commit48c9fcb7281cc6aa076113db874c7ae0e105795d (patch)
tree7187940ff056462bfa41705a2ce04d0ed07d424e /tests/image.test
parent41f5d19540b0b3f053da352e1569c9a4ed019dd5 (diff)
downloadtk-48c9fcb7281cc6aa076113db874c7ae0e105795d.zip
tk-48c9fcb7281cc6aa076113db874c7ae0e105795d.tar.gz
tk-48c9fcb7281cc6aa076113db874c7ae0e105795d.tar.bz2
Contribution by Patrick Fradin <patrick.fradin@planar.com>contrib_patrick_fradin_code_cleanup
Quoting his mail: <pre> ========================================================== Hi Jeff, I spent some of my time to contribute to the TclTk community ! I'm in late for Christmas gift but like we said in French : "Mieux vaut tard que jamais". ;-) I've use TclDevKit 5.3.0 tclchecker to analyse TclTk code in Tcl and Tk library directories (library, tools and tests) to correct a lot of warnings and few errors. (encapsulate some expr, use 'chan xxx' instead of fconfigure, fileevent...) I've made some improvements too : Examples : - Use 'lassign' instead of many 'lindex' of 'foreach/break' loop. - Use 'in' or 'ni' operators instead of 'lsearch -exact' or to factorise some eq/ne && / || tests. - Use 'eq' or 'ne' to tests strings instead of '==' or '!='. - Use 'unset -nocomplain' to avoid 'catch {unset...}'. - Remove some useless catch around 'destroy' calls. - Use expand {*} instead of 'eval'. Don't touch a lot of code because I don't know all structs and lists. I think it could be a greater improvement to reduce 'eval' calls. Due to previous experience, I dot not change any indentation ! ;-) ========================================================== </pre>
Diffstat (limited to 'tests/image.test')
-rw-r--r--tests/image.test25
1 files changed, 7 insertions, 18 deletions
diff --git a/tests/image.test b/tests/image.test
index 3134ee8..d12ff67 100644
--- a/tests/image.test
+++ b/tests/image.test
@@ -19,7 +19,6 @@ canvas .c -highlightthickness 2
pack .c
update
-
test image-1.1 {Tk_ImageCmd procedure, "create" option} -body {
image
} -returnCodes error -result {wrong # args: should be "image option ?args?"}
@@ -179,7 +178,6 @@ test image-2.4 {Tk_ImageCmd procedure, "delete" option} -constraints {
imageCleanup
} -result {img2}
-
test image-3.1 {Tk_ImageCmd procedure, "height" option} -body {
image height
} -returnCodes error -result {wrong # args: should be "image height name"}
@@ -202,7 +200,6 @@ test image-3.4 {Tk_ImageCmd procedure, "height" option} -constraints {
imageCleanup
} -result {15 50}
-
test image-4.1 {Tk_ImageCmd procedure, "names" option} -body {
image names x
} -returnCodes error -result {wrong # args: should be "image names"}
@@ -237,7 +234,6 @@ test image-4.3 {Tk_ImageCmd procedure, "names" option} -setup {
interp delete testinterp
} -result {}
-
test image-5.1 {Tk_ImageCmd procedure, "type" option} -body {
image type
} -returnCodes error -result {wrong # args: should be "image type name"}
@@ -295,7 +291,6 @@ test image-5.7 {Tk_ImageCmd procedure, "type" option} -constraints {
imageCleanup
} -returnCodes error -result {image "myimage" doesn't exist}
-
test image-6.1 {Tk_ImageCmd procedure, "types" option} -body {
image types x
} -returnCodes error -result {wrong # args: should be "image types"}
@@ -305,7 +300,6 @@ test image-6.2 {Tk_ImageCmd procedure, "types" option} -constraints {
lsort [image types]
} -result {bitmap oldtest photo test}
-
test image-7.1 {Tk_ImageCmd procedure, "width" option} -body {
image width
} -returnCodes error -result {wrong # args: should be "image width name"}
@@ -328,7 +322,6 @@ test image-7.4 {Tk_ImageCmd procedure, "width" option} -constraints {
imageCleanup
} -result {30 60}
-
test image-8.1 {Tk_ImageCmd procedure, "inuse" option} -constraints {
testImageType
} -setup {
@@ -342,10 +335,9 @@ test image-8.1 {Tk_ImageCmd procedure, "inuse" option} -constraints {
lappend res [image inuse myimage2]
} -cleanup {
imageCleanup
- catch {destroy .b}
+ destroy .b
} -result [list 0 1]
-
test image-9.1 {Tk_ImageChanged procedure} -constraints testImageType -setup {
.c delete all
imageCleanup
@@ -378,7 +370,6 @@ test image-9.2 {Tk_ImageChanged procedure} -constraints testImageType -setup {
imageCleanup
} -result {{foo display 5 6 25 9 30 30} {foo display 0 0 12 14 65 74}}
-
test image-10.1 {Tk_GetImage procedure} -setup {
imageCleanup
} -body {
@@ -399,7 +390,6 @@ test image-10.2 {Tk_GetImage procedure} -constraints testImageType -setup {
imageCleanup
} -returnCodes error -result {image "mytest" doesn't exist}
-
test image-11.1 {Tk_FreeImage procedure} -constraints testImageType -setup {
.c delete all
imageCleanup
@@ -449,7 +439,7 @@ test image-12.1 {Tk_RedrawImage procedure, redisplay area clipping} -constraints
image create test foo -variable x
.c create image 50 60 -image foo -tags i1 -anchor nw
update
- .c create rectangle 30 40 55 65 -width 0 -fill black -outline {}
+ .c create rectangle 30 40 55 65 -width 0 -fill black -outline ""
set x {}
update
return $x
@@ -464,7 +454,7 @@ test image-12.2 {Tk_RedrawImage procedure, redisplay area clipping} -constraints
image create test foo -variable x
.c create image 50 60 -image foo -tags i1 -anchor nw
update
- .c create rectangle 60 40 100 65 -width 0 -fill black -outline {}
+ .c create rectangle 60 40 100 65 -width 0 -fill black -outline ""
set x {}
update
return $x
@@ -479,7 +469,7 @@ test image-12.3 {Tk_RedrawImage procedure, redisplay area clipping} -constraints
image create test foo -variable x
.c create image 50 60 -image foo -tags i1 -anchor nw
update
- .c create rectangle 60 70 100 200 -width 0 -fill black -outline {}
+ .c create rectangle 60 70 100 200 -width 0 -fill black -outline ""
set x {}
update
return $x
@@ -494,7 +484,7 @@ test image-12.4 {Tk_RedrawImage procedure, redisplay area clipping} -constraints
image create test foo -variable x
.c create image 50 60 -image foo -tags i1 -anchor nw
update
- .c create rectangle 30 70 55 200 -width 0 -fill black -outline {}
+ .c create rectangle 30 70 55 200 -width 0 -fill black -outline ""
set x {}
update
return $x
@@ -509,7 +499,7 @@ test image-12.5 {Tk_RedrawImage procedure, redisplay area clipping} -constraints
image create test foo -variable x
.c create image 50 60 -image foo -tags i1 -anchor nw
update
- .c create rectangle 10 20 120 130 -width 0 -fill black -outline {}
+ .c create rectangle 10 20 120 130 -width 0 -fill black -outline ""
set x {}
update
return $x
@@ -524,7 +514,7 @@ test image-12.6 {Tk_RedrawImage procedure, redisplay area clipping} -constraints
image create test foo -variable x
.c create image 50 60 -image foo -tags i1 -anchor nw
update
- .c create rectangle 55 65 75 70 -width 0 -fill black -outline {}
+ .c create rectangle 55 65 75 70 -width 0 -fill black -outline ""
set x {}
update
return $x
@@ -532,7 +522,6 @@ test image-12.6 {Tk_RedrawImage procedure, redisplay area clipping} -constraints
imageCleanup
} -result {{foo display 5 5 20 5 30 30}}
-
test image-13.1 {Tk_SizeOfImage procedure} -constraints testImageType -setup {
imageCleanup
} -body {