Subject: Test iogt-2.4 is another segfault demo for [721ec69271].

From: dgp <[email-masked]>
Date: Thu, 27 Mar 2014 16:44:04 +0000

---
 tests/iogt.test | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/tests/iogt.test b/tests/iogt.test
index 3882ecc..d54ae04 100644
--- a/tests/iogt.test
+++ b/tests/iogt.test
@@ -242,6 +242,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} {
     variable $var
     upvar 0 $var n
@@ -364,6 +384,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 +656,15 @@ 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} \
 	{testchannel unknownFailure} {
-- 
cgit v0.12