summaryrefslogtreecommitdiffstats
path: root/tests/imgPPM.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/imgPPM.test')
-rw-r--r--tests/imgPPM.test32
1 files changed, 7 insertions, 25 deletions
diff --git a/tests/imgPPM.test b/tests/imgPPM.test
index 160f2f2..a9e9dc0 100644
--- a/tests/imgPPM.test
+++ b/tests/imgPPM.test
@@ -7,17 +7,13 @@
# All rights reserved.
package require tcltest 2.1
-namespace import -force tcltest::configure
-namespace import -force tcltest::testsDirectory
-configure -testdir [file join [pwd] [file dirname [info script]]]
-configure -loadfile [file join [testsDirectory] constraints.tcl]
+eval tcltest::configure $argv
tcltest::loadTestedCommands
-namespace import -force tcltest::makeFile
-namespace import -force tcltest::removeFile
-
eval image delete [image names]
+# Note that we do not use [tcltest::makeFile] because it is
+# only suitable for text files
proc put {file data} {
set f [open $file w]
fconfigure $f -translation lf
@@ -72,8 +68,8 @@ test imgPPM-2.1 {FileWritePPM procedure} {
} {1 {couldn't open "not_a_dir/bar/baz/gorp": no such file or directory} {posix enoent {no such file or directory}}}
test imgPPM-2.2 {FileWritePPM procedure} {
catch {unset data}
- p1 write -format ppm test2.ppm
- set fd [open test2.ppm]
+ p1 write -format ppm test.ppm
+ set fd [open test.ppm]
set data [read $fd]
close $fd
set data
@@ -161,23 +157,9 @@ test imgPPM-4.1 {StringReadPPM procedure, data too short [Bug 1822391]} \
-returnCodes error \
-result {truncated PPM data}
-removeFile test.ppm
-removeFile test2.ppm
eval image delete [image names]
# cleanup
-::tcltest::cleanupTests
+catch {file delete test.ppm}
+cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-