bug-52.exp 28.3 KB
Newer Older
Per Cederqvist's avatar
Per Cederqvist committed
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
# Test suite for lyskomd.
# Copyright (C) 2001-2002  Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
# 
# LysKOM is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by 
# the Free Software Foundation; either version 1, or (at your option) 
# any later version.
# 
# LysKOM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
# 
# You should have received a copy of the GNU General Public License
# along with LysKOM; see the file COPYING.  If not, write to
# Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
# or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, 
# MA 02139, USA.
#
# Please mail bug reports to bug-lyskom@lysator.liu.se. 


# Check that the read-text part of a membership can be saved and
# restored.

28
29
30
31
32
33
34
35
36
37
38
39
40
# Set to 1 if testing version 2.0.7 or earlier, where the check for
# deleted texts only is performed at the end of the first interval.
set lazy_expand 0

# Set to 0 if testing version 2.0.7 or earlier, where mark-as-read
# processed each local number in turn, without checking for errors
# first.
set mark_as_read_atomic 1

# Set to 1 to repeatedly stop and start lyskomd, thus testing that we
# can save and restore the information about read texts.  Set to 0 to
# speed up the test, at the cost of not testing everything that needs
# to be tested.
Per Cederqvist's avatar
Per Cederqvist committed
41
set do_restart 1
42
43
44
45
46

if {$do_restart == 0} {
    untested "saving read-ranges to disk (Bug 52)"
}

Per Cederqvist's avatar
Per Cederqvist committed
47
48
49
50
51
52
53
54
55
56
57
58
obtain_lock

unpack_db bug-52

proc start {} {
    lyskomd_start "" "Garb: no" "" "" "" [list \
	"WARN: [pwd]/db/number.txt: No such file" \
        ] 0 0 6 21 1
    client_start 0
    talk_to client 0
    send "A3Hfoo\n"
    simple_expect "LysKOM"
59
    send "999 62 5 [holl "gazonk"] 0\n"
Per Cederqvist's avatar
Per Cederqvist committed
60
    simple_expect ":2 9 5 1"
61
    simple_expect "=999"
Per Cederqvist's avatar
Per Cederqvist committed
62
63
64
65
66
67
68
69
70
71
72
73
}

proc stop {} {
    global lyskomd_pid

    system "kill -HUP $lyskomd_pid"
    lyskomd_death {} signal
    client_death 0

    dbck_run
}

74
75
76
77
78
79
80
81
82
83
proc restart {} {
    global do_restart

    if {$do_restart} {
	stop
	start
    }
}

proc checkit {pos conf prio last arrsize array ranges} {
Per Cederqvist's avatar
Per Cederqvist committed
84
85
86
    global any_time

    send "1 99 5 $pos 1 0\n"
87
    simple_expect "=1 1 { $pos $any_time $conf $prio $last $arrsize \\* 5 $any_time 00000000 }" "$last $arrsize $array"
Per Cederqvist's avatar
Per Cederqvist committed
88
    send "2 99 5 $pos 1 1\n"
89
    simple_expect "=2 1 { $pos $any_time $conf $prio $last $arrsize $array 5 $any_time 00000000 }" "$last $arrsize $array"
Per Cederqvist's avatar
Per Cederqvist committed
90
    send "3 98 5 $conf\n"
91
    simple_expect "=3 $pos $any_time $conf $prio $last $arrsize $array 5 $any_time 00000000" "$last $arrsize $array"
Per Cederqvist's avatar
Per Cederqvist committed
92
    send "4 46 5 $pos 1 0\n"
93
    simple_expect "=4 1 { $any_time $conf $prio $last $arrsize \\* }" "$last $arrsize $array"
Per Cederqvist's avatar
Per Cederqvist committed
94
    send "5 46 5 $pos 1 1\n"
95
    simple_expect "=5 1 { $any_time $conf $prio $last $arrsize $array }" "$last $arrsize $array"
Per Cederqvist's avatar
Per Cederqvist committed
96
    send "6 9 5 $conf\n"
97
    simple_expect "=6 $any_time $conf $prio $last $arrsize $array" "$last $arrsize $array"
98
99
100
101
102
103
104
105
106
107
108
109
    send "7 107 5 $conf 1 0\n"
    simple_expect "=7 $pos $any_time $conf $prio $ranges 5 $any_time 00000000" "$ranges"
    send "8 107 5 $conf 1 99\n"
    simple_expect "=8 $pos $any_time $conf $prio $ranges 5 $any_time 00000000" "$ranges"
    send "9 107 5 $conf 0 99\n"
    simple_expect "=9 $pos $any_time $conf $prio [lindex $ranges 0] \\* 5 $any_time 00000000" "[lindex $ranges 0] *"
    send "10 108 5 $pos 1 0 0\n"
    simple_expect "=10 1 { $pos $any_time $conf $prio [lindex $ranges 0] \\* 5 $any_time 00000000 }" "[lindex $ranges 0] *"
    send "11 108 5 $pos 1 1 0\n"
    simple_expect "=11 1 { $pos $any_time $conf $prio $ranges 5 $any_time 00000000 }" "$ranges"
    send "12 108 5 $pos 1 1 99\n"
    simple_expect "=12 1 { $pos $any_time $conf $prio $ranges 5 $any_time 00000000 }" "$ranges"
Per Cederqvist's avatar
Per Cederqvist committed
110
111
}

112
113
114
115
116
117
118
119
proc check_unread_confs {confs} {
    send "50 52 5\n"
    if {[llength $confs] > 0} {
	simple_expect "=50 [llength $confs] { $confs }"
    } else {
	simple_expect "=50 [llength $confs] \\*"
    }
}
Per Cederqvist's avatar
Per Cederqvist committed
120
121

start
122
123
124
125
126
checkit 0 5 255 0 0 "\\*" "0 \\*"
checkit 1 1 100 0 0 "\\*" "0 \\*"
checkit 2 2 100 0 0 "\\*" "0 \\*"
checkit 3 3 100 0 0 "\\*" "0 \\*"
checkit 4 4 100 0 0 "\\*" "0 \\*"
127
check_unread_confs {5 1 2 3 4}
Per Cederqvist's avatar
Per Cederqvist committed
128

129
130
131
132
133
134
135
restart

