Commit 17aefbd6 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(check_unread_confs): New proc. Use it several times.

parent 795d8d6b
......@@ -97,6 +97,14 @@ proc checkit {pos conf prio last arrsize array ranges} {
simple_expect "=6 $any_time $conf $prio $last $arrsize $array" "$last $arrsize $array"
}
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] \\*"
}
}
start
checkit 0 5 255 0 0 "\\*" "0 \\*"
......@@ -104,6 +112,7 @@ 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 \\*"
check_unread_confs {5 1 2 3 4}
restart
......@@ -112,6 +121,7 @@ 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 \\*"
check_unread_confs {5 1 2 3 4}
send "1000 27 5 1 { 2 }\n"
simple_expect "=1000"
......@@ -129,6 +139,7 @@ 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 }"
check_unread_confs {5 1 2 3 4}
restart
......@@ -137,6 +148,7 @@ 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 }"
check_unread_confs {5 1 2 3 4}
send "1005 27 5 1 { 4 }\n"
simple_expect "=1005"
......@@ -154,6 +166,7 @@ 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 }"
check_unread_confs {5 1 2 3 4}
restart
......@@ -162,6 +175,7 @@ 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 }"
check_unread_confs {5 1 2 3 4}
send "1010 27 5 1 { 3 }\n"
simple_expect "=1010"
......@@ -179,6 +193,7 @@ 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 }"
check_unread_confs {5 1 2 3 4}
restart
......@@ -187,6 +202,7 @@ 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 }"
check_unread_confs {5 1 2 3 4}
send "1015 27 5 1 { 1 }\n"
simple_expect "=1015"
......@@ -204,6 +220,7 @@ 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 }"
check_unread_confs {5 1 2 3 4}
restart
......@@ -212,6 +229,7 @@ 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 }"
check_unread_confs {5 1 2 3 4}
send "1020 27 5 1 { 7 }\n"
simple_expect "=1020"
......@@ -230,6 +248,7 @@ 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 \\*"
check_unread_confs {5 1 2 3 4}
restart
......@@ -239,6 +258,7 @@ 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 \\*"
check_unread_confs {5 1 2 3 4}
send "1025 27 5 1 { 6 }\n"
simple_expect "=1025"
......@@ -257,6 +277,7 @@ 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 }" \
"4 { 1 4 6 9 11 14 16 16 18 18 }"
checkit 4 4 100 0 1 "{ 3 }" "1 { 3 3 }"
check_unread_confs {5 1 2 3 4}
restart
......@@ -266,6 +287,7 @@ 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 }"
check_unread_confs {5 1 2 3 4}
send "1030 27 5 1 { 5 }\n"
simple_expect "=1030"
......@@ -283,6 +305,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 }"
check_unread_confs {5 1 2 3 4}
restart
......@@ -291,6 +314,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 }"
check_unread_confs {5 1 2 3 4}
send "1035 27 5 1 { 20 }\n"
simple_expect "=1035"
......@@ -308,6 +332,7 @@ 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 }"
check_unread_confs {5 1 2 3 4}
restart
......@@ -343,6 +368,7 @@ 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 }"
check_unread_confs {5 1 2 3 4}
restart
......@@ -355,6 +381,7 @@ 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 }"
check_unread_confs {5 1 2 3 4}
# Subtract texts 10-12, 14-15 from conference 1.
send "1046 31 10 1\n"
......@@ -388,6 +415,7 @@ 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 }"
check_unread_confs {5 1 2 3 4}
restart
......@@ -396,6 +424,7 @@ 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 }"
check_unread_confs {5 1 2 3 4}
send "1057 27 5 1 { 18 }\n"
simple_expect "=1057"
......@@ -417,6 +446,7 @@ if {$lazy_expand} {
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 }"
check_unread_confs {5 1 2 3 4}
restart
......@@ -429,6 +459,7 @@ if {$lazy_expand} {
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 }"
check_unread_confs {5 1 2 3 4}
send "1062 27 5 4 { 9 16 12 13 }\n"
simple_expect "=1062"
......@@ -450,6 +481,7 @@ if {$lazy_expand} {
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 }"
check_unread_confs {5 1 2 4}
restart
......@@ -462,6 +494,7 @@ if {$lazy_expand} {
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 }"
check_unread_confs {5 1 2 4}
send "1067 27 5 6 { 8 10 11 14 17 15 }\n"
simple_expect "=1067"
......@@ -481,6 +514,7 @@ if {$lazy_expand} {
}
checkit 2 2 100 6 0 "\\*" "1 { 1 6 }"
checkit 4 4 100 4 4 "{ 17 18 19 20 }" "2 { 1 4 17 20 }"
check_unread_confs {1 2 4}
restart
......@@ -493,6 +527,7 @@ if {$lazy_expand} {
}
checkit 2 2 100 6 0 "\\*" "1 { 1 6 }"
checkit 4 4 100 4 4 "{ 17 18 19 20 }" "2 { 1 4 17 20 }"
check_unread_confs {1 2 4}
send "1071 27 1 1 { 3 }\n"
simple_expect "=1071"
......@@ -508,6 +543,7 @@ if {$lazy_expand} {
}
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 }"
check_unread_confs {1 2 4}
restart
......@@ -518,6 +554,7 @@ if {$lazy_expand} {
}
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 }"
check_unread_confs {1 2 4}
send "1074 27 1 1 { 5 }\n"
simple_expect "=1074"
......@@ -533,6 +570,7 @@ if {$lazy_expand} {
}
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 }"
check_unread_confs {1 2 4}
restart
......@@ -543,6 +581,7 @@ if {$lazy_expand} {
}
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 }"
check_unread_confs {1 2 4}
send "1077 27 1 1 { 6 }\n"
simple_expect "=1077"
......@@ -558,6 +597,7 @@ if {$lazy_expand} {
}
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 }"
check_unread_confs {1 2 4}
restart
......@@ -568,6 +608,7 @@ if {$lazy_expand} {
}
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 }"
check_unread_confs {1 2 4}
send "1080 27 1 1 { 7 }\n"
simple_expect "=1080"
......@@ -583,6 +624,7 @@ if {$lazy_expand} {
}
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 }"
check_unread_confs {1 2 4}
restart
......@@ -593,6 +635,7 @@ if {$lazy_expand} {
}
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 }"
check_unread_confs {1 2 4}
send "1083 27 1 1 { 13 }\n"
simple_expect "=1083"
......@@ -604,12 +647,14 @@ 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 }"
check_unread_confs {1 2 4}
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 }"
check_unread_confs {1 2 4}
send "1086 27 1 1 { 17 }\n"
simple_expect "=1086"
......@@ -659,6 +704,7 @@ 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 }"
check_unread_confs {}
restart
......@@ -667,6 +713,7 @@ 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 }"
check_unread_confs {}
# Make everything unread once again.
send "1106 77 5 0\n"
......@@ -685,6 +732,7 @@ 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 \\*"
check_unread_confs {5 1 2 3 4}
# 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} {
......@@ -721,6 +769,7 @@ 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 \\*"
check_unread_confs {5 1 2 3 4}
restart
......@@ -729,6 +778,7 @@ 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 \\*"
check_unread_confs {5 1 2 3 4}
send "1113 27 5 1 { 2 }\n"
simple_expect "=1113"
......@@ -746,6 +796,7 @@ 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 }"
check_unread_confs {5 1 2 4}
restart
......@@ -754,6 +805,7 @@ 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 }"
check_unread_confs {5 1 2 4}
send "1118 27 5 1 { 19 }\n"
simple_expect "=1118"
......@@ -772,6 +824,7 @@ if {$lazy_expand} {
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 }"
check_unread_confs {5 1 2 4}
restart
......@@ -783,6 +836,7 @@ if {$lazy_expand} {
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 }"
check_unread_confs {5 1 2 4}
send "1122 27 5 1 { 4 }\n"
simple_expect "=1122"
......@@ -797,6 +851,7 @@ 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 }"
check_unread_confs {1 2 4}
restart
......@@ -804,6 +859,7 @@ 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 }"
check_unread_confs {1 2 4}
send "1126 27 1 3 { 6 7 8 }\n"
simple_expect "=1126"
......@@ -815,12 +871,14 @@ 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 }"
check_unread_confs {1 2 4}
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 }"
check_unread_confs {1 2 4}
send "1129 27 1 1 { 9 }\n"
simple_expect "=1129"
......@@ -832,21 +890,25 @@ simple_expect "=1131"
checkit 1 1 100 12 0 "\\*" "1 { 12 12 }"
checkit 2 2 100 20 0 "\\*" "1 { 1 20 }"
checkit 4 4 100 20 0 "\\*" "1 { 1 20 }"
check_unread_confs {1}
restart
checkit 1 1 100 12 0 "\\*" "1 { 12 12 }"
checkit 2 2 100 20 0 "\\*" "1 { 1 20 }"
checkit 4 4 100 20 0 "\\*" "1 { 1 20 }"
check_unread_confs {1}
send "1132 27 1 1 { 13 }\n"
simple_expect "=1132"
checkit 1 1 100 15 0 "\\*" "1 { 15 15 }"
check_unread_confs {1}
restart
checkit 1 1 100 15 0 "\\*" "1 { 15 15 }"
check_unread_confs {1}
send "1133 27 1 5 { 20 19 18 17 16 }\n"
simple_expect "=1133"
......@@ -856,6 +918,7 @@ 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 }"
check_unread_confs {}
restart
......@@ -864,6 +927,7 @@ 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 }"
check_unread_confs {}
stop
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment