summaryrefslogtreecommitdiffstats
path: root/tests/winNotify.test
blob: 09ddc1c02ccad1c12ac61ad45159526dd1e7c767 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# This file tests the tclWinNotify.c file.
#
# This file contains a collection of tests for one or more of the Tcl
# built-in commands.  Sourcing this file into Tcl runs the tests and
# generates output for errors.  No output means no errors were found.
#
# Copyright (c) 1997 by 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: winNotify.test,v 1.10 2004/06/23 15:36:59 dkf Exp $

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

testConstraint testeventloop [expr {[info commands testeventloop] != {}}]

# There is no explicit test for InitNotifier or NotifierExitHandler

test winNotify-1.1 {Tcl_SetTimer: positive timeout} {win} {
    set done 0
    after 1000 { set done 1 }
    vwait done
    set done
} 1
test winNotify-1.2 {Tcl_SetTimer: positive timeout, message pending} {win} {
    set x 0
    set y 1
    set a1 [after 0 { incr y }]
    after cancel $a1
    after 500 { incr x }
    vwait x
    list $x $y
} {1 1}
test winNotify-1.3 {Tcl_SetTimer: cancelling positive timeout} {win} {
    set x 0
    set y 1
    set id [after 10000 { incr y }]
    after 0 { incr x }
    vwait x
    after cancel $id
    list $x $y
} {1 1}
test winNotify-1.4 {Tcl_SetTimer: null timeout, message pending} {win} {
    set x 0
    set y 1
    after 0 { incr x }
    after 0 { incr y }
    vwait x
    list $x $y
} {1 2}

test winNotify-2.1 {Tcl_ResetIdleTimer} {win} {
    set x 0
    update
    after idle { incr x }
    vwait x
    set x
} 1
test winNotify-2.2 {Tcl_ResetIdleTimer: message pending} {win} {
    set x 0
    set y 1
    update
    after idle { incr x }
    after idle { incr y }
    update
    list $x $y
} {1 2}

test winNotify-3.1 {NotifierProc: non-modal normal timer} {win testeventloop} {
    update
    set x 0
    foreach i [after info] {
	after cancel $i
    }
    after 500 { incr x; testeventloop done }
    testeventloop wait
    set x
} 1
test winNotify-3.2 {NotifierProc: non-modal normal timer, rescheduled} {win testeventloop} {
    update
    set x 0
    foreach i [after info] {
	after cancel $i
    }
    after 500 { incr x; after 100 {incr x; testeventloop done }}
    testeventloop wait
    set x
} 2
test winNotify-3.3 {NotifierProc: modal normal timer} {win} {
    update
    set x 0
    foreach i [after info] {
	after cancel $i
    }
    after 500 { incr x }
    vwait x
    set x
} 1
test winNotify-3.4 {NotifierProc: modal normal timer, rescheduled} {win} {
    update
    set x 0
    foreach i [after info] {
	after cancel $i
    }
    set y 0
    after 500 { incr y; after 100 {incr x}}
    vwait x
    list $x $y
} {1 1}
test winNotify-3.5 {NotifierProc: non-modal idle timer} {win testeventloop} {
    update
    set x 0
    foreach i [after info] {
	after cancel $i
    }
    after idle { incr x; testeventloop done }
    testeventloop wait
    set x
} 1
test winNotify-3.6 {NotifierProc: non-modal idle timer, rescheduled} {win testeventloop} {
    update
    set x 0
    foreach i [after info] {
	after cancel $i
    }
    after idle { incr x; after idle {incr x; testeventloop done }}
    testeventloop wait
    set x
} 2
test winNotify-3.7 {NotifierProc: modal idle timer} {win} {
    update
    set x 0
    foreach i [after info] {
	after cancel $i
    }
    after idle { incr x }
    vwait x
    set x
} 1
test winNotify-3.8 {NotifierProc: modal idle timer, rescheduled} {win} {
    update
    set x 0
    foreach i [after info] {
	after cancel $i
    }
    set y 0
    after idle { incr y; after idle {incr x}}
    vwait x
    list $x $y
} {1 1}

# Tcl_DoOneEvent is tested by the timer.test, io.test, and event.test files

# cleanup
::tcltest::cleanupTests
return
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\wXN_OdPfPgQhQhQiQiQiQiQiQjQjQjQjQjQjQjQjQjQjQiQfP`O\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\NCJiQLbPhQkQmRnRoRoRoRoRoRoRoRoRpRpSqSqSrSrSrSqSoRjQ]O\KK\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\fOLrUMcPlRqStSuTwTxTxTyTyTzTzUzUzUzUzUyTxTwTtSmRaOhPL\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\a0 cNLqUM\OfQpSwVzV|V}VVVǀV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