OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tcl/] [tests/] [unixNotfy.test] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# This file contains tests for tclUnixNotfy.c.
2
#
3
# This file contains a collection of tests for one or more of the Tcl
4
# built-in commands.  Sourcing this file into Tcl runs the tests and
5
# generates output for errors.  No output means no errors were found.
6
#
7
# Copyright (c) 1997 by Sun Microsystems, Inc.
8
#
9
# See the file "license.terms" for information on usage and redistribution
10
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
11
#
12
# RCS: @(#) $Id: unixNotfy.test,v 1.1.1.1 2002-01-16 10:25:36 markom Exp $
13
 
14
if {[string compare test [info procs test]] == 1} then {source defs}
15
 
16
if {$tcl_platform(platform) != "unix"} {
17
    return
18
}
19
 
20
# The tests should not be run if you have a notifier which is unable to
21
# detect infinite vwaits, as the tests below will hang. The presence of
22
# the "testeventloop" command indicates that this is the case.
23
 
24
if {"[info commands testeventloop]" == "testeventloop"} {
25
    return
26
}
27
 
28
test unixNotfy-1.1 {Tcl_DeleteFileHandler} {
29
    catch {vwait x}
30
    set f [open foo w]
31
    fileevent $f writable {set x 1}
32
    vwait x
33
    close $f
34
    list [catch {vwait x} msg] $msg
35
} {1 {can't wait for variable "x":  would wait forever}}
36
test unixNotfy-1.2 {Tcl_DeleteFileHandler} {
37
    catch {vwait x}
38
    set f1 [open foo w]
39
    set f2 [open foo2 w]
40
    fileevent $f1 writable {set x 1}
41
    fileevent $f2 writable {set y 1}
42
    vwait x
43
    close $f1
44
    vwait y
45
    close $f2
46
    list [catch {vwait x} msg] $msg
47
} {1 {can't wait for variable "x":  would wait forever}}
48
 
49
file delete foo
50
file delete foo2

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.