checkit 0 5 255 0 0 "\\*" "0 \\*"
checkit 1 1 100 0 0 "\\*" "0 \\*"
checkit 2 2 100 0 0 "\\*" "0 \\*"
checkit 3 3 100 0 0 "\\*" "0 \\*"
checkit 4 4 100 0 0 "\\*" "0 \\*"
136
check_unread_confs {5 1 2 3 4}
Per Cederqvist's avatar
Per Cederqvist committed
137
138
139
140
141
142
143
144
145
146
147
148

send "1000 27 5 1 { 2 }\n"
simple_expect "=1000"
send "1001 27 1 0 { }\n"
simple_expect "=1001"
send "1002 27 2 1 { 1 }\n"
simple_expect "=1002"
send "1003 27 3 2 { 1 2 }\n"
simple_expect "=1003"
send "1004 27 4 2 { 1 3 }\n"
simple_expect "=1004"

149
150
151
152
153
checkit 0 5 255 0 1 "{ 2 }" "1 { 2 2 }"
checkit 1 1 100 0 0 "\\*"   "0 \\*"
checkit 2 2 100 1 0 "\\*"   "1 { 1 1 }"
checkit 3 3 100 2 0 "\\*"   "1 { 1 2 }"
checkit 4 4 100 1 1 "{ 3 }" "2 { 1 1 3 3 }"
154
check_unread_confs {5 1 2 3 4}
Per Cederqvist's avatar
Per Cederqvist committed
155

156
restart
Per Cederqvist's avatar
Per Cederqvist committed
157

158
159
160
161
162
checkit 0 5 255 0 1 "{ 2 }" "1 { 2 2 }"	   
checkit 1 1 100 0 0 "\\*"   "0 \\*"	   
checkit 2 2 100 1 0 "\\*"   "1 { 1 1 }"	   
checkit 3 3 100 2 0 "\\*"   "1 { 1 2 }"	   
checkit 4 4 100 1 1 "{ 3 }" "2 { 1 1 3 3 }"
163
check_unread_confs {5 1 2 3 4}
Per Cederqvist's avatar
Per Cederqvist committed
164

165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
send "1005 27 5 1 { 4 }\n"
simple_expect "=1005"
send "1006 27 1 2 { 2 4 }\n"
simple_expect "=1006"
send "1007 27 2 1 { 2 }\n"
simple_expect "=1007"
send "1008 27 3 2 { 4 3 }\n"
simple_expect "=1008"
send "1009 27 4 2 { 5 6 }\n"
simple_expect "=1009"

checkit 0 5 255 0 2 "{ 2 4 }"   "2 { 2 2 4 4 }"	   
checkit 1 1 100 0 2 "{ 2 4 }"	"2 { 2 2 4 4 }"
checkit 2 2 100 2 0 "\\*"	"1 { 1 2 }"	   
checkit 3 3 100 4 0 "\\*"	"1 { 1 4 }"	   
checkit 4 4 100 1 3 "{ 3 5 6 }"	"3 { 1 1 3 3 5 6 }"
181
check_unread_confs {5 1 2 3 4}
182
183
184
185
186
187
188
189

restart

checkit 0 5 255 0 2 "{ 2 4 }"   "2 { 2 2 4 4 }"	   
checkit 1 1 100 0 2 "{ 2 4 }"	"2 { 2 2 4 4 }"	   
checkit 2 2 100 2 0 "\\*"	"1 { 1 2 }"	   
checkit 3 3 100 4 0 "\\*"	"1 { 1 4 }"	   
checkit 4 4 100 1 3 "{ 3 5 6 }"	"3 { 1 1 3 3 5 6 }"
190
check_unread_confs {5 1 2 3 4}
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207

send "1010 27 5 1 { 3 }\n"
simple_expect "=1010"
send "1011 27 1 2 { 8 6 }\n"
simple_expect "=1011"
send "1012 27 2 1 { 3 }\n"
simple_expect "=1012"
send "1013 27 3 7 { 7 8 9 11 12 14 18 }\n"
simple_expect "=1013"
send "1014 27 4 1 { 2 }\n"
simple_expect "=1014"

checkit 0 5 255 0 3 "{ 2 3 4 }"             "1 { 2 4 }"
checkit 1 1 100 0 4 "{ 2 4 6 8 }"           "4 { 2 2 4 4 6 6 8 8 }"
checkit 2 2 100 3 0 "\\*"	            "1 { 1 3 }"
checkit 3 3 100 4 7 "{ 7 8 9 11 12 14 18 }" "5 { 1 4 7 9 11 12 14 14 18 18 }"
checkit 4 4 100 3 2 "{ 5 6 }"	            "2 { 1 3 5 6 }"
208
check_unread_confs {5 1 2 3 4}
209
210
211
212
213
214
215
216

restart

checkit 0 5 255 0 3 "{ 2 3 4 }"             "1 { 2 4 }"
checkit 1 1 100 0 4 "{ 2 4 6 8 }"           "4 { 2 2 4 4 6 6 8 8 }"
checkit 2 2 100 3 0 "\\*"	            "1 { 1 3 }"
checkit 3 3 100 4 7 "{ 7 8 9 11 12 14 18 }" "5 { 1 4 7 9 11 12 14 14 18 18 }"
checkit 4 4 100 3 2 "{ 5 6 }"	            "2 { 1 3 5 6 }"
217
check_unread_confs {5 1 2 3 4}
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234

send "1015 27 5 1 { 1 }\n"
simple_expect "=1015"
send "1016 27 1 1 { 1 }\n"
simple_expect "=1016"
send "1017 27 2 1 { 2 }\n"
simple_expect "=1017"
send "1018 27 3 1 { 13 }\n"
simple_expect "=1018"
send "1019 27 4 1 { 4 }\n"
simple_expect "=1019"

checkit 0 5 255 4 0 "\\*"                      "1 { 1 4 }"
checkit 1 1 100 2 3 "{ 4 6 8 }"                "4 { 1 2 4 4 6 6 8 8 }"
checkit 2 2 100 3 0 "\\*"	               "1 { 1 3 }"
checkit 3 3 100 4 8 "{ 7 8 9 11 12 13 14 18 }" "4 { 1 4 7 9 11 14 18 18 }"
checkit 4 4 100 6 0 "\\*"	               "1 { 1 6 }"
235
check_unread_confs {5 1 2 3 4}
236
237
238
239
240
241
242
243

restart

