summaryrefslogtreecommitdiffstats
path: root/tests/iogt.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-03-27 16:47:33 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-03-27 16:47:33 (GMT)
commitced9a82b7f9ee609c525fbe2e9abca12b708c454 (patch)
tree5bba119f9617844150f2dd325d9cbf6d1db9cc07 /tests/iogt.test
parent8868d903d92c976f3c5eb3ea4a4a98862de6e6c0 (diff)
parentfaf7effffed566ae286f67f982029e5d7748cd40 (diff)
downloadtcl-ced9a82b7f9ee609c525fbe2e9abca12b708c454.zip
tcl-ced9a82b7f9ee609c525fbe2e9abca12b708c454.tar.gz
tcl-ced9a82b7f9ee609c525fbe2e9abca12b708c454.tar.bz2
Test iogt-2.4 is another segfault demo for [721ec69271].
Diffstat (limited to 'tests/iogt.test')
-rw-r--r--tests/iogt.test35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/iogt.test b/tests/iogt.test
index d4c31d2..bd3c67b 100644
--- a/tests/iogt.test
+++ b/tests/iogt.test
@@ -220,6 +220,26 @@ proc id_fulltrail {var op data} {
return $res
}
+proc id_torture {chan op data} {
+ switch -- $op {
+ create/write -
+ create/read -
+ delete/write -
+ delete/read -
+ clear_read {;#ignore}
+ flush/write -
+ flush/read -
+ write -
+ read {
+ testchannel unstack $chan
+ testchannel transform $chan \
+ -command [namespace code [list id_torture $chan]]
+ return $data
+ }
+ query/maxRead {return -1}
+ }
+}
+
proc counter {var op data} {
namespace upvar [namespace current] $var n
@@ -326,6 +346,11 @@ proc audit_ops {var -attach channel} {
proc audit_flow {var -attach channel} {
testchannel transform $channel -command [namespace code [list id_fulltrail $var]]
}
+
+proc torture {-attach channel} {
+ testchannel transform $channel -command [namespace code [list id_torture $channel]]
+}
+
proc stopafter {var n -attach channel} {
namespace upvar [namespace current] $var vn
set vn $n
@@ -546,6 +571,16 @@ delete/read {} *ignored*
flush/write {} {}
delete/write {} *ignored*}
+test iogt-2.4 {basic I/O, mixed trail} {testchannel} {
+ set fh [open $path(dummy) r]
+ torture -attach $fh
+ chan configure $fh -buffersize 2
+ set x [read $fh]
+ testchannel unstack $fh
+ close $fh
+ set x
+} {}
+
test iogt-3.0 {Tcl_Channel valid after stack/unstack, fevent handling} -setup {
proc DoneCopy {n {err {}}} {
variable copy 1