Commit ab8aaa47 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Added more tests. Added tests for get-created-texts.

parent 382c1d6e
# Test get_map and local_to_global.
# Test get_created_texts.
# As a side effect a lot of other things are also tested.
# The following texts are created by this test case:
......@@ -7,14 +8,16 @@
# 5 1 1<1>
# 5 2 2<1>
# 5 3 1<2> 3<1>
# 6 4 1<3>
# 6 5 1<4>
# 6 4 1<3>
# 6 5 1<4>
# 5 6 1<5>
# 5 7 1<6>
# 5 8 1<7>
# 5 9 1<8>
# 5 10 1<9>
# 6 11 1<10>
# 6 12 1<11>
# 6 13 1<11>
lyskomd_start
client_start 0
......@@ -451,20 +454,70 @@ simple_expect "=1115 1 0 2 { 2 3 5 6 }"
send "1116 103 1 2 3\n"
simple_expect "=1116 1 1 2 5 { 3 0 0 6 7 }"
# Texts written by person 5:
# ano: 1 2 3 4 5 6 7 8
# tno: 1 2 3 6 7 8 9 10
# Texts written by person 6:
# ano: . 2
# tno: . 5
send "1117 47 5 1 50\n"
simple_expect "=1117 1 8 { 1 2 3 6 7 8 9 10 }"
send "1118 47 5 1 8\n"
simple_expect "=1118 1 8 { 1 2 3 6 7 8 9 10 }"
send "1119 47 5 1 7\n"
simple_expect "=1119 1 7 { 1 2 3 6 7 8 9 }"
send "1120 47 5 1 6\n"
simple_expect "=1120 1 6 { 1 2 3 6 7 8 }"
send "1121 47 5 1 1\n"
simple_expect "=1121 1 1 { 1 }"
send "1122 47 5 0 1\n"
simple_expect "=1122 1 1 { 1 }"
send "1123 47 5 0 2\n"
simple_expect "=1123 1 2 { 1 2 }"
send "1124 47 5 5 3\n"
simple_expect "=1124 5 3 { 7 8 9 }"
send "1125 47 5 5 4\n"
simple_expect "=1125 5 4 { 7 8 9 10 }"
send "1126 47 5 5 5\n"
simple_expect "=1126 5 4 { 7 8 9 10 }"
send "1127 47 5 8 4\n"
simple_expect "=1127 8 1 { 10 }"
send "1128 47 5 9 4\n"
simple_expect "%1128 16 9"
send "1129 47 5 10 4\n"
simple_expect "%1129 16 10"
send "1130 47 6 1 10\n"
simple_expect "=1130 2 1 { 5 }"
# Remove some more
talk_to client 0
send "1117 29 6\n"
simple_expect "=1117"
send "1131 29 6\n"
simple_expect "=1131"
send "1118 29 7\n"
simple_expect "=1118"
send "1132 29 7\n"
simple_expect "=1132"
send "1119 29 8\n"
simple_expect "=1119"
send "1133 29 8\n"
simple_expect "=1133"
send "1120 29 9\n"
simple_expect "=1120"
send "1134 29 9\n"
simple_expect "=1134"
talk_to client 1
simple_expect ":18 14 6 $any_time 5 0 8 0 2 { 0 1 6 5 } 0 \\*"
......@@ -476,41 +529,273 @@ simple_expect ":18 14 9 $any_time 5 0 8 0 2 { 0 1 6 8 } 0 \\*"
# lno: 1 2 . . . . . . 9
# tno: 1 3 . . . . . . 10
send "1121 103 1 1 2\n"
simple_expect "=1121 1 1 1 2 { 1 3 }"
send "1135 103 1 1 2\n"
simple_expect "=1135 1 1 1 2 { 1 3 }"
send "1136 103 1 2 2\n"
simple_expect "=1136 0 0 2 { 2 3 9 10 }"
send "1137 103 1 2 3\n"
simple_expect "=1137 0 0 2 { 2 3 9 10 }"
send "1138 103 1 1 3\n"
simple_expect "=1138 0 0 3 { 1 1 2 3 9 10 }"
send "1139 103 1 1 4\n"
simple_expect "=1139 0 0 3 { 1 1 2 3 9 10 }"
send "1140 103 1 1 50\n"
simple_expect "=1140 0 0 3 { 1 1 2 3 9 10 }"
send "1141 103 1 6 50\n"
simple_expect "=1141 0 1 9 1 { 10 }"
send "1142 34 1 6 50\n"
simple_expect "=1142 6 4 { 0 0 0 10 }"
send "1143 34 1 1 50\n"
simple_expect "=1143 1 9 { 1 3 0 0 0 0 0 0 10 }"
# Test the limit on no_of_texts
send "1144 103 1 3 256\n"
simple_expect "%1144 46 255"
send "1145 103 1 3 255\n"
simple_expect "=1145 0 1 9 1 { 10 }"
# Test to get the map from a conference we are not a member of
send "1146 34 3 1 10\n"
simple_expect "=1146 1 1 { 3 }"
send "1147 103 3 1 10\n"
simple_expect "=1147 0 1 1 1 { 3 }"
# Texts written by person 5:
# ano: 1 2 3 . . . . 8
# tno: 1 2 3 . . . . 10
# Texts written by person 6:
# ano: . .
# tno: . .
# FIXME: test 104 here for sparse maps in person 5.
send "1148 47 5 1 3\n"
simple_expect "=1148 1 3 { 1 2 3 }"
send "1149 47 5 1 4\n"
simple_expect "=1149 1 4 { 1 2 3 0 }"
send "1150 47 5 1 5\n"
simple_expect "=1150 1 5 { 1 2 3 0 0 }"
send "1151 47 5 1 6\n"
simple_expect "=1151 1 6 { 1 2 3 0 0 0 }"
send "1152 47 5 1 7\n"
simple_expect "=1152 1 7 { 1 2 3 0 0 0 0 }"
send "1153 47 5 1 8\n"
simple_expect "=1153 1 8 { 1 2 3 0 0 0 0 10 }"
send "1154 47 5 1 9\n"
simple_expect "=1154 1 8 { 1 2 3 0 0 0 0 10 }"
send "1155 47 5 2 6\n"
simple_expect "=1155 2 6 { 2 3 0 0 0 0 }"
send "1156 47 5 2 7\n"
simple_expect "=1156 2 7 { 2 3 0 0 0 0 10 }"
send "1157 47 5 3 7\n"
simple_expect "=1157 3 6 { 3 0 0 0 0 10 }"
send "1158 47 5 4 7\n"
simple_expect "=1158 4 5 { 0 0 0 0 10 }"
send "1159 47 5 5 4\n"
simple_expect "=1159 5 4 { 0 0 0 10 }"
send "1160 47 5 7 4\n"
simple_expect "=1160 7 2 { 0 10 }"
send "1161 47 5 8 4\n"
simple_expect "=1161 8 1 { 10 }"
# Test what happens when the oldest texts are removed and there exists
# a few more texts.
talk_to client 0
send "1162 29 1\n"
simple_expect "=1162"
send "1163 29 3\n"
simple_expect "=1163"
talk_to client 1
simple_expect ":18 14 1 $any_time 5 0 8 0 2 { 0 1 6 1 } 0 \\*"
simple_expect ":18 14 3 $any_time 5 0 8 0 4 { 0 1 6 2 1 3 6 1 } 0 \\*"
send "1164 86 [holl "text0011"] 1 { 0 1 } 0 { }\n"
simple_expect ":18 15 11 $any_time 6 0 8 0 2 { 0 1 6 10 } 0 \\*" "async to c1"
simple_expect "=1164 11" "Eskil created text 11"
send "1165 86 [holl "text0012"] 1 { 0 1 } 0 { }\n"
simple_expect ":18 15 12 $any_time 6 0 8 0 2 { 0 1 6 11 } 0 \\*" "async to c1"
simple_expect "=1165 12" "Eskil created text 12"
send "1166 86 [holl "text0013"] 1 { 0 1 } 0 { }\n"
simple_expect ":18 15 13 $any_time 6 0 8 0 2 { 0 1 6 12 } 0 \\*" "async to c1"
simple_expect "=1166 13" "Eskil created text 13"
talk_to client 0
simple_expect ":16 0 11 $any_time 6 0 8 0 2 { 0 1 6 10 }" "async to c0"
simple_expect ":16 0 12 $any_time 6 0 8 0 2 { 0 1 6 11 }" "async to c0"
simple_expect ":16 0 13 $any_time 6 0 8 0 2 { 0 1 6 12 }" "async to c0"
talk_to client 1
send "1167 29 11\n"
simple_expect ":18 14 11 $any_time 6 0 8 0 2 { 0 1 6 10 } 0 \\*"
simple_expect "=1167"
# Now, these local text numbers exist:
# lno: 9 . 11 12
# tno: 10 . 12 13
send "1168 34 1 0 1\n"
simple_expect "=1168 9 0 \\*"
send "1169 34 1 1 1\n"
simple_expect "=1169 9 0 \\*"
send "1170 34 1 1 8\n"
simple_expect "=1170 9 0 \\*"
send "1171 34 1 1 9\n"
simple_expect "=1171 9 1 { 10 }"
send "1172 34 1 1 10\n"
simple_expect "=1172 9 2 { 10 0 }"
send "1173 34 1 1 11\n"
simple_expect "=1173 9 3 { 10 0 12 }"
send "1174 34 1 1 12\n"
simple_expect "=1174 9 4 { 10 0 12 13 }"
send "1175 34 1 1 13\n"
simple_expect "=1175 9 4 { 10 0 12 13 }"
send "1176 34 1 9 13\n"
simple_expect "=1176 9 4 { 10 0 12 13 }"
# Test to get the map from a completely empty conference
send "1177 34 3 1 10\n"
simple_expect "=1177 2 0 \\*"
send "1178 103 3 1 10\n"
simple_expect "=1178 0 0 0 \\*"
# Texts written by person 5:
# ano: . 2 . . . . . 8
# tno: . 2 . . . . . 10
# Texts written by person 6:
# ano: . 2 . 4 5
# tno: . 5 . 12 13
send "1179 47 5 0 7\n"
simple_expect "=1179 2 7 { 2 0 0 0 0 0 10 }"
send "1180 47 5 1 7\n"
simple_expect "=1180 2 7 { 2 0 0 0 0 0 10 }"
send "1181 47 5 2 7\n"
simple_expect "=1181 2 7 { 2 0 0 0 0 0 10 }"
send "1182 47 5 3 7\n"
simple_expect "=1182 3 6 { 0 0 0 0 0 10 }"
send "1183 47 5 1 6\n"
simple_expect "=1183 2 6 { 2 0 0 0 0 0 }"
send "1184 47 5 2 8\n"
simple_expect "=1184 2 7 { 2 0 0 0 0 0 10 }"
send "1185 47 5 3 8\n"
simple_expect "=1185 3 6 { 0 0 0 0 0 10 }"
send "1186 47 5 2 50\n"
simple_expect "=1186 2 7 { 2 0 0 0 0 0 10 }"
send "1187 47 5 3 50\n"
simple_expect "=1187 3 6 { 0 0 0 0 0 10 }"
send "1188 47 6 1 2\n"
simple_expect "=1188 2 2 { 5 0 }"
send "1189 47 6 1 1\n"
simple_expect "=1189 2 1 { 5 }"
send "1190 47 6 3 4\n"
simple_expect "=1190 3 3 { 0 12 13 }"
send "1191 47 6 3 2\n"
simple_expect "=1191 3 2 { 0 12 }"
send "1192 47 6 3 1\n"
simple_expect "=1192 3 1 { 0 }"
send "1193 47 6 4 1\n"
simple_expect "=1193 4 1 { 12 }"
send "1194 47 6 4 4\n"
simple_expect "=1194 4 2 { 12 13 }"
send "1195 47 6 4 2\n"
simple_expect "=1195 4 2 { 12 13 }"
send "1196 47 6 4 1\n"
simple_expect "=1196 4 1 { 12 }"
send "1197 47 6 5 1\n"
simple_expect "=1197 5 1 { 13 }"
send "1122 103 1 2 2\n"
simple_expect "=1122 0 0 2 { 2 3 9 10 }"
send "1198 47 6 5 50\n"
simple_expect "=1198 5 1 { 13 }"
send "1123 103 1 2 3\n"
simple_expect "=1123 0 0 2 { 2 3 9 10 }"
send "1199 47 6 6 1\n"
simple_expect "%1199 16 6"
send "1124 103 1 1 3\n"
simple_expect "=1124 0 0 3 { 1 1 2 3 9 10 }"
# Delete text 5
send "1200 29 5\n"
# No async message, since there are no members of the text.
# simple_expect ":18 14 5 $any_time 6 0 8 0 0 \\* 1 { 1 1 6 $any_time 00000000 1 [holl "text/plain"] }"
simple_expect "=1200"
send "1125 103 1 1 4\n"
simple_expect "=1125 0 0 3 { 1 1 2 3 9 10 }"
# Texts written by person 5:
# ano: . 2 . . . . . 8
# tno: . 2 . . . . . 10
send "1126 103 1 1 50\n"
simple_expect "=1126 0 0 3 { 1 1 2 3 9 10 }"
# Texts written by person 6:
# ano: . . . 4 5
# tno: . . . 12 13
send "1127 103 1 6 50\n"
simple_expect "=1127 0 1 9 1 { 10 }"
send "1128 34 1 6 50\n"
simple_expect "=1128 6 4 { 0 0 0 10 }"
send "1201 47 6 1 2\n"
simple_expect "=1201 4 2 { 12 13 }"
send "1129 34 1 1 50\n"
simple_expect "=1129 1 9 { 1 3 0 0 0 0 0 0 10 }"
send "1202 47 6 1 1\n"
simple_expect "=1202 4 1 { 12 }"
# Shut down the server.
talk_to client 0
send "1130 42 255\n"
simple_expect "=1130" "42=enable succeeded"
send "1131 44 0\n"
simple_expect "=1131" "44=shutdown-kom succeeded"
send "1203 42 255\n"
simple_expect "=1203" "42=enable succeeded"
send "1204 44 0\n"
simple_expect "=1204" "44=shutdown-kom succeeded"
simple_expect ":2 13 6 2" "c0 sees auto-logout of c1 after 44=shutdown-kom"
simple_expect ":2 13 5 1" "c0 sees auto-logout of c0 after 44=shutdown-kom"
client_death 0
......
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