checkit 0 5 255 4 0 "\\*"                      "1 { 1 4 }"
checkit 1 1 100 2 3 "{ 4 6 8 }"                "4 { 1 2 4 4 6 6 8 8 }"
checkit 2 2 100 3 0 "\\*"	               "1 { 1 3 }"
checkit 3 3 100 4 8 "{ 7 8 9 11 12 13 14 18 }" "4 { 1 4 7 9 11 14 18 18 }"
checkit 4 4 100 6 0 "\\*"	               "1 { 1 6 }"
244
check_unread_confs {5 1 2 3 4}
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262

send "1020 27 5 1 { 7 }\n"
simple_expect "=1020"
send "1021 27 1 3 { 3 5 7 }\n"
simple_expect "=1021"
send "1022 27 2 1 { 8 }\n"
simple_expect "=1022"
send "1023 27 3 1 { 16 }\n"
simple_expect "=1023"
send "1024 40 4 20\n"
simple_expect "=1024"

checkit 0 5 255 4 1 "{ 7 }"              "2 { 1 4 7 7 }"
checkit 1 1 100 8 0 "\\*"                "1 { 1 8 }"
checkit 2 2 100 3 1 "{ 8 }"	         "2 { 1 3 8 8 }"
checkit 3 3 100 4 9 "{ 7 8 9 11 12 13 14 16 18 }" \
    "5 { 1 4 7 9 11 14 16 16 18 18 }"
checkit 4 4 100 0 0 "\\*"	         "0 \\*"
263
check_unread_confs {5 1 2 3 4}
264
265
266
267
268
269
270
271
272

restart

checkit 0 5 255 4 1 "{ 7 }"              "2 { 1 4 7 7 }"
checkit 1 1 100 8 0 "\\*"                "1 { 1 8 }"
checkit 2 2 100 3 1 "{ 8 }"	         "2 { 1 3 8 8 }"
checkit 3 3 100 4 9 "{ 7 8 9 11 12 13 14 16 18 }" \
    "5 { 1 4 7 9 11 14 16 16 18 18 }"
checkit 4 4 100 0 0 "\\*"	         "0 \\*"
273
check_unread_confs {5 1 2 3 4}
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289

send "1025 27 5 1 { 6 }\n"
simple_expect "=1025"
send "1026 77 1 0\n"
simple_expect "=1026"
send "1027 77 2 1\n"
simple_expect "=1027"
send "1028 27 3 1 { 6 }\n"
simple_expect "=1028"
send "1029 27 4 1 { 3 }\n"
simple_expect "=1029"

checkit 0 5 255 4 2 "{ 6 7 }"            "2 { 1 4 6 7 }"
checkit 1 1 100 0 0 "\\*"                "0 \\*"
checkit 2 2 100 1 0 "\\*"	         "1 { 1 1 }"
checkit 3 3 100 4 10 "{ 6 7 8 9 11 12 13 14 16 18 }" \
290
    "5 { 1 4 6 9 11 14 16 16 18 18 }"
291
checkit 4 4 100 0 1 "{ 3 }"	         "1 { 3 3 }"
292
check_unread_confs {5 1 2 3 4}
293
294
295
296
297
298
299
300
301

restart

checkit 0 5 255 4 2 "{ 6 7 }"            "2 { 1 4 6 7 }"
checkit 1 1 100 0 0 "\\*"                "0 \\*"
checkit 2 2 100 1 0 "\\*"	         "1 { 1 1 }"
checkit 3 3 100 4 10 "{ 6 7 8 9 11 12 13 14 16 18 }" \
    "5 { 1 4 6 9 11 14 16 16 18 18 }"
checkit 4 4 100 0 1 "{ 3 }"	         "1 { 3 3 }"
302
check_unread_confs {5 1 2 3 4}
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319

send "1030 27 5 1 { 5 }\n"
simple_expect "=1030"
send "1031 77 1 2\n"
simple_expect "=1031"
send "1032 40 2 19\n"
simple_expect "=1032"
send "1033 27 3 1 { 5 }\n"
simple_expect "=1033"
send "1034 27 4 1 { 2 }\n"
simple_expect "=1034"

checkit 0 5 255 7 0 "\\*"                   "1 { 1 7 }"
checkit 1 1 100 2 0 "\\*"                   "1 { 1 2 }"
checkit 2 2 100 1 0 "\\*"	            "1 { 1 1 }"
checkit 3 3 100 9 6 "{ 11 12 13 14 16 18 }" "4 { 1 9 11 14 16 16 18 18 }"
checkit 4 4 100 0 2 "{ 2 3 }"	            "1 { 2 3 }"
320
check_unread_confs {5 1 2 3 4}
321
322
323
324
325
326
327
328

restart

checkit 0 5 255 7 0 "\\*"                   "1 { 1 7 }"
checkit 1 1 100 2 0 "\\*"                   "1 { 1 2 }"
checkit 2 2 100 1 0 "\\*"	            "1 { 1 1 }"
checkit 3 3 100 9 6 "{ 11 12 13 14 16 18 }" "4 { 1 9 11 14 16 16 18 18 }"
checkit 4 4 100 0 2 "{ 2 3 }"	            "1 { 2 3 }"
329
check_unread_confs {5 1 2 3 4}
330
331
332
333
334
335
336
337
338
339
340
341

send "1035 27 5 1 { 20 }\n"
simple_expect "=1035"
send "1036 27 5 1 { 21 }\n"
simple_expect "%1036 16 0"
send "1037 40 2 18\n"
simple_expect "=1037"
send "1038 27 3 1 { 15 }\n"
simple_expect "=1038"
send "1039 27 4 1 { 1 }\n"
simple_expect "=1039"

342
checkit 0 5 255 7 1 "{ 20 }"                   "2 { 1 7 20 20 }"
343
344
345
346
checkit 1 1 100 2 0 "\\*"                      "1 { 1 2 }"
checkit 2 2 100 2 0 "\\*"	               "1 { 1 2 }"
checkit 3 3 100 9 7 "{ 11 12 13 14 15 16 18 }" "3 { 1 9 11 16 18 18 }"
checkit 4 4 100 3 0 "\\*"	               "1 { 1 3 }"
347
check_unread_confs {5 1 2 3 4}
348
349
350
351
352
353
354
355
356
357

restart

checkit 0 5 255 7 1 "{ 20 }"                   "2 { 1 7 20 20 }"
checkit 1 1 100 2 0 "\\*"                      "1 { 1 2 }"
checkit 2 2 100 2 0 "\\*"	               "1 { 1 2 }"
checkit 3 3 100 9 7 "{ 11 12 13 14 15 16 18 }" "3 { 1 9 11 16 18 18 }"
checkit 4 4 100 3 0 "\\*"	               "1 { 1 3 }"

