summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-04-21 18:55:41 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-04-21 18:55:41 (GMT)
commita07adf4d6d28771d9aa74ef06526e5fb3035f5c1 (patch)
treef4294bd466e879159dfdc4825d23afe702d9183c /tests
parent87f75437c09a8e8fbe5fe0eaa68200c773799e28 (diff)
downloadtcl-a07adf4d6d28771d9aa74ef06526e5fb3035f5c1.zip
tcl-a07adf4d6d28771d9aa74ef06526e5fb3035f5c1.tar.gz
tcl-a07adf4d6d28771d9aa74ef06526e5fb3035f5c1.tar.bz2
Added a refcounting mechanism to ChannelBuffers. Other edits to
stop segfaults in tests iocmd-21.2[12].
Diffstat (limited to 'tests')
-rw-r--r--tests/ioCmd.test20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/ioCmd.test b/tests/ioCmd.test
index 184f773..8bf32d2 100644
--- a/tests/ioCmd.test
+++ b/tests/ioCmd.test
@@ -785,11 +785,27 @@ test iocmd-21.21 {[close] in [read] segfaults} -setup {
}
set ch [chan create read foo]
} -body {
- read $ch 1
+ read $ch 0
} -cleanup {
close $ch
rename foo {}
-} -result a
+} -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.