Commit 55766f67 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Fixed a couple of errors in the range-based test cases.

(checkit): Test 107=query-read-texts and 108=get-membership.
(checktrunc): New proc.  Use it a few times to check that the new
	requests can truncate the ranges of read texts.
parent c318bbfd
......@@ -95,6 +95,18 @@ proc checkit {pos conf prio last arrsize array ranges} {
simple_expect "=5 1 { $any_time $conf $prio $last $arrsize $array }" "$last $arrsize $array"
send "6 9 5 $conf\n"
simple_expect "=6 $any_time $conf $prio $last $arrsize $array" "$last $arrsize $array"
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"
}
proc check_unread_confs {confs} {
......@@ -275,7 +287,7 @@ 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 }" \
"4 { 1 4 6 9 11 14 16 16 18 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}
......@@ -327,7 +339,7 @@ simple_expect "=1038"
send "1039 27 4 1 { 1 }\n"
simple_expect "=1039"
checkit 0 5 255 7 1 "{ 20 }" "1 { 1 7 }"
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 }"
......@@ -358,7 +370,7 @@ send "1045 27 4 1 { 18 }\n"
simple_expect "=1045"
if {$mark_as_read_atomic} {
checkit 0 5 255 7 1 "{ 20 }" "2 { 1 7 19 19 }"
checkit 0 5 255 7 1 "{ 20 }" "2 { 1 7 20 20 }"
} else {
setup_xfail "*-*-*" "mark-as-read processes some stuff and returns error"
fail "mark-as-read"
......@@ -373,7 +385,7 @@ check_unread_confs {5 1 2 3 4}
restart
if {$mark_as_read_atomic} {
checkit 0 5 255 7 1 "{ 20 }" "2 { 1 7 19 19 }"
checkit 0 5 255 7 1 "{ 20 }" "2 { 1 7 20 20 }"
} else {
checkit 0 5 255 7 2 "{ 19 20 }" "2 { 1 7 19 20 }"
}
......@@ -887,14 +899,14 @@ simple_expect "=1130"
send "1131 27 4 1 { 9 }\n"
simple_expect "=1131"
checkit 1 1 100 12 0 "\\*" "1 { 12 12 }"
checkit 1 1 100 12 0 "\\*" "1 { 1 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 1 1 100 12 0 "\\*" "1 { 1 12 }"
checkit 2 2 100 20 0 "\\*" "1 { 1 20 }"
checkit 4 4 100 20 0 "\\*" "1 { 1 20 }"
check_unread_confs {1}
......@@ -902,12 +914,12 @@ check_unread_confs {1}
send "1132 27 1 1 { 13 }\n"
simple_expect "=1132"
checkit 1 1 100 15 0 "\\*" "1 { 15 15 }"
checkit 1 1 100 15 0 "\\*" "1 { 1 15 }"
check_unread_confs {1}
restart
checkit 1 1 100 15 0 "\\*" "1 { 15 15 }"
checkit 1 1 100 15 0 "\\*" "1 { 1 15 }"
check_unread_confs {1}
send "1133 27 1 5 { 20 19 18 17 16 }\n"
......@@ -929,6 +941,71 @@ checkit 3 3 100 20 0 "\\*" "1 { 1 20 }"
checkit 4 4 100 20 0 "\\*" "1 { 1 20 }"
check_unread_confs {}
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 }"
stop
release_lock
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