# Subtract text 3 from conference 2.
Per Cederqvist's avatar
Per Cederqvist committed
358
359
send "1040 31 3 2\n"
simple_expect "=1040"
360

Per Cederqvist's avatar
Per Cederqvist committed
361
362
363
364
send "1041 27 5 2 { 19 21 }\n"
simple_expect "%1041 16 1"
send "1042 27 1 2 { 21 19 }\n"
simple_expect "%1042 16 0"
365
366
367
368
369
370
371
372
send "1043 27 2 0 { }\n"
simple_expect "=1043"
send "1044 27 3 1 { 10 }\n"
simple_expect "=1044"
send "1045 27 4 1 { 18 }\n"
simple_expect "=1045"

if {$mark_as_read_atomic} {
373
    checkit 0 5 255 7 1 "{ 20 }"     "2 { 1 7 20 20 }"
374
375
376
377
378
379
380
381
382
} else {
    setup_xfail "*-*-*" "mark-as-read processes some stuff and returns error"
    fail "mark-as-read"
    checkit 0 5 255 7 2 "{ 19 20 }"  "2 { 1 7 19 20 }"
}
checkit 1 1 100 2 0 "\\*"            "1 { 1 2 }"
checkit 2 2 100 3 0 "\\*"	     "1 { 1 3 }"
checkit 3 3 100 16 1 "{ 18 }"        "2 { 1 16 18 18 }"
checkit 4 4 100 3 1 "{ 18 }"	     "2 { 1 3 18 18 }"
383
check_unread_confs {5 1 2 3 4}
384
385
386
387

restart

if {$mark_as_read_atomic} {
388
    checkit 0 5 255 7 1 "{ 20 }"     "2 { 1 7 20 20 }"
389
390
391
392
393
394
395
} else {
    checkit 0 5 255 7 2 "{ 19 20 }"  "2 { 1 7 19 20 }"
}
checkit 1 1 100 2 0 "\\*"            "1 { 1 2 }"
checkit 2 2 100 3 0 "\\*"	     "1 { 1 3 }"
checkit 3 3 100 16 1 "{ 18 }"        "2 { 1 16 18 18 }"
checkit 4 4 100 3 1 "{ 18 }"	     "2 { 1 3 18 18 }"
396
check_unread_confs {5 1 2 3 4}
397
398

# Subtract texts 10-12, 14-15 from conference 1.
Per Cederqvist's avatar
Per Cederqvist committed
399
400
401
send "1046 31 10 1\n"
simple_expect "=1046"
send "1047 31 11 1\n"
402
simple_expect "=1047"
Per Cederqvist's avatar
Per Cederqvist committed
403
send "1048 31 12 1\n"
404
simple_expect "=1048"
Per Cederqvist's avatar
Per Cederqvist committed
405
send "1049 31 14 1\n"
406
simple_expect "=1049"
Per Cederqvist's avatar
Per Cederqvist committed
407
send "1050 31 15 1\n"
408
409
410
simple_expect "=1050"

# Subtract text 4 from conference 2.
Per Cederqvist's avatar
Per Cederqvist committed
411
412
send "1051 31 4 2\n"
simple_expect "=1051"
413

Per Cederqvist's avatar
Per Cederqvist committed
414
send "1052 27 5 1 { 19 }\n"
415
simple_expect "=1052"
Per Cederqvist's avatar
Per Cederqvist committed
416
417
418
419
420
send "1053 27 1 1 { 8 }\n"
simple_expect "=1053"
send "1054 27 2 0 { }\n"
simple_expect "=1054"
send "1055 27 3 1 { 17 }\n"
421
simple_expect "=1055"
Per Cederqvist's avatar
Per Cederqvist committed
422
send "1056 27 4 1 { 17 }\n"
423
424
425
426
427
428
429
simple_expect "=1056"

checkit 0 5 255 7 2 "{ 19 20 }"  "2 { 1 7 19 20 }"
checkit 1 1 100 2 1 "{ 8 }"      "2 { 1 2 8 8 }"
checkit 2 2 100 4 0 "\\*"	 "1 { 1 4 }"
checkit 3 3 100 18 0 "\\*"       "1 { 1 18 }"
checkit 4 4 100 3 2 "{ 17 18 }"	 "2 { 1 3 17 18 }"
430
check_unread_confs {5 1 2 3 4}
431
432
433
434
435
436
437
438

restart

checkit 0 5 255 7 2 "{ 19 20 }"  "2 { 1 7 19 20 }"
checkit 1 1 100 2 1 "{ 8 }"      "2 { 1 2 8 8 }"
checkit 2 2 100 4 0 "\\*"	 "1 { 1 4 }"
checkit 3 3 100 18 0 "\\*"       "1 { 1 18 }"
checkit 4 4 100 3 2 "{ 17 18 }"	 "2 { 1 3 17 18 }"
439
check_unread_confs {5 1 2 3 4}
440

Per Cederqvist's avatar
Per Cederqvist committed
441
send "1057 27 5 1 { 18 }\n"
442
simple_expect "=1057"
Per Cederqvist's avatar
Per Cederqvist committed
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
send "1058 27 1 1 { 9 }\n"
simple_expect "=1058"
send "1059 27 2 1 { 4 }\n"
simple_expect "=1059"
send "1060 27 3 1 { 20 }\n"
simple_expect "=1060"
send "1061 27 4 1 { 19 }\n"
simple_expect "=1061"

checkit 0 5 255 7 3 "{ 18 19 20 }" "2 { 1 7 18 20 }"
if {$lazy_expand} {
    checkit 1 1 100 2 2 "{ 8 9 }"  "2 { 1 2 8 9 }"
} else {
    checkit 1 1 100 2 5 "{ 8 9 10 11 12 }" "2 { 1 2 8 12 }"
}
checkit 2 2 100 4 0 "\\*"	   "1 { 1 4 }"
checkit 3 3 100 18 1 "{ 20 }"      "2 { 1 18 20 20 }"
checkit 4 4 100 3 3 "{ 17 18 19 }" "2 { 1 3 17 19 }"
461
check_unread_confs {5 1 2 3 4}
Per Cederqvist's avatar
Per Cederqvist committed
462
463

restart
464
465
466
467
468
469
470
471
472
473

