summaryrefslogtreecommitdiffstats
path: root/tests/iogt.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-05-16 14:47:15 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-05-16 14:47:15 (GMT)
commit6f8a00dcd5a10e71caf9e3d2f7067523c4ff0b28 (patch)
tree7d22c170916773ed8248dc5d4b42f9caaa291baf /tests/iogt.test
parent4830ed53a3b546ff699230e332c0a6d4fecf5a24 (diff)
parenteb476fdf9350b70cf8ab1ec90ad848dec9d1b75b (diff)
downloadtcl-6f8a00dcd5a10e71caf9e3d2f7067523c4ff0b28.zip
tcl-6f8a00dcd5a10e71caf9e3d2f7067523c4ff0b28.tar.gz
tcl-6f8a00dcd5a10e71caf9e3d2f7067523c4ff0b28.tar.bz2
Merge completion of dgp-read-bytes branch.
Diffstat (limited to 'tests/iogt.test')
-rw-r--r--tests/iogt.test52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/iogt.test b/tests/iogt.test
index 3882ecc..d4291b3 100644
--- a/tests/iogt.test
+++ b/tests/iogt.test
@@ -242,6 +242,36 @@ 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 {
+ global level
+ if {$level} {
+ return
+ }
+ incr level
+ testchannel unstack $chan
+ testchannel transform $chan \
+ -command [namespace code [list id_torture $chan]]
+ return $data
+ }
+ 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} {
variable $var
upvar 0 $var n
@@ -364,6 +394,10 @@ 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} {
variable $var
upvar 0 $var vn
@@ -632,6 +666,24 @@ 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-2.5 {basic I/O, mixed trail} {testchannel} {
+ set ::level 0
+ set fh [open $path(dummyout) w]
+ torture -attach $fh
+ puts -nonewline $fh abcdef
+ flush $fh
+ testchannel unstack $fh
+ close $fh
+} {}
test iogt-3.0 {Tcl_Channel valid after stack/unstack, fevent handling} \
{testchannel unknownFailure} {