os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/notify.test
First public contribution.
5 # This file tests several functions in the file, 'generic/tclNotify.c'.
7 # This file contains a collection of tests for one or more of the Tcl
8 # built-in commands. Sourcing this file into Tcl runs the tests and
9 # generates output for errors. No output means no errors were found.
11 # Copyright (c) 2003 by Kevin B. Kenny. All rights reserved.
13 # See the file "license.terms" for information on usage and redistribution
14 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
16 # RCS: @(#) $Id: notify.test,v 1.2.2.1 2003/10/06 13:55:38 dgp Exp $
18 if {[lsearch [namespace children] ::tcltest] == -1} {
19 package require tcltest 2
20 namespace import -force ::tcltest::*
23 testConstraint testevent [llength [info commands testevent]]
25 test notify-1.1 {Tcl_QueueEvent and delivery of a single event} \
26 -constraints {testevent} \
30 testevent queue one tail {lappend delivered one; expr 1}
36 test notify-1.2 {Tcl_QueueEvent and delivery of events in order} \
37 -constraints {testevent} \
41 testevent queue one tail {lappend delivered one; expr 1}
42 testevent queue two tail {lappend delivered two; expr 1}
43 testevent queue three tail {lappend delivered three; expr 1}
47 -result {one two three}
49 test notify-1.3 {Tcl_QueueEvent at head} \
50 -constraints {testevent} \
54 testevent queue one head {lappend delivered one; expr 1}
60 test notify-1.4 {Tcl_QueueEvent multiple events at head} \
61 -constraints {testevent} \
65 testevent queue one head {lappend delivered one; expr 1}
66 testevent queue two head {lappend delivered two; expr 1}
67 testevent queue three head {lappend delivered three; expr 1}
71 -result {three two one}
73 test notify-1.5 {Tcl_QueueEvent marker event into an empty queue} \
74 -constraints {testevent} \
78 testevent queue one mark {lappend delivered one; expr 1}
84 test notify-1.6 {Tcl_QueueEvent first marker event in a nonempty queue} \
85 -constraints {testevent} \
89 testevent queue one tail {lappend delivered one; expr 1}
90 testevent queue two mark {lappend delivered two; expr 1}
91 testevent queue three head {lappend delivered three; expr 1}
95 -result {three two one}
97 test notify-1.7 {Tcl_QueueEvent second marker event} \
98 -constraints {testevent} \
102 testevent queue one mark {lappend delivered one; expr 1}
103 testevent queue two mark {lappend delivered two; expr 1}
109 test notify-1.8 {Tcl_QueueEvent preexisting event following second marker} \
110 -constraints {testevent} \
114 testevent queue one mark {lappend delivered one; expr 1}
115 testevent queue two tail {lappend delivered two; expr 1}
116 testevent queue three mark {lappend delivered three; expr 1}
120 -result {one three two}
122 test notify-2.1 {remove sole element, don't replace } \
123 -constraints {testevent} \
127 testevent queue one tail {lappend delivered one; expr 1}
134 test notify-2.2 {remove and replace sole element} \
135 -constraints {testevent} \
139 testevent queue one tail {lappend delivered one; expr 1}
141 testevent queue two tail {lappend delivered two; expr 1}
147 test notify-2.3 {remove first element} \
148 -constraints {testevent} \
152 testevent queue one tail {lappend delivered one; expr 1}
153 testevent queue two tail {lappend delivered two; expr 1}
160 test notify-2.4 {remove and replace first element} \
161 -constraints {testevent} \
165 testevent queue one tail {lappend delivered one; expr 1}
166 testevent queue two tail {lappend delivered two; expr 1}
168 testevent queue three head {lappend delivered three; expr 1};
174 test notify-2.5 {remove last element} \
175 -constraints {testevent} \
179 testevent queue one tail {lappend delivered one; expr 1}
180 testevent queue two tail {lappend delivered two; expr 1}
188 test notify-2.6 {remove and replace last element} \
189 -constraints {testevent} \
193 testevent queue one tail {lappend delivered one; expr 1}
194 testevent queue two tail {lappend delivered two; expr 1}
196 testevent queue three tail {lappend delivered three; expr 1};
202 test notify-2.7 {remove a middle element} \
203 -constraints {testevent} \
207 testevent queue one tail {lappend delivered one; expr 1}
208 testevent queue two tail {lappend delivered two; expr 1}
209 testevent queue three tail {lappend delivered three; expr 1}
216 test notify-2.8 {remove a marker event that's the sole event in the queue} \
217 -constraints {testevent} \
221 testevent queue one mark {lappend delivered one; expr 1}
228 test notify-2.9 {remove and replace a marker event that's the sole event} \
229 -constraints {testevent} \
233 testevent queue one mark {lappend delivered one; expr 1}
235 testevent queue two mark {lappend delivered two; expr 1}
241 test notify-2.10 {remove marker event from head} \
242 -constraints {testevent} \
246 testevent queue one mark {lappend delivered one; expr 1}
247 testevent queue two mark {lappend delivered two; expr 1}
254 test notify-2.11 {remove and replace marker event at head} \
255 -constraints {testevent} \
259 testevent queue one mark {lappend delivered one; expr 1}
260 testevent queue two tail {lappend delivered two; expr 1}
262 testevent queue three mark {lappend delivered three; expr 1}
268 test notify-2.12 {remove marker event at tail} \
269 -constraints {testevent} \
273 testevent queue one mark {lappend delivered one; expr 1}
274 testevent queue two mark {lappend delivered two; expr 1}
281 test notify-2.13 {remove and replace marker event at tail} \
282 -constraints {testevent} \
286 testevent queue one mark {lappend delivered one; expr 1}
287 testevent queue two mark {lappend delivered two; expr 1}
289 testevent queue three mark {lappend delivered three; expr 1}
295 test notify-2.14 {remove marker event from middle} \
296 -constraints {testevent} \
300 testevent queue one mark {lappend delivered one; expr 1}
301 testevent queue two mark {lappend delivered two; expr 1}
302 testevent queue three mark {lappend delivered three; expr 1}
309 test notify-2.15 {remove and replace marker event at middle} \
310 -constraints {testevent} \
314 testevent queue one mark {lappend delivered one; expr 1}
315 testevent queue two mark {lappend delivered two; expr 1}
316 testevent queue three tail {lappend delivered three; expr 1}
318 testevent queue four mark {lappend delivered four; expr 1};
322 -result {one four three}
325 ::tcltest::cleanupTests