checkit 0 5 255 7 3 "{ 18 19 20 }" "2 { 1 7 18 20 }"
if {$lazy_expand} {
    checkit 1 1 100 2 2 "{ 8 9 }"  "2 { 1 2 8 9 }"
} else {
    checkit 1 1 100 2 5 "{ 8 9 10 11 12 }" "2 { 1 2 8 12 }"
}
checkit 2 2 100 4 0 "\\*"	   "1 { 1 4 }"
checkit 3 3 100 18 1 "{ 20 }"      "2 { 1 18 20 20 }"
checkit 4 4 100 3 3 "{ 17 18 19 }" "2 { 1 3 17 19 }"
474
check_unread_confs {5 1 2 3 4}
Per Cederqvist's avatar
Per Cederqvist committed
475

Per Cederqvist's avatar
Per Cederqvist committed
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
send "1062 27 5 4 { 9 16 12 13 }\n"
simple_expect "=1062"
send "1063 27 1 1 { 4 }\n"
simple_expect "=1063"
send "1064 27 2 1 { 5 }\n"
simple_expect "=1064"
send "1065 27 3 1 { 19 }\n"
simple_expect "=1065"
send "1066 27 4 1 { 20 }\n"
simple_expect "=1066"

checkit 0 5 255 7 7 "{ 9 12 13 16 18 19 20 }" "5 { 1 7 9 9 12 13 16 16 18 20 }"
if {$lazy_expand} {
    checkit 1 1 100 2 3 "{ 4 8 9 }"           "3 { 1 2 4 4 8 9 }"
} else {
    checkit 1 1 100 2 6 "{ 4 8 9 10 11 12 }"  "3 { 1 2 4 4 8 12 }"
}
checkit 2 2 100 5 0 "\\*"	      "1 { 1 5 }"
checkit 3 3 100 20 0 "\\*"            "1 { 1 20 }"
checkit 4 4 100 3 4 "{ 17 18 19 20 }" "2 { 1 3 17 20 }"
496
check_unread_confs {5 1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
497
498
499
500
501
502
503
504
505
506
507
508

restart

checkit 0 5 255 7 7 "{ 9 12 13 16 18 19 20 }" "5 { 1 7 9 9 12 13 16 16 18 20 }"
if {$lazy_expand} {
    checkit 1 1 100 2 3 "{ 4 8 9 }"           "3 { 1 2 4 4 8 9 }"
} else {
    checkit 1 1 100 2 6 "{ 4 8 9 10 11 12 }"  "3 { 1 2 4 4 8 12 }"
}
checkit 2 2 100 5 0 "\\*"	      "1 { 1 5 }"
checkit 3 3 100 20 0 "\\*"            "1 { 1 20 }"
checkit 4 4 100 3 4 "{ 17 18 19 20 }" "2 { 1 3 17 20 }"
509
check_unread_confs {5 1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528

send "1067 27 5 6 { 8 10 11 14 17 15 }\n"
simple_expect "=1067"
send "1068 27 1 1 { 16 }\n"
simple_expect "=1068"
send "1069 27 2 1 { 6 }\n"
simple_expect "=1069"
send "1070 27 4 1 { 4 }\n"
simple_expect "=1070"

checkit 0 5 255 20 0 "\\*" "1 { 1 20 }"
if {$lazy_expand} {
    checkit 1 1 100 2 4 "{ 4 8 9 16 }"           "4 { 1 2 4 4 8 9 16 16 }"
} else {
    checkit 1 1 100 2 9 "{ 4 8 9 10 11 12 14 15 16 }" \
	"4 { 1 2 4 4 8 12 14 16 }"
}
checkit 2 2 100 6 0 "\\*"	      "1 { 1 6 }"
checkit 4 4 100 4 4 "{ 17 18 19 20 }" "2 { 1 4 17 20 }"
529
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
530
531
532
533
534
535
536
537
538
539
540
541

restart

checkit 0 5 255 20 0 "\\*" "1 { 1 20 }"
if {$lazy_expand} {
    checkit 1 1 100 2 4 "{ 4 8 9 16 }"           "4 { 1 2 4 4 8 9 16 16 }"
} else {
    checkit 1 1 100 2 9 "{ 4 8 9 10 11 12 14 15 16 }" \
	"4 { 1 2 4 4 8 12 14 16 }"
}
checkit 2 2 100 6 0 "\\*"	      "1 { 1 6 }"
checkit 4 4 100 4 4 "{ 17 18 19 20 }" "2 { 1 4 17 20 }"
542
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557

send "1071 27 1 1 { 3 }\n"
simple_expect "=1071"
send "1072 27 2 1 { 8 }\n"
simple_expect "=1072"
send "1073 27 4 1 { 16 }\n"
simple_expect "=1073"

if {$lazy_expand} {
    checkit 1 1 100 4 3 "{ 8 9 16 }"                "3 { 1 4 8 9 16 16 }"
} else {
    checkit 1 1 100 4 8 "{ 8 9 10 11 12 14 15 16 }" "3 { 1 4 8 12 14 16 }"
}
checkit 2 2 100 6 1 "{ 8 }"	      "2 { 1 6 8 8 }"
checkit 4 4 100 4 5 "{ 16 17 18 19 20 }" "2 { 1 4 16 20 }"
558
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
559
560
561
562
563
564
565
566
567
568

restart

if {$lazy_expand} {
    checkit 1 1 100 4 3 "{ 8 9 16 }"                "3 { 1 4 8 9 16 16 }"
} else {
    checkit 1 1 100 4 8 "{ 8 9 10 11 12 14 15 16 }" "3 { 1 4 8 12 14 16 }"
}
checkit 2 2 100 6 1 "{ 8 }"	      "2 { 1 6 8 8 }"
checkit 4 4 100 4 5 "{ 16 17 18 19 20 }" "2 { 1 4 16 20 }"
569
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584

send "1074 27 1 1 { 5 }\n"
simple_expect "=1074"
send "1075 27 2 1 { 7 }\n"
simple_expect "=1075"
send "1076 27 4 1 { 5 }\n"
simple_expect "=1076"

if {$lazy_expand} {
    checkit 1 1 100 5 3 "{ 8 9 16 }"                "3 { 1 5 8 9 16 16 }"
} else {
    checkit 1 1 100 5 8 "{ 8 9 10 11 12 14 15 16 }" "3 { 1 5 8 12 14 16 }"
}
checkit 2 2 100 8 0 "\\*"	      "1 { 1 8 }"
checkit 4 4 100 5 5 "{ 16 17 18 19 20 }" "2 { 1 5 16 20 }"
585
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
586
587
588
589
590
591
592
593
594
595

restart

if {$lazy_expand} {
    checkit 1 1 100 5 3 "{ 8 9 16 }"                "3 { 1 5 8 9 16 16 }"
} else {
    checkit 1 1 100 5 8 "{ 8 9 10 11 12 14 15 16 }" "3 { 1 5 8 12 14 16 }"
}
checkit 2 2 100 8 0 "\\*"	      "1 { 1 8 }"
checkit 4 4 100 5 5 "{ 16 17 18 19 20 }" "2 { 1 5 16 20 }"
596
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611

send "1077 27 1 1 { 6 }\n"
simple_expect "=1077"
send "1078 27 2 1 { 9 }\n"
simple_expect "=1078"
send "1079 27 4 1 { 6 }\n"
simple_expect "=1079"

if {$lazy_expand} {
    checkit 1 1 100 6 3 "{ 8 9 16 }"                "3 { 1 6 8 9 16 16 }"
} else {
    checkit 1 1 100 6 8 "{ 8 9 10 11 12 14 15 16 }" "3 { 1 6 8 12 14 16 }"
}
checkit 2 2 100 9 0 "\\*"	         "1 { 1 9 }"
checkit 4 4 100 6 5 "{ 16 17 18 19 20 }" "2 { 1 6 16 20 }"
612
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
613
614
615
616
617
618
619
620
621
622

restart

if {$lazy_expand} {
    checkit 1 1 100 6 3 "{ 8 9 16 }"                "3 { 1 6 8 9 16 16 }"
} else {
    checkit 1 1 100 6 8 "{ 8 9 10 11 12 14 15 16 }" "3 { 1 6 8 12 14 16 }"
}
checkit 2 2 100 9 0 "\\*"	         "1 { 1 9 }"
checkit 4 4 100 6 5 "{ 16 17 18 19 20 }" "2 { 1 6 16 20 }"
623
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638

send "1080 27 1 1 { 7 }\n"
simple_expect "=1080"
send "1081 27 2 1 { 10 }\n"
simple_expect "=1081"
send "1082 27 4 1 { 7 }\n"
simple_expect "=1082"

if {$lazy_expand} {
    checkit 1 1 100 12 1 "{ 16 }"       "2 { 1 12 16 16 }"
} else {
    checkit 1 1 100 12 3 "{ 14 15 16 }" "2 { 1 12 14 16 }"
}
checkit 2 2 100 10 0 "\\*"	         "1 { 1 10 }"
checkit 4 4 100 7 5 "{ 16 17 18 19 20 }" "2 { 1 7 16 20 }"
639
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
640
641
642
643
644
645
646
647
648
649

restart

if {$lazy_expand} {
    checkit 1 1 100 12 1 "{ 16 }"       "2 { 1 12 16 16 }"
} else {
    checkit 1 1 100 12 3 "{ 14 15 16 }" "2 { 1 12 14 16 }"
}
checkit 2 2 100 10 0 "\\*"	         "1 { 1 10 }"
checkit 4 4 100 7 5 "{ 16 17 18 19 20 }" "2 { 1 7 16 20 }"
650
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
651
652
653
654
655
656
657
658
659
660
661

send "1083 27 1 1 { 13 }\n"
simple_expect "=1083"
send "1084 27 2 1 { 11 }\n"
simple_expect "=1084"
send "1085 27 4 1 { 8 }\n"
simple_expect "=1085"

checkit 1 1 100 16 0 "\\*" "1 { 1 16 }"
checkit 2 2 100 11 0 "\\*" "1 { 1 11 }"
checkit 4 4 100 8 5 "{ 16 17 18 19 20 }" "2 { 1 8 16 20 }"
662
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
663
664
665
666
667
668

restart

checkit 1 1 100 16 0 "\\*" "1 { 1 16 }"
checkit 2 2 100 11 0 "\\*" "1 { 1 11 }"
checkit 4 4 100 8 5 "{ 16 17 18 19 20 }" "2 { 1 8 16 20 }"
669
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718

send "1086 27 1 1 { 17 }\n"
simple_expect "=1086"
send "1087 27 1 1 { 18 }\n"
simple_expect "=1087"
send "1088 27 1 1 { 19 }\n"
simple_expect "=1088"
send "1089 27 1 1 { 20 }\n"
simple_expect "=1089"

send "1090 27 2 1 { 12 }\n"
simple_expect "=1090"
send "1091 27 2 1 { 13 }\n"
simple_expect "=1091"
send "1092 27 2 1 { 14 }\n"
simple_expect "=1092"
send "1093 27 2 1 { 15 }\n"
simple_expect "=1093"
send "1094 27 2 1 { 16 }\n"
simple_expect "=1094"
send "1095 27 2 1 { 17 }\n"
simple_expect "=1095"
send "1096 27 2 1 { 18 }\n"
simple_expect "=1096"
send "1097 27 2 1 { 19 }\n"
simple_expect "=1097"
send "1098 27 2 1 { 20 }\n"
simple_expect "=1098"

send "1099 27 4 1 { 9 }\n"
simple_expect "=1099"
send "1100 27 4 1 { 10 }\n"
simple_expect "=1100"
send "1101 27 4 1 { 11 }\n"
simple_expect "=1101"
send "1102 27 4 1 { 12 }\n"
simple_expect "=1102"
send "1103 27 4 1 { 13 }\n"
simple_expect "=1103"
send "1104 27 4 1 { 14 }\n"
simple_expect "=1104"
send "1105 27 4 1 { 15 }\n"
simple_expect "=1105"

checkit 0 5 255 20 0 "\\*" "1 { 1 20 }"
checkit 1 1 100 20 0 "\\*" "1 { 1 20 }"
checkit 2 2 100 20 0 "\\*" "1 { 1 20 }"
checkit 3 3 100 20 0 "\\*" "1 { 1 20 }"
checkit 4 4 100 20 0 "\\*" "1 { 1 20 }"
719
check_unread_confs {}
Per Cederqvist's avatar
Per Cederqvist committed
720
721
722
723
724
725
726
727

restart

checkit 0 5 255 20 0 "\\*" "1 { 1 20 }"
checkit 1 1 100 20 0 "\\*" "1 { 1 20 }"
checkit 2 2 100 20 0 "\\*" "1 { 1 20 }"
checkit 3 3 100 20 0 "\\*" "1 { 1 20 }"
checkit 4 4 100 20 0 "\\*" "1 { 1 20 }"
728
check_unread_confs {}
Per Cederqvist's avatar
Per Cederqvist committed
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746

# Make everything unread once again.
send "1106 77 5 0\n"
simple_expect "=1106"
send "1107 77 1 0\n"
simple_expect "=1107"
send "1108 77 2 0\n"
simple_expect "=1108"
send "1109 77 3 0\n"
simple_expect "=1109"
send "1110 77 4 0\n"
simple_expect "=1110"

checkit 0 5 255 0 0 "\\*" "0 \\*"
checkit 1 1 100 0 0 "\\*" "0 \\*"
checkit 2 2 100 0 0 "\\*" "0 \\*"
checkit 3 3 100 0 0 "\\*" "0 \\*"
checkit 4 4 100 0 0 "\\*" "0 \\*"
747
check_unread_confs {5 1 2 3 4}
Per Cederqvist's avatar
Per Cederqvist committed
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783

# Subtract text 1, 3, 5-18, 20 from conference 5.
foreach lno {1 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20} {
    send "101 31 $lno 5\n"
    simple_expect "=101"
}

# Subtract text 1-2 (10-12, 14-15) from conference 1.
send "1111 31 1 1\n"
simple_expect "=1111"
send "1112 31 2 1\n"
simple_expect "=1112"

# Subtract text (3-4), 5-8, 10-18 from conference 2.
foreach lno {5 6 7 8 10 11 12 13 14 15 16 17 18} {
    send "101 31 $lno 2\n"
    simple_expect "=101"
}

# Subtract text 1-20 from conference 3.
foreach lno {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20} {
    send "101 31 $lno 3\n"
    simple_expect "=101"
}

# Subtract text 10-20 from conference 4.
foreach lno {10 11 12 13 14 15 16 17 18 19 20} {
    send "101 31 $lno 4\n"
    simple_expect "=101"
}

checkit 0 5 255 0 0 "\\*" "0 \\*"
checkit 1 1 100 0 0 "\\*" "0 \\*"
checkit 2 2 100 0 0 "\\*" "0 \\*"
checkit 3 3 100 0 0 "\\*" "0 \\*"
checkit 4 4 100 0 0 "\\*" "0 \\*"
784
check_unread_confs {5 1 2 3 4}
Per Cederqvist's avatar
Per Cederqvist committed
785
786
787
788
789
790
791
792

restart

checkit 0 5 255 0 0 "\\*" "0 \\*"
checkit 1 1 100 0 0 "\\*" "0 \\*"
checkit 2 2 100 0 0 "\\*" "0 \\*"
checkit 3 3 100 0 0 "\\*" "0 \\*"
checkit 4 4 100 0 0 "\\*" "0 \\*"
793
check_unread_confs {5 1 2 3 4}
Per Cederqvist's avatar
Per Cederqvist committed
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810

send "1113 27 5 1 { 2 }\n"
simple_expect "=1113"
send "1114 27 1 1 { 3 }\n"
simple_expect "=1114"
send "1115 27 2 1 { 1 }\n"
simple_expect "=1115"
send "1116 27 3 1 { 10 }\n"
simple_expect "=1116"
send "1117 27 4 1 { 1 }\n"
simple_expect "=1117"

checkit 0 5 255 3 0 "\\*"  "1 { 1 3 }"
checkit 1 1 100 3 0 "\\*"  "1 { 1 3 }"
checkit 2 2 100 1 0 "\\*"  "1 { 1 1 }"
checkit 3 3 100 20 0 "\\*" "1 { 1 20 }"
checkit 4 4 100 1 0 "\\*"  "1 { 1 1 }"
811
check_unread_confs {5 1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
812
813
814
815
816
817
818
819

restart

checkit 0 5 255 3 0 "\\*"  "1 { 1 3 }"
checkit 1 1 100 3 0 "\\*"  "1 { 1 3 }"
checkit 2 2 100 1 0 "\\*"  "1 { 1 1 }"
checkit 3 3 100 20 0 "\\*" "1 { 1 20 }"
checkit 4 4 100 1 0 "\\*"  "1 { 1 1 }"
820
check_unread_confs {5 1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838

send "1118 27 5 1 { 19 }\n"
simple_expect "=1118"
send "1119 27 1 1 { 4 }\n"
simple_expect "=1119"
send "1120 27 2 1 { 2 }\n"
simple_expect "=1120"
send "1121 27 4 1 { 2 }\n"
simple_expect "=1121"

if {$lazy_expand} {
    checkit 0 5 255 3 1 "{ 19 }"  "2 { 1 3 19 19 }"
} else {
    checkit 0 5 255 3 16 "{ 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 }"  "2 { 1 3 5 20 }"
}
checkit 1 1 100 4 0 "\\*"  "1 { 1 4 }"
checkit 2 2 100 8 0 "\\*"  "1 { 1 8 }"
checkit 4 4 100 2 0 "\\*"  "1 { 1 2 }"
839
check_unread_confs {5 1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
840
841
842
843
844
845
846
847
848
849
850

restart

if {$lazy_expand} {
    checkit 0 5 255 3 1 "{ 19 }"  "2 { 1 3 19 19 }"
} else {
    checkit 0 5 255 3 16 "{ 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 }"  "2 { 1 3 5 20 }"
}
checkit 1 1 100 4 0 "\\*"  "1 { 1 4 }"
checkit 2 2 100 8 0 "\\*"  "1 { 1 8 }"
checkit 4 4 100 2 0 "\\*"  "1 { 1 2 }"
851
check_unread_confs {5 1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
852
853
854
855
856
857
858
859
860
861
862
863
864
865

send "1122 27 5 1 { 4 }\n"
simple_expect "=1122"
send "1123 27 1 1 { 5 }\n"
simple_expect "=1123"
send "1124 27 2 1 { 9 }\n"
simple_expect "=1124"
send "1125 27 4 1 { 3 }\n"
simple_expect "=1125"

checkit 0 5 255 20 0 "\\*"  "1 { 1 20 }"
checkit 1 1 100 5 0 "\\*"   "1 { 1 5 }"
checkit 2 2 100 18 0 "\\*"  "1 { 1 18 }"
checkit 4 4 100 3 0 "\\*"   "1 { 1 3 }"
866
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
867
868
869
870
871
872
873

restart

checkit 0 5 255 20 0 "\\*"  "1 { 1 20 }"
checkit 1 1 100 5 0 "\\*"   "1 { 1 5 }"
checkit 2 2 100 18 0 "\\*"  "1 { 1 18 }"
checkit 4 4 100 3 0 "\\*"   "1 { 1 3 }"
874
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
875
876
877
878
879
880
881
882
883
884
885

send "1126 27 1 3 { 6 7 8 }\n"
simple_expect "=1126"
send "1127 27 2 1 { 19 }\n"
simple_expect "=1127"
send "1128 27 4 5 { 4 6 8 7 5 }\n"
simple_expect "=1128"

checkit 1 1 100 8 0 "\\*"   "1 { 1 8 }"
checkit 2 2 100 19 0 "\\*"  "1 { 1 19 }"
checkit 4 4 100 8 0 "\\*"   "1 { 1 8 }"
886
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
887
888
889
890
891
892

restart

checkit 1 1 100 8 0 "\\*"   "1 { 1 8 }"
checkit 2 2 100 19 0 "\\*"  "1 { 1 19 }"
checkit 4 4 100 8 0 "\\*"   "1 { 1 8 }"
893
check_unread_confs {1 2 4}
Per Cederqvist's avatar
Per Cederqvist committed
894
895
896
897
898
899
900
901

send "1129 27 1 1 { 9 }\n"
simple_expect "=1129"
send "1130 27 2 1 { 20 }\n"
simple_expect "=1130"
send "1131 27 4 1 { 9 }\n"
simple_expect "=1131"

902
checkit 1 1 100 12 0 "\\*"  "1 { 1 12 }"
Per Cederqvist's avatar
Per Cederqvist committed
903
904
checkit 2 2 100 20 0 "\\*"  "1 { 1 20 }"
checkit 4 4 100 20 0 "\\*"  "1 { 1 20 }"
905
check_unread_confs {1}
Per Cederqvist's avatar
Per Cederqvist committed
906
907
908

restart

909
checkit 1 1 100 12 0 "\\*"  "1 { 1 12 }"
Per Cederqvist's avatar
Per Cederqvist committed
910
911
checkit 2 2 100 20 0 "\\*"  "1 { 1 20 }"
checkit 4 4 100 20 0 "\\*"  "1 { 1 20 }"
912
check_unread_confs {1}
Per Cederqvist's avatar
Per Cederqvist committed
913
914
915
916

send "1132 27 1 1 { 13 }\n"
simple_expect "=1132"

917
checkit 1 1 100 15 0 "\\*"  "1 { 1 15 }"
918
check_unread_confs {1}
Per Cederqvist's avatar
Per Cederqvist committed
919
920
921

restart

922
checkit 1 1 100 15 0 "\\*"  "1 { 1 15 }"
923
check_unread_confs {1}
Per Cederqvist's avatar
Per Cederqvist committed
924
925
926
927
928
929
930
931
932

send "1133 27 1 5 { 20 19 18 17 16 }\n"
simple_expect "=1133"

checkit 0 5 255 20 0 "\\*" "1 { 1 20 }"
checkit 1 1 100 20 0 "\\*" "1 { 1 20 }"
checkit 2 2 100 20 0 "\\*" "1 { 1 20 }"
checkit 3 3 100 20 0 "\\*" "1 { 1 20 }"
checkit 4 4 100 20 0 "\\*" "1 { 1 20 }"
933
check_unread_confs {}
Per Cederqvist's avatar
Per Cederqvist committed
934
935
936
937
938
939
940
941

restart

checkit 0 5 255 20 0 "\\*" "1 { 1 20 }"
checkit 1 1 100 20 0 "\\*" "1 { 1 20 }"
checkit 2 2 100 20 0 "\\*" "1 { 1 20 }"
checkit 3 3 100 20 0 "\\*" "1 { 1 20 }"
checkit 4 4 100 20 0 "\\*" "1 { 1 20 }"
942
check_unread_confs {}
Per Cederqvist's avatar
Per Cederqvist committed
943

944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
proc checktrunc {limit res} {
    global any_time

    send "200 108 5 4 1 1 $limit\n"
    simple_expect "=200 1 { 4 $any_time 4 100 $res 5 $any_time 00000000 }"
    send "201 107 5 4 1 $limit\n"
    simple_expect "=201 4 $any_time 4 100 $res 5 $any_time 00000000"
}

checktrunc 0 "1 { 1 20 }"
checktrunc 1 "1 { 1 20 }"
checktrunc 2 "1 { 1 20 }"
checktrunc 3 "1 { 1 20 }"

send "1134 77 4 0\n"
simple_expect "=1134"

checktrunc 0 "0 \\*"
checktrunc 1 "0 \\*"
checktrunc 2 "0 \\*"
checktrunc 3 "0 \\*"

send "1135 27 4 1 { 18 }\n"
simple_expect "=1135"

checktrunc 0 "1 { 10 20 }"
checktrunc 1 "1 { 10 20 }"
checktrunc 2 "1 { 10 20 }"
checktrunc 3 "1 { 10 20 }"

send "1136 27 4 1 { 2 }\n"
simple_expect "=1136"

checktrunc 0 "2 { 2 2 10 20 }"
checktrunc 1 "1 { 2 2 }"
checktrunc 2 "2 { 2 2 10 20 }"
checktrunc 3 "2 { 2 2 10 20 }"

send "1137 27 4 1 { 5 }\n"
simple_expect "=1137"

checktrunc 0 "3 { 2 2 5 5 10 20 }"
checktrunc 1 "1 { 2 2 }"
checktrunc 2 "2 { 2 2 5 5 }"
checktrunc 3 "3 { 2 2 5 5 10 20 }"
checktrunc 4 "3 { 2 2 5 5 10 20 }"

send "1138 27 4 1 { 1 }\n"
simple_expect "=1138"

checktrunc 0 "3 { 1 2 5 5 10 20 }"
checktrunc 1 "1 { 1 2 }"
checktrunc 2 "2 { 1 2 5 5 }"
checktrunc 3 "3 { 1 2 5 5 10 20 }"
checktrunc 4 "3 { 1 2 5 5 10 20 }"

send "1139 27 4 2 { 4 3 }\n"
simple_expect "=1139"

checktrunc 0 "2 { 1 5 10 20 }"
checktrunc 1 "1 { 1 5 }"
checktrunc 2 "2 { 1 5 10 20 }"
checktrunc 3 "2 { 1 5 10 20 }"
checktrunc 4 "2 { 1 5 10 20 }"

Per Cederqvist's avatar
Per Cederqvist committed
1009
1010
1011
stop

release_lock