From 55bf49d15f4347284e30f07c67f8043b0669704f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 21 Jul 2020 13:22:08 +0000 Subject: Re-enable event-1.1, io-50.? and chan-io-50.? test-cases, trying to get a hand at the problem [f586089a2b] --- tests/chanio.test | 20 ++++++------ tests/event.test | 8 ++--- tests/io.test | 92 +++++++++++++++++++++++++++---------------------------- 3 files changed, 60 insertions(+), 60 deletions(-) diff --git a/tests/chanio.test b/tests/chanio.test index 67e0f24..5989bfe 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -6372,7 +6372,7 @@ test chan-io-49.5 {testing crlf reading, leftover cr disgorgment} -setup { test chan-io-50.1 {testing handler deletion} -setup { file delete $path(test1) -} -constraints {testchannelevent nonPortable} -body { +} -constraints testchannelevent -body { set f [open $path(test1) w] chan close $f set f [open $path(test1) r] @@ -6382,7 +6382,7 @@ test chan-io-50.1 {testing handler deletion} -setup { }] variable z not_called update - return $z + set z } -cleanup { chan close $f } -result called @@ -6390,7 +6390,7 @@ test chan-io-50.2 {testing handler deletion with multiple handlers} -setup { file delete $path(test1) chan close [open $path(test1) w] set z "" -} -constraints {testchannelevent nonPortable} -body { +} -constraints testchannelevent -body { set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list delhandler $f 1]] testchannelevent $f add readable [namespace code [list delhandler $f 0]] @@ -6409,7 +6409,7 @@ test chan-io-50.3 {testing handler deletion with multiple handlers} -setup { file delete $path(test1) chan close [open $path(test1) w] set z "" -} -constraints {testchannelevent nonPortable} -body { +} -constraints testchannelevent -body { set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list notcalled $f 1]] testchannelevent $f add readable [namespace code [list delhandler $f 0]] @@ -6435,7 +6435,7 @@ test chan-io-50.4 {testing handler deletion vs reentrant calls} -setup { file delete $path(test1) set f [open $path(test1) w] chan close $f -} -constraints {testchannelevent nonPortable} -body { +} -constraints testchannelevent -body { set f [open $path(test1) r] testchannelevent $f add readable [namespace code { if {$u eq "recursive"} { @@ -6450,7 +6450,7 @@ test chan-io-50.4 {testing handler deletion vs reentrant calls} -setup { variable u toplevel variable z "" update - return $z + set z } -cleanup { chan close $f } -result {{delrecursive calling recursive} {delrecursive deleting recursive}} @@ -6458,7 +6458,7 @@ test chan-io-50.5 {testing handler deletion vs reentrant calls} -setup { file delete $path(test1) set f [open $path(test1) w] chan close $f -} -constraints {testchannelevent nonPortable} -body { +} -constraints testchannelevent -body { set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list notcalled $f]] testchannelevent $f add readable [namespace code [list del $f]] @@ -6484,7 +6484,7 @@ test chan-io-50.5 {testing handler deletion vs reentrant calls} -setup { set z "" set u toplevel update - return $z + set z } -cleanup { chan close $f } -result [list {del calling recursive} {del deleted notcalled} \ @@ -6493,7 +6493,7 @@ test chan-io-50.6 {testing handler deletion vs reentrant calls} -setup { file delete $path(test1) set f [open $path(test1) w] chan close $f -} -constraints {testchannelevent nonPortable} -body { +} -constraints testchannelevent -body { set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list second $f]] testchannelevent $f add readable [namespace code [list first $f]] @@ -6527,7 +6527,7 @@ test chan-io-50.6 {testing handler deletion vs reentrant calls} -setup { set z "" set u toplevel update - return $z + set z } -cleanup { chan close $f } -result [list {first called} {first called not toplevel} \ diff --git a/tests/event.test b/tests/event.test index 6e6d116..336c4e4 100644 --- a/tests/event.test +++ b/tests/event.test @@ -27,7 +27,7 @@ testConstraint exec [llength [info commands exec]] test event-1.1 {Tcl_CreateFileHandler, reading} -setup { testfilehandler close set result "" -} -constraints {testfilehandler nonPortable} -body { +} -constraints testfilehandler -body { testfilehandler create 0 readable off testfilehandler clear 0 testfilehandler oneevent @@ -595,16 +595,16 @@ test event-11.7 {Bug 16828b3744} { test event-11.8 {Bug 16828b3744} -setup { oo::class create A { variable continue - + method start {} { after idle [self] destroy - + set continue 0 vwait [namespace current]::continue } destructor { set continue 1 - } + } } } -body { [A new] start diff --git a/tests/io.test b/tests/io.test index 7072b63..1a30850 100644 --- a/tests/io.test +++ b/tests/io.test @@ -123,10 +123,10 @@ test io-1.8 {Tcl_WriteChars: WriteChars} { # applied to tcl will cause tcl, more specifically WriteChars, to # go into an infinite loop. - set f [open $path(test2) w] - fconfigure $f -encoding iso2022-jp - puts -nonewline $f [format %s%c [string repeat " " 4] 12399] - close $f + set f [open $path(test2) w] + fconfigure $f -encoding iso2022-jp + puts -nonewline $f [format %s%c [string repeat " " 4] 12399] + close $f contents $path(test2) } " \x1b\$B\$O\x1b(B" @@ -192,7 +192,7 @@ test io-1.9 {Tcl_WriteChars: WriteChars} { test io-2.1 {WriteBytes} { # loop until all bytes are written - + set f [open $path(test1) w] fconfigure $f -encoding binary -buffersize 16 -translation crlf puts $f "abcdefghijklmnopqrstuvwxyz" @@ -214,7 +214,7 @@ test io-2.3 {WriteBytes: flush on line} { # Tcl "line" buffering has weird behavior: if current buffer contains # a \n, entire buffer gets flushed. Logical behavior would be to flush # only up to the \n. - + set f [open $path(test1) w] fconfigure $f -encoding binary -buffering line -translation crlf puts -nonewline $f "\n12" @@ -234,7 +234,7 @@ test io-2.4 {WriteBytes: reset sawLF after each buffer} { test io-3.1 {WriteChars: compatibility with WriteBytes} { # loop until all bytes are written - + set f [open $path(test1) w] fconfigure $f -encoding ascii -buffersize 16 -translation crlf puts $f "abcdefghijklmnopqrstuvwxyz" @@ -256,7 +256,7 @@ test io-3.3 {WriteChars: compatibility with WriteBytes: flush on line} { # Tcl "line" buffering has weird behavior: if current buffer contains # a \n, entire buffer gets flushed. Logical behavior would be to flush # only up to the \n. - + set f [open $path(test1) w] fconfigure $f -encoding ascii -buffering line -translation crlf puts -nonewline $f "\n12" @@ -268,7 +268,7 @@ test io-3.4 {WriteChars: loop over stage buffer} { # stage buffer maps to more than can be queued at once. set f [open $path(test1) w] - fconfigure $f -encoding jis0208 -buffersize 16 + fconfigure $f -encoding jis0208 -buffersize 16 puts -nonewline $f "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" set x [list [contents $path(test1)]] close $f @@ -280,7 +280,7 @@ test io-3.5 {WriteChars: saved != 0} { # requested buffersize. set f [open $path(test1) w] - fconfigure $f -encoding jis0208 -buffersize 17 + fconfigure $f -encoding jis0208 -buffersize 17 puts -nonewline $f "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" set x [list [contents $path(test1)]] close $f @@ -311,7 +311,7 @@ test io-3.7 {WriteChars: (bufPtr->nextAdded > bufPtr->length)} { # of the next channel buffer. set f [open $path(test1) w] - fconfigure $f -encoding jis0208 -buffersize 17 + fconfigure $f -encoding jis0208 -buffersize 17 puts -nonewline $f "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" set x [list [contents $path(test1)]] close $f @@ -381,7 +381,7 @@ test io-4.5 {TranslateOutputEOL: crlf} { test io-5.1 {CheckFlush: not full} { set f [open $path(test1) w] - fconfigure $f + fconfigure $f puts -nonewline $f "12345678901234567890" set x [list [contents $path(test1)]] close $f @@ -470,7 +470,7 @@ set a "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" append a $a append a $a test io-6.6 {Tcl_GetsObj: loop test} { - # if (dst >= dstEnd) + # if (dst >= dstEnd) set f [open $path(test1) w] puts $f $a @@ -769,7 +769,7 @@ test io-6.32 {Tcl_GetsObj: crlf mode: buffer exhausted, more data} {testchannel} } [list 15 "123456789012345" 17 3] test io-6.33 {Tcl_GetsObj: crlf mode: buffer exhausted, at eof} { # eol still equals dstEnd - + set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456789012345\r" @@ -781,8 +781,8 @@ test io-6.33 {Tcl_GetsObj: crlf mode: buffer exhausted, at eof} { set x } [list 16 "123456789012345\r" 1] test io-6.34 {Tcl_GetsObj: crlf mode: buffer exhausted, not followed by \n} { - # not (*eol == '\n') - + # not (*eol == '\n') + set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456789012345\rabcd\r\nefg" @@ -889,7 +889,7 @@ test io-6.43 {Tcl_GetsObj: input saw cr} {stdio testchannel openpipe fileevent} fconfigure $f -buffersize 16 set x [list [gets $f]] fconfigure $f -blocking 0 - lappend x [gets $f line] $line [testchannel queuedcr $f] + lappend x [gets $f line] $line [testchannel queuedcr $f] fconfigure $f -blocking 1 puts -nonewline $f "\nabcd\refg\x1a" lappend x [gets $f line] $line [testchannel queuedcr $f] @@ -898,7 +898,7 @@ test io-6.43 {Tcl_GetsObj: input saw cr} {stdio testchannel openpipe fileevent} set x } [list "bbbbbbbbbbbbbbb" 15 "123456789abcdef" 1 4 "abcd" 0 3 "efg"] test io-6.44 {Tcl_GetsObj: input saw cr, not followed by cr} {stdio testchannel openpipe fileevent} { - # not (*eol == '\n') + # not (*eol == '\n') set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -translation {auto lf} -buffering none @@ -906,7 +906,7 @@ test io-6.44 {Tcl_GetsObj: input saw cr, not followed by cr} {stdio testchannel fconfigure $f -buffersize 16 set x [list [gets $f]] fconfigure $f -blocking 0 - lappend x [gets $f line] $line [testchannel queuedcr $f] + lappend x [gets $f line] $line [testchannel queuedcr $f] fconfigure $f -blocking 1 puts -nonewline $f "abcd\refg\x1a" lappend x [gets $f line] $line [testchannel queuedcr $f] @@ -959,10 +959,10 @@ test io-6.47 {Tcl_GetsObj: auto mode: \r at end of buffer, peek for \n} {testcha set x [list [gets $f] [testchannel inputbuffered $f]] close $f set x -} [list "123456789012345" 15] +} [list "123456789012345" 15] test io-6.48 {Tcl_GetsObj: auto mode: \r at end of buffer, no more avail} {testchannel} { # PeekAhead() did not get any, so (eol >= dstEnd) - + set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456789012345\r" @@ -975,7 +975,7 @@ test io-6.48 {Tcl_GetsObj: auto mode: \r at end of buffer, no more avail} {testc } [list "123456789012345" 1] test io-6.49 {Tcl_GetsObj: auto mode: \r followed by \n} {testchannel} { # if (*eol == '\n') {skip++} - + set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456\r\n78901" @@ -986,8 +986,8 @@ test io-6.49 {Tcl_GetsObj: auto mode: \r followed by \n} {testchannel} { set x } [list "123456" 0 8 "78901"] test io-6.50 {Tcl_GetsObj: auto mode: \r not followed by \n} {testchannel} { - # not (*eol == '\n') - + # not (*eol == '\n') + set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456\r78901" @@ -999,7 +999,7 @@ test io-6.50 {Tcl_GetsObj: auto mode: \r not followed by \n} {testchannel} { } [list "123456" 0 7 "78901"] test io-6.51 {Tcl_GetsObj: auto mode: \n} { # else if (*eol == '\n') {goto gotoeol;} - + set f [open $path(test1) w] fconfigure $f -translation lf puts -nonewline $f "123456\n78901" @@ -1092,7 +1092,7 @@ test io-7.1 {FilterInputBytes: split up character at end of buffer} { } "1234567890123\uff10\uff11\uff12\uff13\uff14" test io-7.2 {FilterInputBytes: split up character in middle of buffer} { # (bufPtr->nextAdded < bufPtr->bufLength) - + set f [open $path(test1) w] fconfigure $f -encoding binary puts -nonewline $f "1234567890\n123\x82\x4f\x82\x50\x82" @@ -1201,7 +1201,7 @@ test io-8.4 {PeekAhead: cached data available in this buffer} { set x [gets $f] close $f - set x + set x } $a unset a test io-8.5 {PeekAhead: don't peek if last read was short} {stdio testchannel openpipe fileevent} { @@ -1217,7 +1217,7 @@ test io-8.5 {PeekAhead: don't peek if last read was short} {stdio testchannel op set x } {15 abcdefghijklmno 1} test io-8.6 {PeekAhead: change to non-blocking mode} {stdio testchannel openpipe fileevent} { - # ((chanPtr->flags & CHANNEL_NONBLOCKING) == 0) + # ((chanPtr->flags & CHANNEL_NONBLOCKING) == 0) set f [open "|[list [interpreter] $path(cat)]" w+] fconfigure $f -translation {auto binary} -buffersize 16 @@ -1574,7 +1574,7 @@ test io-13.2 {TranslateInputEOL: crlf mode} { set x } "abcd\ndef\n" test io-13.3 {TranslateInputEOL: crlf mode: naked cr} { - # (src >= srcMax) + # (src >= srcMax) set f [open $path(test1) w] fconfigure $f -translation lf @@ -1587,7 +1587,7 @@ test io-13.3 {TranslateInputEOL: crlf mode: naked cr} { set x } "abcd\ndef\r" test io-13.4 {TranslateInputEOL: crlf mode: cr followed by not \n} { - # (src >= srcMax) + # (src >= srcMax) set f [open $path(test1) w] fconfigure $f -translation lf @@ -1600,7 +1600,7 @@ test io-13.4 {TranslateInputEOL: crlf mode: cr followed by not \n} { set x } "abcd\ndef\rfgh" test io-13.5 {TranslateInputEOL: crlf mode: naked lf} { - # (src >= srcMax) + # (src >= srcMax) set f [open $path(test1) w] fconfigure $f -translation lf @@ -1715,7 +1715,7 @@ test io-13.9 {TranslateInputEOL: auto mode: \r followed by not \n} { set x } "abcd\ndef" test io-13.10 {TranslateInputEOL: auto mode: \n} { - # not (*src == '\r') + # not (*src == '\r') set f [open $path(test1) w] fconfigure $f -translation lf @@ -2064,7 +2064,7 @@ test io-20.1 {Tcl_CreateChannel: initial settings} { encoding system $old close $a set x -} {ascii} +} {ascii} test io-20.2 {Tcl_CreateChannel: initial settings} {win} { set f [open $path(test1) w+] set x [list [fconfigure $f -eofchar] [fconfigure $f -translation]] @@ -2159,7 +2159,7 @@ test io-26.1 {Tcl_GetChannelInstanceData} {stdio openpipe} { set f [open "|[list [interpreter] << exit]"] expr [pid $f] close $f -} {} +} {} # Test flushing. The functions tested here are FlushChannel. @@ -3057,7 +3057,7 @@ test io-30.6 {Tcl_Write cr, Tcl_Read crlf} { fconfigure $f -translation crlf set x [read $f] close $f - set x + set x } "hello\rthere\rand\rhere\r" test io-30.7 {Tcl_Write crlf, Tcl_Read crlf} { file delete $path(test1) @@ -3985,7 +3985,7 @@ test io-31.31 {Tcl_Write crlf on block boundary, Tcl_Gets crlf} { } close $f set f [open $path(test1) r] - fconfigure $f -translation crlf + fconfigure $f -translation crlf set c "" while {[gets $f line] >= 0} { append c $line\n @@ -5474,7 +5474,7 @@ test io-39.13 {Tcl_SetChannelOption, Tcl_GetChannelOption, buffer size} { test io-39.14 {Tcl_SetChannelOption: -encoding, binary & utf-8} { file delete $path(test1) set f [open $path(test1) w] - fconfigure $f -encoding {} + fconfigure $f -encoding {} puts -nonewline $f \xe7\x89\xa6 close $f set f [open $path(test1) r] @@ -6719,7 +6719,7 @@ test io-49.5 {testing crlf reading, leftover cr disgorgment} { set l } [list 7 a\rb\rc 7 {} 7 1] -test io-50.1 {testing handler deletion} {testchannelevent nonPortable} { +test io-50.1 {testing handler deletion} testchannelevent { file delete $path(test1) set f [open $path(test1) w] close $f @@ -6735,7 +6735,7 @@ test io-50.1 {testing handler deletion} {testchannelevent nonPortable} { close $f set z } called -test io-50.2 {testing handler deletion with multiple handlers} {testchannelevent nonPortable} { +test io-50.2 {testing handler deletion with multiple handlers} testchannelevent { file delete $path(test1) set f [open $path(test1) w] close $f @@ -6753,7 +6753,7 @@ test io-50.2 {testing handler deletion with multiple handlers} {testchannelevent string compare [string tolower $z] \ [list [list called delhandler $f 0] [list called delhandler $f 1]] } 0 -test io-50.3 {testing handler deletion with multiple handlers} {testchannelevent nonPortable} { +test io-50.3 {testing handler deletion with multiple handlers} testchannelevent { file delete $path(test1) set f [open $path(test1) w] close $f @@ -6779,7 +6779,7 @@ test io-50.3 {testing handler deletion with multiple handlers} {testchannelevent [list [list delhandler $f 0 called] \ [list delhandler $f 0 deleted myself]] } 0 -test io-50.4 {testing handler deletion vs reentrant calls} {testchannelevent nonPortable} { +test io-50.4 {testing handler deletion vs reentrant calls} testchannelevent { file delete $path(test1) set f [open $path(test1) w] close $f @@ -6803,7 +6803,7 @@ test io-50.4 {testing handler deletion vs reentrant calls} {testchannelevent non close $f set z } {{delrecursive calling recursive} {delrecursive deleting recursive}} -test io-50.5 {testing handler deletion vs reentrant calls} {testchannelevent nonPortable} { +test io-50.5 {testing handler deletion vs reentrant calls} testchannelevent { file delete $path(test1) set f [open $path(test1) w] close $f @@ -6833,10 +6833,10 @@ test io-50.5 {testing handler deletion vs reentrant calls} {testchannelevent non set u toplevel update close $f - set z + set z } [list {del calling recursive} {del deleted notcalled} \ {del deleted myself} {del after update}] -test io-50.6 {testing handler deletion vs reentrant calls} {testchannelevent nonPortable} { +test io-50.6 {testing handler deletion vs reentrant calls} testchannelevent { file delete $path(test1) set f [open $path(test1) w] close $f @@ -8648,11 +8648,11 @@ test io-74.1 {[104f2885bb] improper cache validity check} -setup { interp create slave } -constraints testobj -body { teststringobj set 1 [string range $rfd 0 end] - read [teststringobj get 1] + read [teststringobj get 1] testobj duplicate 1 2 interp transfer {} $rfd slave catch {read [teststringobj get 1]} - read [teststringobj get 2] + read [teststringobj get 2] } -cleanup { interp delete slave testobj freeallvars -- cgit v0.12 From 7fba80338f20600d84ce7685436e377329c4c970 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 22 Jul 2020 15:28:39 +0000 Subject: Convert test-cases to do proper setup/cleanup --- tests/io.test | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/tests/io.test b/tests/io.test index 1a30850..86e426c 100644 --- a/tests/io.test +++ b/tests/io.test @@ -6719,8 +6719,9 @@ test io-49.5 {testing crlf reading, leftover cr disgorgment} { set l } [list 7 a\rb\rc 7 {} 7 1] -test io-50.1 {testing handler deletion} testchannelevent { +test io-50.1 {testing handler deletion} -constraints testchannelevent -setup { file delete $path(test1) +} -body { set f [open $path(test1) w] close $f set f [open $path(test1) r] @@ -6732,11 +6733,13 @@ test io-50.1 {testing handler deletion} testchannelevent { } set z not_called update - close $f set z -} called -test io-50.2 {testing handler deletion with multiple handlers} testchannelevent { +} -cleanup { + close $f +} -result called +test io-50.2 {testing handler deletion with multiple handlers} -constraints testchannelevent -setup { file delete $path(test1) +} -body { set f [open $path(test1) w] close $f set f [open $path(test1) r] @@ -6749,12 +6752,14 @@ test io-50.2 {testing handler deletion with multiple handlers} testchannelevent } set z "" update - close $f string compare [string tolower $z] \ [list [list called delhandler $f 0] [list called delhandler $f 1]] -} 0 -test io-50.3 {testing handler deletion with multiple handlers} testchannelevent { +} -cleanup { + close $f +} -result 0 +test io-50.3 {testing handler deletion with multiple handlers} -constraints testchannelevent -setup { file delete $path(test1) +} -body { set f [open $path(test1) w] close $f set f [open $path(test1) r] @@ -6774,13 +6779,15 @@ test io-50.3 {testing handler deletion with multiple handlers} testchannelevent } set z "" update - close $f string compare [string tolower $z] \ [list [list delhandler $f 0 called] \ [list delhandler $f 0 deleted myself]] -} 0 -test io-50.4 {testing handler deletion vs reentrant calls} testchannelevent { +} -cleanup { + close $f +} -result 0 +test io-50.4 {testing handler deletion vs reentrant calls} -constraints testchannelevent -setup { file delete $path(test1) +} -body { set f [open $path(test1) w] close $f set f [open $path(test1) r] @@ -6800,11 +6807,13 @@ test io-50.4 {testing handler deletion vs reentrant calls} testchannelevent { variable u toplevel variable z "" update - close $f set z -} {{delrecursive calling recursive} {delrecursive deleting recursive}} -test io-50.5 {testing handler deletion vs reentrant calls} testchannelevent { +} -cleanup { + close $f +} -result {{delrecursive calling recursive} {delrecursive deleting recursive}} +test io-50.5 {testing handler deletion vs reentrant calls} -constraints testchannelevent -setup { file delete $path(test1) +} -body { set f [open $path(test1) w] close $f set f [open $path(test1) r] @@ -6834,10 +6843,12 @@ test io-50.5 {testing handler deletion vs reentrant calls} testchannelevent { update close $f set z -} [list {del calling recursive} {del deleted notcalled} \ +} -cleanup { +} -result [list {del calling recursive} {del deleted notcalled} \ {del deleted myself} {del after update}] -test io-50.6 {testing handler deletion vs reentrant calls} testchannelevent { +test io-50.6 {testing handler deletion vs reentrant calls} -constraints testchannelevent -setup { file delete $path(test1) +} -body { set f [open $path(test1) w] close $f set f [open $path(test1) r] @@ -6873,9 +6884,10 @@ test io-50.6 {testing handler deletion vs reentrant calls} testchannelevent { set z "" set u toplevel update - close $f set z -} [list {first called} {first called not toplevel} \ +} -cleanup { + close $f +} -result [list {first called} {first called not toplevel} \ {second called, first time} {second called, second time} \ {first after update}] -- cgit v0.12 From 0d231a3919435409be9374f0a792e364e804b20c Mon Sep 17 00:00:00 2001 From: culler Date: Thu, 23 Jul 2020 13:32:03 +0000 Subject: Check if reverting from os_unfair_lock to OSSpinLock has any effect. --- macosx/tclMacOSXNotify.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/macosx/tclMacOSXNotify.c b/macosx/tclMacOSXNotify.c index bbbac65..7f451c7 100644 --- a/macosx/tclMacOSXNotify.c +++ b/macosx/tclMacOSXNotify.c @@ -20,11 +20,13 @@ * OSSpinLock, and the OSSpinLock was deprecated. */ +#if 0 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200 #define USE_OS_UNFAIR_LOCK #include #undef TCL_MAC_DEBUG_NOTIFIER #endif +#endif #ifdef HAVE_COREFOUNDATION /* Traditional unix select-based notifier is * in tclUnixNotfy.c */ -- cgit v0.12 From 9557127009db74d0f4196e17d6cf1f536ef73547 Mon Sep 17 00:00:00 2001 From: culler Date: Thu, 6 Aug 2020 13:09:22 +0000 Subject: Experiment with chan-io-50.6 on Travis --- tests/chanio.test | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/chanio.test b/tests/chanio.test index cdaf183..5266d57 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -6497,9 +6497,6 @@ test chan-io-50.6 {testing handler deletion vs reentrant calls} -setup { set f [open $path(test1) w] chan close $f } -constraints testchannelevent -body { - set f [open $path(test1) r] - testchannelevent $f add readable [namespace code [list second $f]] - testchannelevent $f add readable [namespace code [list first $f]] proc first {f} { variable u variable z @@ -6529,11 +6526,21 @@ test chan-io-50.6 {testing handler deletion vs reentrant calls} -setup { } set z "" set u toplevel + # Testing why this test fails on Travis: + # The test appears to assume that select will not detect the + # new file until update is called. + lappend z "1" + set f [open $path(test1) r] + lappend z "2" + testchannelevent $f add readable [namespace code [list second $f]] + lappend z "3" + testchannelevent $f add readable [namespace code [list first $f]] + lappend z "update" update set z } -cleanup { chan close $f -} -result [list {first called} {first called not toplevel} \ +} -result [list 1 2 3 update {first called} {first called not toplevel} \ {second called, first time} {second called, second time} \ {first after update}] -- cgit v0.12 From f460900f9f25ca6b02f7e5de803eb63a84a2d12a Mon Sep 17 00:00:00 2001 From: culler Date: Fri, 7 Aug 2020 13:12:21 +0000 Subject: Experiment with io-50.1 on Travis --- tests/chanio.test | 11 ++++------- tests/io.test | 9 +++++---- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/tests/chanio.test b/tests/chanio.test index 5266d57..7ffe492 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -6526,16 +6526,13 @@ test chan-io-50.6 {testing handler deletion vs reentrant calls} -setup { } set z "" set u toplevel - # Testing why this test fails on Travis: - # The test appears to assume that select will not detect the - # new file until update is called. - lappend z "1" + # This test assume that select will not detect the new open file + # until the update command runs. This is not guaranteed, but it + # seems to help if we make sure that the calls to testchannelevent + # immediately follow the call to open. set f [open $path(test1) r] - lappend z "2" testchannelevent $f add readable [namespace code [list second $f]] - lappend z "3" testchannelevent $f add readable [namespace code [list first $f]] - lappend z "update" update set z } -cleanup { diff --git a/tests/io.test b/tests/io.test index 912f4c5..c9019af 100644 --- a/tests/io.test +++ b/tests/io.test @@ -6725,17 +6725,18 @@ test io-49.5 {testing crlf reading, leftover cr disgorgment} { test io-50.1 {testing handler deletion} -constraints testchannelevent -setup { file delete $path(test1) } -body { - set f [open $path(test1) w] - close $f - set f [open $path(test1) r] - testchannelevent $f add readable [namespace code [list delhandler $f]] proc delhandler {f} { variable z set z called testchannelevent $f delete 0 } + set f [open $path(test1) w] + close $f set z not_called update + set f [open $path(test1) r] + testchannelevent $f add readable [namespace code [list delhandler $f]] + update set z } -cleanup { close $f -- cgit v0.12 From bb9b5e7606e6deecd6b7bfc7683be22d1c5c90b6 Mon Sep 17 00:00:00 2001 From: culler Date: Fri, 7 Aug 2020 13:15:31 +0000 Subject: Fix the expected result for chanio-50.6 --- tests/chanio.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/chanio.test b/tests/chanio.test index 7ffe492..4f348f8 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -6537,7 +6537,7 @@ test chan-io-50.6 {testing handler deletion vs reentrant calls} -setup { set z } -cleanup { chan close $f -} -result [list 1 2 3 update {first called} {first called not toplevel} \ +} -result [list {first called} {first called not toplevel} \ {second called, first time} {second called, second time} \ {first after update}] -- cgit v0.12 From 4b765a3aff40f73f918d159af41222d1ce972b24 Mon Sep 17 00:00:00 2001 From: culler Date: Sat, 8 Aug 2020 21:27:06 +0000 Subject: Add and use testservicemode command; replace update by vwait --- generic/tclTest.c | 52 ++++++++++++++++++++++++++++- tests/chanio.test | 42 +++++++++++++++-------- tests/event.test | 1 + tests/io.test | 99 ++++++++++++++++++++++++++++++++++--------------------- 4 files changed, 141 insertions(+), 53 deletions(-) diff --git a/generic/tclTest.c b/generic/tclTest.c index 37aafd2..fde7190 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -307,7 +307,7 @@ static Tcl_FSNormalizePathProc TestReportNormalizePath; static Tcl_FSPathInFilesystemProc TestReportInFilesystem; static Tcl_FSFreeInternalRepProc TestReportFreeInternalRep; static Tcl_FSDupInternalRepProc TestReportDupInternalRep; - +static Tcl_CmdProc TestServiceModeCmd; static Tcl_FSStatProc SimpleStat; static Tcl_FSAccessProc SimpleAccess; static Tcl_FSOpenFileChannelProc SimpleOpenFileChannel; @@ -561,6 +561,8 @@ Tcltest_Init( NULL, NULL); Tcl_CreateObjCommand(interp, "testsaveresult", TestsaveresultCmd, NULL, NULL); + Tcl_CreateCommand(interp, "testservicemode", TestServiceModeCmd, + NULL, NULL); Tcl_CreateCommand(interp, "testsetassocdata", TestsetassocdataCmd, NULL, NULL); Tcl_CreateCommand(interp, "testsetnoerr", TestsetCmd, @@ -6049,6 +6051,54 @@ TestChannelEventCmd( /* *---------------------------------------------------------------------- * + * TestServiceModeCmd -- + * + * This procedure implements the "testservicemode" command which gets or + * sets the current Tcl ServiceMode. There are several tests which open + * a file and assign various handlers to it. For these tests to be + * deterministic it is important that file events not be processed until + * all of the handlers are in place. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * May change the ServiceMode setting. + * + *---------------------------------------------------------------------- + */ + +static int +TestServiceModeCmd( + ClientData dummy, /* Not used. */ + Tcl_Interp *interp, /* Current interpreter. */ + int argc, /* Number of arguments. */ + const char **argv) /* Argument strings. */ +{ + int newmode, oldmode; + if (argc > 2) { + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + " ?newmode?\"", NULL); + return TCL_ERROR; + } + oldmode = (Tcl_GetServiceMode() != TCL_SERVICE_NONE); + if (argc == 2) { + if (Tcl_GetInt(interp, argv[1], &newmode) == TCL_ERROR) { + return TCL_ERROR; + } + if (newmode == 0) { + Tcl_SetServiceMode(TCL_SERVICE_NONE); + } else { + Tcl_SetServiceMode(TCL_SERVICE_ALL); + } + } + Tcl_SetObjResult(interp, Tcl_NewIntObj(oldmode)); + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * * TestWrongNumArgsObjCmd -- * * Test the Tcl_WrongNumArgs function. diff --git a/tests/chanio.test b/tests/chanio.test index 4f348f8..c48fe63 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -6394,14 +6394,16 @@ test chan-io-50.2 {testing handler deletion with multiple handlers} -setup { chan close [open $path(test1) w] set z "" } -constraints testchannelevent -body { - set f [open $path(test1) r] - testchannelevent $f add readable [namespace code [list delhandler $f 1]] - testchannelevent $f add readable [namespace code [list delhandler $f 0]] proc delhandler {f i} { variable z lappend z "called delhandler $f $i" testchannelevent $f delete 0 } + testservicemode 0 + set f [open $path(test1) r] + testchannelevent $f add readable [namespace code [list delhandler $f 1]] + testchannelevent $f add readable [namespace code [list delhandler $f 0]] + testservicemode 1 update string equal $z \ [list [list called delhandler $f 0] [list called delhandler $f 1]] @@ -6411,11 +6413,8 @@ test chan-io-50.2 {testing handler deletion with multiple handlers} -setup { test chan-io-50.3 {testing handler deletion with multiple handlers} -setup { file delete $path(test1) chan close [open $path(test1) w] - set z "" + update } -constraints testchannelevent -body { - set f [open $path(test1) r] - testchannelevent $f add readable [namespace code [list notcalled $f 1]] - testchannelevent $f add readable [namespace code [list delhandler $f 0]] proc notcalled {f i} { variable z lappend z "notcalled was called!! $f $i" @@ -6427,6 +6426,12 @@ test chan-io-50.3 {testing handler deletion with multiple handlers} -setup { testchannelevent $f delete 0 lappend z "delhandler $f $i deleted myself" } + set z "" + testservicemode 0 + set f [open $path(test1) r] + testchannelevent $f add readable [namespace code [list notcalled $f 1]] + testchannelevent $f add readable [namespace code [list delhandler $f 0]] + testservicemode 1 update string equal $z \ [list [list delhandler $f 0 called] \ @@ -6438,6 +6443,7 @@ test chan-io-50.4 {testing handler deletion vs reentrant calls} -setup { file delete $path(test1) set f [open $path(test1) w] chan close $f + update } -constraints testchannelevent -body { set f [open $path(test1) r] testchannelevent $f add readable [namespace code { @@ -6456,15 +6462,14 @@ test chan-io-50.4 {testing handler deletion vs reentrant calls} -setup { set z } -cleanup { chan close $f + update } -result {{delrecursive calling recursive} {delrecursive deleting recursive}} test chan-io-50.5 {testing handler deletion vs reentrant calls} -setup { file delete $path(test1) set f [open $path(test1) w] chan close $f + update } -constraints testchannelevent -body { - set f [open $path(test1) r] - testchannelevent $f add readable [namespace code [list notcalled $f]] - testchannelevent $f add readable [namespace code [list del $f]] proc notcalled {f} { variable z lappend z "notcalled was called!! $f" @@ -6480,22 +6485,31 @@ test chan-io-50.5 {testing handler deletion vs reentrant calls} -setup { } else { set u recursive lappend z "del calling recursive" + set mode [test servicemode 1] update + test servicemode $mode lappend z "del after update" } } set z "" set u toplevel + testservicemode 0 + set f [open $path(test1) r] + testchannelevent $f add readable [namespace code [list notcalled $f]] + testservicemode 1 + testchannelevent $f add readable [namespace code [list del $f]] update set z } -cleanup { chan close $f + update } -result [list {del calling recursive} {del deleted notcalled} \ {del deleted myself} {del after update}] test chan-io-50.6 {testing handler deletion vs reentrant calls} -setup { file delete $path(test1) set f [open $path(test1) w] chan close $f + update } -constraints testchannelevent -body { proc first {f} { variable u @@ -6503,7 +6517,9 @@ test chan-io-50.6 {testing handler deletion vs reentrant calls} -setup { if {$u eq "toplevel"} { lappend z "first called" set u first + set mode [testservicemode 1] update + testservicemode $mode lappend z "first after update" } else { lappend z "first called not toplevel" @@ -6526,13 +6542,11 @@ test chan-io-50.6 {testing handler deletion vs reentrant calls} -setup { } set z "" set u toplevel - # This test assume that select will not detect the new open file - # until the update command runs. This is not guaranteed, but it - # seems to help if we make sure that the calls to testchannelevent - # immediately follow the call to open. + testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list second $f]] testchannelevent $f add readable [namespace code [list first $f]] + testservicemode 1 update set z } -cleanup { diff --git a/tests/event.test b/tests/event.test index 336c4e4..b42909c 100644 --- a/tests/event.test +++ b/tests/event.test @@ -33,6 +33,7 @@ test event-1.1 {Tcl_CreateFileHandler, reading} -setup { testfilehandler oneevent lappend result [testfilehandler counts 0] testfilehandler fillpartial 0 + update idletasks testfilehandler oneevent lappend result [testfilehandler counts 0] testfilehandler oneevent diff --git a/tests/io.test b/tests/io.test index c9019af..cfa08ed 100644 --- a/tests/io.test +++ b/tests/io.test @@ -6725,18 +6725,22 @@ test io-49.5 {testing crlf reading, leftover cr disgorgment} { test io-50.1 {testing handler deletion} -constraints testchannelevent -setup { file delete $path(test1) } -body { + set f [open $path(test1) w] + close $f + update proc delhandler {f} { variable z set z called testchannelevent $f delete 0 } - set f [open $path(test1) w] - close $f set z not_called - update + set timer [after 50 lappend z timeout] + testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list delhandler $f]] - update + testservicemode 1 + vwait z + after cancel $timer set z } -cleanup { close $f @@ -6746,29 +6750,27 @@ test io-50.2 {testing handler deletion with multiple handlers} -constraints test } -body { set f [open $path(test1) w] close $f - set f [open $path(test1) r] - testchannelevent $f add readable [namespace code [list delhandler $f 1]] - testchannelevent $f add readable [namespace code [list delhandler $f 0]] proc delhandler {f i} { variable z - lappend z "called delhandler $f $i" + lappend z "called delhandler $i" testchannelevent $f delete 0 } set z "" + testservicemode 0 + set f [open $path(test1) r] + testchannelevent $f add readable [namespace code [list delhandler $f 1]] + testchannelevent $f add readable [namespace code [list delhandler $f 0]] + testservicemode 1 update - string compare [string tolower $z] \ - [list [list called delhandler $f 0] [list called delhandler $f 1]] + set z } -cleanup { close $f -} -result 0 +} -result {{called delhandler 0} {called delhandler 1}} test io-50.3 {testing handler deletion with multiple handlers} -constraints testchannelevent -setup { file delete $path(test1) } -body { set f [open $path(test1) w] close $f - set f [open $path(test1) r] - testchannelevent $f add readable [namespace code [list notcalled $f 1]] - testchannelevent $f add readable [namespace code [list delhandler $f 0]] set z "" proc notcalled {f i} { variable z @@ -6777,25 +6779,30 @@ test io-50.3 {testing handler deletion with multiple handlers} -constraints test proc delhandler {f i} { variable z testchannelevent $f delete 1 - lappend z "delhandler $f $i called" + lappend z "delhandler $i called" testchannelevent $f delete 0 - lappend z "delhandler $f $i deleted myself" + lappend z "delhandler $i deleted myself" } set z "" - update - string compare [string tolower $z] \ - [list [list delhandler $f 0 called] \ - [list delhandler $f 0 deleted myself]] + testservicemode 0 + set f [open $path(test1) r] + testchannelevent $f add readable [namespace code [list notcalled $f 1]] + testchannelevent $f add readable [namespace code [list delhandler $f 0]] + testservicemode 1 + set timer [after 50 lappend z timeout] + vwait z + after cancel $timer + set z } -cleanup { close $f -} -result 0 +} -result {{delhandler 0 called} {delhandler 0 deleted myself}} test io-50.4 {testing handler deletion vs reentrant calls} -constraints testchannelevent -setup { file delete $path(test1) + update } -body { set f [open $path(test1) w] close $f - set f [open $path(test1) r] - testchannelevent $f add readable [namespace code [list delrecursive $f]] + update proc delrecursive {f} { variable z variable u @@ -6810,7 +6817,13 @@ test io-50.4 {testing handler deletion vs reentrant calls} -constraints testchan } variable u toplevel variable z "" - update + testservicemode 0 + set f [open $path(test1) r] + testchannelevent $f add readable [namespace code [list delrecursive $f]] + testservicemode 1 + set timer [after 50 lappend z timeout] + vwait z + after cancel $timer set z } -cleanup { close $f @@ -6820,9 +6833,6 @@ test io-50.5 {testing handler deletion vs reentrant calls} -constraints testchan } -body { set f [open $path(test1) w] close $f - set f [open $path(test1) r] - testchannelevent $f add readable [namespace code [list notcalled $f]] - testchannelevent $f add readable [namespace code [list del $f]] proc notcalled {f} { variable z lappend z "notcalled was called!! $f" @@ -6832,40 +6842,48 @@ test io-50.5 {testing handler deletion vs reentrant calls} -constraints testchan variable z if {"$u" == "recursive"} { testchannelevent $f delete 1 - testchannelevent $f delete 0 lappend z "del deleted notcalled" + testchannelevent $f delete 0 lappend z "del deleted myself" } else { set u recursive lappend z "del calling recursive" - update - lappend z "del after update" + set timer [after 50 lappend z timeout] + vwait z + after cancel $timer + lappend z "del after recursive" } } set z "" set u toplevel - update + testservicemode 0 + set f [open $path(test1) r] + testchannelevent $f add readable [namespace code [list notcalled $f]] + testchannelevent $f add readable [namespace code [list del $f]] + testservicemode 1 + set timer [after 50 set z timeout] + vwait z + after cancel $timer set z } -cleanup { close $f } -result [list {del calling recursive} {del deleted notcalled} \ - {del deleted myself} {del after update}] + {del deleted myself} {del after recursive}] test io-50.6 {testing handler deletion vs reentrant calls} -constraints testchannelevent -setup { file delete $path(test1) } -body { set f [open $path(test1) w] close $f - set f [open $path(test1) r] - testchannelevent $f add readable [namespace code [list second $f]] - testchannelevent $f add readable [namespace code [list first $f]] proc first {f} { variable u variable z if {"$u" == "toplevel"} { lappend z "first called" set u first - update - lappend z "first after update" + set timer [after 50 lappend z timeout] + vwait z + after cancel $timer + lappend z "first after toplevel" } else { lappend z "first called not toplevel" } @@ -6887,13 +6905,18 @@ test io-50.6 {testing handler deletion vs reentrant calls} -constraints testchan } set z "" set u toplevel + testservicemode 0 + set f [open $path(test1) r] + testchannelevent $f add readable [namespace code [list second $f]] + testchannelevent $f add readable [namespace code [list first $f]] + testservicemode 1 update set z } -cleanup { close $f } -result [list {first called} {first called not toplevel} \ {second called, first time} {second called, second time} \ - {first after update}] + {first after toplevel}] test io-51.1 {Test old socket deletion on Macintosh} {socket} { set x 0 -- cgit v0.12 From 1cadacd498aa05465ad599e11c5deb0a913d1631 Mon Sep 17 00:00:00 2001 From: culler Date: Sat, 8 Aug 2020 21:37:18 +0000 Subject: One more vwait. --- tests/io.test | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/io.test b/tests/io.test index cfa08ed..a81e394 100644 --- a/tests/io.test +++ b/tests/io.test @@ -6761,7 +6761,9 @@ test io-50.2 {testing handler deletion with multiple handlers} -constraints test testchannelevent $f add readable [namespace code [list delhandler $f 1]] testchannelevent $f add readable [namespace code [list delhandler $f 0]] testservicemode 1 - update + set timer [after 50 lappend z timeout] + vwait z + after cancel $timer set z } -cleanup { close $f -- cgit v0.12 From 5ed72038daa012a53d8b654d220d065b7bb3989c Mon Sep 17 00:00:00 2001 From: culler Date: Sun, 9 Aug 2020 14:33:43 +0000 Subject: use vwait in chanio tests too. --- tests/chanio.test | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/tests/chanio.test b/tests/chanio.test index c48fe63..97d5510 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -6399,12 +6399,15 @@ test chan-io-50.2 {testing handler deletion with multiple handlers} -setup { lappend z "called delhandler $f $i" testchannelevent $f delete 0 } + set z "" + set timer [after 50 lappend z timeout] testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list delhandler $f 1]] testchannelevent $f add readable [namespace code [list delhandler $f 0]] testservicemode 1 - update + vwait z + after cancel $timer string equal $z \ [list [list called delhandler $f 0] [list called delhandler $f 1]] } -cleanup { @@ -6413,7 +6416,6 @@ test chan-io-50.2 {testing handler deletion with multiple handlers} -setup { test chan-io-50.3 {testing handler deletion with multiple handlers} -setup { file delete $path(test1) chan close [open $path(test1) w] - update } -constraints testchannelevent -body { proc notcalled {f i} { variable z @@ -6427,12 +6429,14 @@ test chan-io-50.3 {testing handler deletion with multiple handlers} -setup { lappend z "delhandler $f $i deleted myself" } set z "" + set timer [after 50 lappend z timeout] testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list notcalled $f 1]] testchannelevent $f add readable [namespace code [list delhandler $f 0]] testservicemode 1 - update + vwait z + after cancel $timer string equal $z \ [list [list delhandler $f 0 called] \ [list delhandler $f 0 deleted myself]] @@ -6443,7 +6447,6 @@ test chan-io-50.4 {testing handler deletion vs reentrant calls} -setup { file delete $path(test1) set f [open $path(test1) w] chan close $f - update } -constraints testchannelevent -body { set f [open $path(test1) r] testchannelevent $f add readable [namespace code { @@ -6458,7 +6461,9 @@ test chan-io-50.4 {testing handler deletion vs reentrant calls} -setup { }] variable u toplevel variable z "" - update + set timer [after 50 lappend z timeout] + vwait z + after cancel $timer set z } -cleanup { chan close $f @@ -6485,20 +6490,24 @@ test chan-io-50.5 {testing handler deletion vs reentrant calls} -setup { } else { set u recursive lappend z "del calling recursive" + set timer [after 50 lappend z timeout] set mode [test servicemode 1] - update + vwait z + after cancel $timer test servicemode $mode lappend z "del after update" } } set z "" set u toplevel + set timer [after 50 lappend z timeout] testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list notcalled $f]] - testservicemode 1 testchannelevent $f add readable [namespace code [list del $f]] - update + testservicemode 1 + vwait z + after cancel $timer set z } -cleanup { chan close $f @@ -6509,16 +6518,17 @@ test chan-io-50.6 {testing handler deletion vs reentrant calls} -setup { file delete $path(test1) set f [open $path(test1) w] chan close $f - update } -constraints testchannelevent -body { proc first {f} { variable u variable z if {$u eq "toplevel"} { lappend z "first called" - set u first set mode [testservicemode 1] - update + set timer [after 50 lappend z timeout] + set u first + vwait z + after cancel $timer testservicemode $mode lappend z "first after update" } else { @@ -6542,12 +6552,14 @@ test chan-io-50.6 {testing handler deletion vs reentrant calls} -setup { } set z "" set u toplevel + set timer [after 50 lappend z timeout] testservicemode 0 set f [open $path(test1) r] testchannelevent $f add readable [namespace code [list second $f]] testchannelevent $f add readable [namespace code [list first $f]] testservicemode 1 - update + vwait z + after cancel $timer set z } -cleanup { chan close $f -- cgit v0.12 From 823d13656d0f81807f40c7029fcf4bf38215dedc Mon Sep 17 00:00:00 2001 From: culler Date: Mon, 10 Aug 2020 01:27:37 +0000 Subject: More places where vwait needs to be used instead of update. --- tests/chanio.test | 4 ++-- tests/io.test | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/chanio.test b/tests/chanio.test index 97d5510..bc6bb1b 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -5731,9 +5731,9 @@ test chan-io-46.1 {Tcl event loop vs multiple interpreters} {testfevent fileeven chan event $f readable {} }] } + set timer [after 10 lappend x timeout] testfevent cmd $script - after 1 ;# We must delay because Windows takes a little time to notice - update + vwait x testfevent cmd {chan close $f} list [testfevent cmd {set x}] [testfevent cmd {info commands after}] } {{f triggered: foo bar} after} diff --git a/tests/io.test b/tests/io.test index a81e394..8c44db9 100644 --- a/tests/io.test +++ b/tests/io.test @@ -6033,10 +6033,10 @@ test io-46.1 {Tcl event loop vs multiple interpreters} {testfevent fileevent} { fileevent $f readable {} }] } + set timer [after 10 lappend x timeout] testfevent cmd $script - after 1 ;# We must delay because Windows takes a little time to notice - update - testfevent cmd {close $f} + vwait x + testfevent cmd {chan close $f} list [testfevent cmd {set x}] [testfevent cmd {info commands after}] } {{f triggered: foo bar} after} test io-46.2 {Tcl event loop vs multiple interpreters} testfevent { -- cgit v0.12