summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-04-30 19:54:51 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-04-30 19:54:51 (GMT)
commit1a41595e061cffe98e1a4001b69a5ac7bb5d2b90 (patch)
treeacaeb4805a0e2fcbd41822f04c25627ccf73c65b /tests
parent2d4cef6d561e385437a1543ad25d272e20997408 (diff)
downloadtcl-1a41595e061cffe98e1a4001b69a5ac7bb5d2b90.zip
tcl-1a41595e061cffe98e1a4001b69a5ac7bb5d2b90.tar.gz
tcl-1a41595e061cffe98e1a4001b69a5ac7bb5d2b90.tar.bz2
Stop the segfaults in [close] during [gets] tests.
Not sure this is the right behavior, but it's better than crashing.
Diffstat (limited to 'tests')
-rw-r--r--tests/ioCmd.test21
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/ioCmd.test b/tests/ioCmd.test
index d2c0173..bb133f9 100644
--- a/tests/ioCmd.test
+++ b/tests/ioCmd.test
@@ -818,10 +818,27 @@ test iocmd-21.23 {[close] in [gets] segfaults} -setup {
set ch [chan create read foo]
} -body {
gets $ch
-} -returnCodes error -cleanup {
+} -cleanup {
catch {close $ch}
rename foo {}
-} -match glob -result {*invalid argument*}
+} -result {}
+test iocmd-21.24 {[close] in binary [gets] segfaults} -setup {
+ proc foo {method chan args} {
+ switch -- $method initialize {
+ return {initialize finalize watch read}
+ } finalize {} watch {} read {
+ catch {close $chan}
+ return \n
+ }
+ }
+ set ch [chan create read foo]
+} -body {
+ chan configure $ch -translation binary
+ gets $ch
+} -cleanup {
+ catch {close $ch}
+ rename foo {}
+} -result {}
# --- --- --- --------- --------- ---------
# Helper commands to record the arguments to handler methods.