summaryrefslogtreecommitdiffstats
path: root/tests/ioCmd.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-04-21 19:04:08 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-04-21 19:04:08 (GMT)
commite4bf3a0afd86328bf05bcf2c543f8d62d47a6a79 (patch)
tree812d23cc45f6ea63bd523ba8fc2c441a5c0d297f /tests/ioCmd.test
parent747725c1fcb5991ac7d83a1e7498fc6ddd69d7c4 (diff)
parent473f2fb8dd64dfcd8320aac7f260d55396842f7b (diff)
downloadtcl-e4bf3a0afd86328bf05bcf2c543f8d62d47a6a79.zip
tcl-e4bf3a0afd86328bf05bcf2c543f8d62d47a6a79.tar.gz
tcl-e4bf3a0afd86328bf05bcf2c543f8d62d47a6a79.tar.bz2
Merge refcounting machinery for ChannelBuffer.
Diffstat (limited to 'tests/ioCmd.test')
-rw-r--r--tests/ioCmd.test32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/ioCmd.test b/tests/ioCmd.test
index 0a61252..36339ec 100644
--- a/tests/ioCmd.test
+++ b/tests/ioCmd.test
@@ -812,6 +812,38 @@ test iocmd-21.20 {Bug 88aef05cda} -setup {
close $ch
rename foo {}
} -match glob -result {1 {*nested eval*}}
+test iocmd-21.21 {[close] in [read] segfaults} -setup {
+ proc foo {method chan args} {
+ switch -- $method initialize {
+ return {initialize finalize watch read}
+ } finalize {} watch {} read {
+ close $chan
+ return a
+ }
+ }
+ set ch [chan create read foo]
+} -body {
+ read $ch 0
+} -cleanup {
+ close $ch
+ rename foo {}
+} -result {}
+test iocmd-21.22 {[close] in [read] segfaults} -setup {
+ proc foo {method chan args} {
+ switch -- $method initialize {
+ return {initialize finalize watch read}
+ } finalize {} watch {} read {
+ catch {close $chan}
+ return a
+ }
+ }
+ set ch [chan create read foo]
+} -body {
+ read $ch 1
+} -returnCodes error -cleanup {
+ catch {close $ch}
+ rename foo {}
+} -match glob -result {*invalid argument*}
# --- --- --- --------- --------- ---------
# Helper commands to record the arguments to handler methods.