Diff
Not logged in

Differences From Artifact [383baf9f92]:

To Artifact [375975331e]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# This file contains a collection of tests for the procedures in the file
# tclEvent.c, which includes the "update", and "vwait" Tcl
# commands.  Sourcing this file into Tcl runs the tests and generates
# output for errors.  No output means no errors were found.
#
# Copyright (c) 1995-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: event.test,v 1.8 1999/07/01 17:36:17 jenn Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest
    namespace import ::tcltest::*
}

set ::tcltest::testConstraints(testfilehandler) \











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# This file contains a collection of tests for the procedures in the file
# tclEvent.c, which includes the "update", and "vwait" Tcl
# commands.  Sourcing this file into Tcl runs the tests and generates
# output for errors.  No output means no errors were found.
#
# Copyright (c) 1995-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: event.test,v 1.8.4.1 1999/09/22 04:12:56 hobbs Exp $

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest
    namespace import ::tcltest::*
}

set ::tcltest::testConstraints(testfilehandler) \
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406

test event-11.5 {Tcl_VwaitCmd procedure: round robin scheduling, 2 sources} {socket} {
    set f1 [open test1 w]
    proc accept {s args} {
	puts $s foobar
	close $s
    }
    set s1 [socket -server accept 5001]
    after 1000
    set s2 [socket 127.0.0.1 5001]
    close $s1
    set x 0
    set y 0
    set z 0
    fileevent $s2 readable { incr z }
    vwait z
    fileevent $f1 writable { incr x; if { $y == 3 } { set z done } }







|

|







390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406

test event-11.5 {Tcl_VwaitCmd procedure: round robin scheduling, 2 sources} {socket} {
    set f1 [open test1 w]
    proc accept {s args} {
	puts $s foobar
	close $s
    }
    catch {set s1 [socket -server accept 5001]}
    after 1000
    catch {set s2 [socket 127.0.0.1 5001]}
    close $s1
    set x 0
    set y 0
    set z 0
    fileevent $s2 readable { incr z }
    vwait z
    fileevent $f1 writable { incr x; if { $y == 3 } { set z done } }