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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tcl/] [tests/] [winNotify.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 tests the tclWinNotify.c file.
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: winNotify.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) != "windows"} {
17
    return
18
}
19
 
20
# There is no explicit test for InitNotifier or NotifierExitHandler
21
 
22
test winNotify-1.1 {Tcl_SetTimer: positive timeout} {
23
    set done 0
24
    after 1000 { set done 1 }
25
    vwait done
26
    set done
27
} 1
28
test winNotify-1.2 {Tcl_SetTimer: positive timeout, message pending} {
29
    set x 0
30
    set y 1
31
    set a1 [after 0 { incr y }]
32
    after cancel $a1
33
    after 500 { incr x }
34
    vwait x
35
    list $x $y
36
} {1 1}
37
test winNotify-1.3 {Tcl_SetTimer: cancelling positive timeout} {
38
    set x 0
39
    set y 1
40
    set id [after 10000 { incr y }]
41
    after 0 { incr x }
42
    vwait x
43
    after cancel $id
44
    list $x $y
45
} {1 1}
46
test winNotify-1.4 {Tcl_SetTimer: null timeout, message pending} {
47
    set x 0
48
    set y 1
49
    after 0 { incr x }
50
    after 0 { incr y }
51
    vwait x
52
    list $x $y
53
} {1 2}
54
 
55
test winNotify-2.1 {Tcl_ResetIdleTimer} {
56
    set x 0
57
    update
58
    after idle { incr x }
59
    vwait x
60
    set x
61
} 1
62
test winNotify-2.2 {Tcl_ResetIdleTimer: message pending} {
63
    set x 0
64
    set y 1
65
    update
66
    after idle { incr x }
67
    after idle { incr y }
68
    update
69
    list $x $y
70
} {1 2}
71
 
72
test winNotify-3.1 {NotifierProc: non-modal normal timer} {
73
    update
74
    set x 0
75
    foreach i [after info] {
76
        after cancel $i
77
    }
78
    after 500 { incr x; testeventloop done }
79
    testeventloop wait
80
    set x
81
} 1
82
test winNotify-3.2 {NotifierProc: non-modal normal timer, rescheduled} {
83
    update
84
    set x 0
85
    foreach i [after info] {
86
        after cancel $i
87
    }
88
    after 500 { incr x; after 100 {incr x; testeventloop done }}
89
    testeventloop wait
90
    set x
91
} 2
92
test winNotify-3.3 {NotifierProc: modal normal timer} {
93
    update
94
    set x 0
95
    foreach i [after info] {
96
        after cancel $i
97
    }
98
    after 500 { incr x }
99
    vwait x
100
    set x
101
} 1
102
test winNotify-3.4 {NotifierProc: modal normal timer, rescheduled} {
103
    update
104
    set x 0
105
    foreach i [after info] {
106
        after cancel $i
107
    }
108
    set y 0
109
    after 500 { incr y; after 100 {incr x}}
110
    vwait x
111
    list $x $y
112
} {1 1}
113
test winNotify-3.5 {NotifierProc: non-modal idle timer} {
114
    update
115
    set x 0
116
    foreach i [after info] {
117
        after cancel $i
118
    }
119
    after idle { incr x; testeventloop done }
120
    testeventloop wait
121
    set x
122
} 1
123
test winNotify-3.6 {NotifierProc: non-modal idle timer, rescheduled} {
124
    update
125
    set x 0
126
    foreach i [after info] {
127
        after cancel $i
128
    }
129
    after idle { incr x; after idle {incr x; testeventloop done }}
130
    testeventloop wait
131
    set x
132
} 2
133
test winNotify-3.7 {NotifierProc: modal idle timer} {
134
    update
135
    set x 0
136
    foreach i [after info] {
137
        after cancel $i
138
    }
139
    after idle { incr x }
140
    vwait x
141
    set x
142
} 1
143
test winNotify-3.8 {NotifierProc: modal idle timer, rescheduled} {
144
    update
145
    set x 0
146
    foreach i [after info] {
147
        after cancel $i
148
    }
149
    set y 0
150
    after idle { incr y; after idle {incr x}}
151
    vwait x
152
    list $x $y
153
} {1 1}
154
 
155
# Tcl_DoOneEvent is tested by the timer.test, io.test, and event.test files

powered by: WebSVN 2.1.0

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