Commit 858e0b4c authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Added test cases for map_created_texts.

parent a853e7a3
# Test get_map and local_to_global.
# Test get_created_texts.
# Test get_created_texts and map_created_texts.
# As a side effect a lot of other things are also tested.
# The following texts are created by this test case:
......@@ -504,20 +504,56 @@ simple_expect "%1129 16 10"
send "1130 47 6 1 10\n"
simple_expect "=1130 2 1 { 5 }"
send "1131 104 5 1 50\n"
simple_expect "=1131 0 1 1 8 { 1 2 3 6 7 8 9 10 }"
send "1132 104 5 1 9\n"
simple_expect "=1132 0 1 1 8 { 1 2 3 6 7 8 9 10 }"
send "1133 104 5 1 8\n"
simple_expect "=1133 0 1 1 8 { 1 2 3 6 7 8 9 10 }"
send "1134 104 5 1 7\n"
simple_expect "=1134 1 1 1 7 { 1 2 3 6 7 8 9 }"
send "1135 104 5 1 6\n"
simple_expect "=1135 1 1 1 6 { 1 2 3 6 7 8 }"
send "1136 104 5 1 2\n"
simple_expect "=1136 1 1 1 2 { 1 2 }"
send "1137 104 5 1 1\n"
simple_expect "=1137 1 1 1 1 { 1 }"
send "1138 104 5 1 0\n"
simple_expect "=1138 1 0 0 \\*"
send "1139 104 5 0 0\n"
simple_expect "%1139 17 0"
send "1140 104 5 0 1\n"
simple_expect "%1140 17 0"
send "1141 104 5 0 50\n"
simple_expect "%1141 17 0"
send "1142 104 6 1 10\n"
simple_expect "=1142 0 1 2 1 { 5 }"
# Remove some more
talk_to client 0
send "1131 29 6\n"
simple_expect "=1131"
send "1143 29 6\n"
simple_expect "=1143"
send "1132 29 7\n"
simple_expect "=1132"
send "1144 29 7\n"
simple_expect "=1144"
send "1133 29 8\n"
simple_expect "=1133"
send "1145 29 8\n"
simple_expect "=1145"
send "1134 29 9\n"
simple_expect "=1134"
send "1146 29 9\n"
simple_expect "=1146"
talk_to client 1
simple_expect ":18 14 6 $any_time 5 0 8 0 2 { 0 1 6 5 } 0 \\*"
......@@ -529,123 +565,152 @@ 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 "1135 103 1 1 2\n"
simple_expect "=1135 1 1 1 2 { 1 3 }"
send "1147 103 1 1 2\n"
simple_expect "=1147 1 1 1 2 { 1 3 }"
send "1136 103 1 2 2\n"
simple_expect "=1136 0 0 2 { 2 3 9 10 }"
send "1148 103 1 2 2\n"
simple_expect "=1148 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 "1149 103 1 2 3\n"
simple_expect "=1149 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 "1150 103 1 1 3\n"
simple_expect "=1150 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 "1151 103 1 1 4\n"
simple_expect "=1151 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 "1152 103 1 1 50\n"
simple_expect "=1152 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 "1153 103 1 6 50\n"
simple_expect "=1153 0 1 9 1 { 10 }"
send "1142 34 1 6 50\n"
simple_expect "=1142 6 4 { 0 0 0 10 }"
send "1154 34 1 6 50\n"
simple_expect "=1154 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 }"
send "1155 34 1 1 50\n"
simple_expect "=1155 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 "1156 103 1 3 256\n"
simple_expect "%1156 46 255"
send "1145 103 1 3 255\n"
simple_expect "=1145 0 1 9 1 { 10 }"
send "1157 103 1 3 255\n"
simple_expect "=1157 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 "1158 34 3 1 10\n"
simple_expect "=1158 1 1 { 3 }"
send "1147 103 3 1 10\n"
simple_expect "=1147 0 1 1 1 { 3 }"
send "1159 103 3 1 10\n"
simple_expect "=1159 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: . .
# ano: . 2
# tno: . 5
send "1160 104 5 1 3\n"
simple_expect "=1160 1 1 1 3 { 1 2 3 }"
send "1161 104 5 2 2\n"
simple_expect "=1161 1 1 2 2 { 2 3 }"
send "1162 104 5 1 4\n"
simple_expect "=1162 0 0 4 { 1 1 2 2 3 3 8 10 }"
send "1163 104 5 4 50\n"
simple_expect "=1163 0 1 8 1 { 10 }"
send "1164 104 5 1 50\n"
simple_expect "=1164 0 0 4 { 1 1 2 2 3 3 8 10 }"
# 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 "1165 104 5 3 50\n"
simple_expect "=1165 0 0 2 { 3 3 8 10 }"
send "1149 47 5 1 4\n"
simple_expect "=1149 1 4 { 1 2 3 0 }"
send "1166 104 5 3 2\n"
simple_expect "=1166 0 0 2 { 3 3 8 10 }"
send "1150 47 5 1 5\n"
simple_expect "=1150 1 5 { 1 2 3 0 0 }"
send "1167 104 5 3 1\n"
simple_expect "=1167 1 1 3 1 { 3 }"
send "1151 47 5 1 6\n"
simple_expect "=1151 1 6 { 1 2 3 0 0 0 }"
send "1168 47 5 1 3\n"
simple_expect "=1168 1 3 { 1 2 3 }"
send "1152 47 5 1 7\n"
simple_expect "=1152 1 7 { 1 2 3 0 0 0 0 }"
send "1169 47 5 1 4\n"
simple_expect "=1169 1 4 { 1 2 3 0 }"
send "1153 47 5 1 8\n"
simple_expect "=1153 1 8 { 1 2 3 0 0 0 0 10 }"
send "1170 47 5 1 5\n"
simple_expect "=1170 1 5 { 1 2 3 0 0 }"
send "1154 47 5 1 9\n"
simple_expect "=1154 1 8 { 1 2 3 0 0 0 0 10 }"
send "1171 47 5 1 6\n"
simple_expect "=1171 1 6 { 1 2 3 0 0 0 }"
send "1155 47 5 2 6\n"
simple_expect "=1155 2 6 { 2 3 0 0 0 0 }"
send "1172 47 5 1 7\n"
simple_expect "=1172 1 7 { 1 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 "1173 47 5 1 8\n"
simple_expect "=1173 1 8 { 1 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 "1174 47 5 1 9\n"
simple_expect "=1174 1 8 { 1 2 3 0 0 0 0 10 }"
send "1158 47 5 4 7\n"
simple_expect "=1158 4 5 { 0 0 0 0 10 }"
send "1175 47 5 2 6\n"
simple_expect "=1175 2 6 { 2 3 0 0 0 0 }"
send "1159 47 5 5 4\n"
simple_expect "=1159 5 4 { 0 0 0 10 }"
send "1176 47 5 2 7\n"
simple_expect "=1176 2 7 { 2 3 0 0 0 0 10 }"
send "1160 47 5 7 4\n"
simple_expect "=1160 7 2 { 0 10 }"
send "1177 47 5 3 7\n"
simple_expect "=1177 3 6 { 3 0 0 0 0 10 }"
send "1161 47 5 8 4\n"
simple_expect "=1161 8 1 { 10 }"
send "1178 47 5 4 7\n"
simple_expect "=1178 4 5 { 0 0 0 0 10 }"
send "1179 47 5 5 4\n"
simple_expect "=1179 5 4 { 0 0 0 10 }"
send "1180 47 5 7 4\n"
simple_expect "=1180 7 2 { 0 10 }"
send "1181 47 5 8 4\n"
simple_expect "=1181 8 1 { 10 }"
send "1182 104 6 1 50\n"
simple_expect "=1182 0 1 2 1 { 5 }"
send "1183 47 6 1 50\n"
simple_expect "=1183 2 1 { 5 }"
# 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 "1184 29 1\n"
simple_expect "=1184"
send "1163 29 3\n"
simple_expect "=1163"
send "1185 29 3\n"
simple_expect "=1185"
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"
send "1186 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"
simple_expect "=1186 11" "Eskil created text 11"
send "1165 86 [holl "text0012"] 1 { 0 1 } 0 { }\n"
send "1187 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"
simple_expect "=1187 12" "Eskil created text 12"
send "1166 86 [holl "text0013"] 1 { 0 1 } 0 { }\n"
send "1188 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"
simple_expect "=1188 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"
......@@ -654,47 +719,47 @@ 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"
send "1189 29 11\n"
simple_expect ":18 14 11 $any_time 6 0 8 0 2 { 0 1 6 10 } 0 \\*"
simple_expect "=1167"
simple_expect "=1189"
# 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 "1190 34 1 0 1\n"
simple_expect "=1190 9 0 \\*"
send "1169 34 1 1 1\n"
simple_expect "=1169 9 0 \\*"
send "1191 34 1 1 1\n"
simple_expect "=1191 9 0 \\*"
send "1170 34 1 1 8\n"
simple_expect "=1170 9 0 \\*"
send "1192 34 1 1 8\n"
simple_expect "=1192 9 0 \\*"
send "1171 34 1 1 9\n"
simple_expect "=1171 9 1 { 10 }"
send "1193 34 1 1 9\n"
simple_expect "=1193 9 1 { 10 }"
send "1172 34 1 1 10\n"
simple_expect "=1172 9 2 { 10 0 }"
send "1194 34 1 1 10\n"
simple_expect "=1194 9 2 { 10 0 }"
send "1173 34 1 1 11\n"
simple_expect "=1173 9 3 { 10 0 12 }"
send "1195 34 1 1 11\n"
simple_expect "=1195 9 3 { 10 0 12 }"
send "1174 34 1 1 12\n"
simple_expect "=1174 9 4 { 10 0 12 13 }"
send "1196 34 1 1 12\n"
simple_expect "=1196 9 4 { 10 0 12 13 }"
send "1175 34 1 1 13\n"
simple_expect "=1175 9 4 { 10 0 12 13 }"
send "1197 34 1 1 13\n"
simple_expect "=1197 9 4 { 10 0 12 13 }"
send "1176 34 1 9 13\n"
simple_expect "=1176 9 4 { 10 0 12 13 }"
send "1198 34 1 9 13\n"
simple_expect "=1198 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 "1199 34 3 1 10\n"
simple_expect "=1199 2 0 \\*"
send "1178 103 3 1 10\n"
simple_expect "=1178 0 0 0 \\*"
send "1200 103 3 1 10\n"
simple_expect "=1200 0 0 0 \\*"
# Texts written by person 5:
# ano: . 2 . . . . . 8
......@@ -704,74 +769,125 @@ simple_expect "=1178 0 0 0 \\*"
# 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 "1201 104 5 1 50\n"
simple_expect "=1201 0 0 2 { 2 2 8 10 }"
send "1202 104 5 1 2\n"
simple_expect "=1202 0 0 2 { 2 2 8 10 }"
send "1180 47 5 1 7\n"
simple_expect "=1180 2 7 { 2 0 0 0 0 0 10 }"
send "1203 104 5 8 50\n"
simple_expect "=1203 0 1 8 1 { 10 }"
send "1181 47 5 2 7\n"
simple_expect "=1181 2 7 { 2 0 0 0 0 0 10 }"
send "1204 104 5 9 50\n"
simple_expect "%1204 16 9"
send "1182 47 5 3 7\n"
simple_expect "=1182 3 6 { 0 0 0 0 0 10 }"
send "1205 104 5 1 1\n"
simple_expect "=1205 1 1 2 1 { 2 }"
send "1183 47 5 1 6\n"
simple_expect "=1183 2 6 { 2 0 0 0 0 0 }"
send "1206 104 6 1 1\n"
simple_expect "=1206 1 1 2 1 { 5 }"
send "1184 47 5 2 8\n"
simple_expect "=1184 2 7 { 2 0 0 0 0 0 10 }"
send "1207 104 6 1 2\n"
simple_expect "=1207 1 1 2 3 { 5 0 12 }"
send "1185 47 5 3 8\n"
simple_expect "=1185 3 6 { 0 0 0 0 0 10 }"
send "1208 104 6 1 3\n"
simple_expect "=1208 0 1 2 4 { 5 0 12 13 }"
send "1186 47 5 2 50\n"
simple_expect "=1186 2 7 { 2 0 0 0 0 0 10 }"
send "1209 104 6 2 1\n"
simple_expect "=1209 1 1 2 1 { 5 }"
send "1187 47 5 3 50\n"
simple_expect "=1187 3 6 { 0 0 0 0 0 10 }"
send "1210 104 6 2 2\n"
simple_expect "=1210 1 1 2 3 { 5 0 12 }"
send "1188 47 6 1 2\n"
simple_expect "=1188 2 2 { 5 0 }"
send "1211 104 6 2 3\n"
simple_expect "=1211 0 1 2 4 { 5 0 12 13 }"
send "1189 47 6 1 1\n"
simple_expect "=1189 2 1 { 5 }"
send "1212 104 6 3 1\n"
simple_expect "=1212 1 1 4 1 { 12 }"
send "1190 47 6 3 4\n"
simple_expect "=1190 3 3 { 0 12 13 }"
send "1213 104 6 3 2\n"
simple_expect "=1213 0 1 4 2 { 12 13 }"
send "1191 47 6 3 2\n"
simple_expect "=1191 3 2 { 0 12 }"
send "1214 104 6 3 3\n"
simple_expect "=1214 0 1 4 2 { 12 13 }"
send "1192 47 6 3 1\n"
simple_expect "=1192 3 1 { 0 }"
send "1215 104 6 4 1\n"
simple_expect "=1215 1 1 4 1 { 12 }"
send "1193 47 6 4 1\n"
simple_expect "=1193 4 1 { 12 }"
send "1216 104 6 4 2\n"
simple_expect "=1216 0 1 4 2 { 12 13 }"
send "1194 47 6 4 4\n"
simple_expect "=1194 4 2 { 12 13 }"
send "1217 104 6 4 3\n"
simple_expect "=1217 0 1 4 2 { 12 13 }"
send "1195 47 6 4 2\n"
simple_expect "=1195 4 2 { 12 13 }"
send "1218 47 5 0 7\n"
simple_expect "=1218 2 7 { 2 0 0 0 0 0 10 }"
send "1196 47 6 4 1\n"
simple_expect "=1196 4 1 { 12 }"
send "1219 47 5 1 7\n"
simple_expect "=1219 2 7 { 2 0 0 0 0 0 10 }"
send "1197 47 6 5 1\n"
simple_expect "=1197 5 1 { 13 }"
send "1220 47 5 2 7\n"
simple_expect "=1220 2 7 { 2 0 0 0 0 0 10 }"
send "1198 47 6 5 50\n"
simple_expect "=1198 5 1 { 13 }"
send "1221 47 5 3 7\n"
simple_expect "=1221 3 6 { 0 0 0 0 0 10 }"
send "1199 47 6 6 1\n"
simple_expect "%1199 16 6"
send "1222 47 5 1 6\n"
simple_expect "=1222 2 6 { 2 0 0 0 0 0 }"
send "1223 47 5 2 8\n"
simple_expect "=1223 2 7 { 2 0 0 0 0 0 10 }"
send "1224 47 5 3 8\n"
simple_expect "=1224 3 6 { 0 0 0 0 0 10 }"
send "1225 47 5 2 50\n"
simple_expect "=1225 2 7 { 2 0 0 0 0 0 10 }"
send "1226 47 5 3 50\n"
simple_expect "=1226 3 6 { 0 0 0 0 0 10 }"
send "1227 47 6 1 2\n"
simple_expect "=1227 2 2 { 5 0 }"
send "1228 47 6 1 1\n"
simple_expect "=1228 2 1 { 5 }"
send "1229 47 6 3 4\n"
simple_expect "=1229 3 3 { 0 12 13 }"
send "1230 47 6 3 2\n"
simple_expect "=1230 3 2 { 0 12 }"
send "1231 47 6 3 1\n"
simple_expect "=1231 3 1 { 0 }"
send "1232 47 6 4 1\n"
simple_expect "=1232 4 1 { 12 }"
send "1233 47 6 4 4\n"
simple_expect "=1233 4 2 { 12 13 }"
send "1234 47 6 4 2\n"
simple_expect "=1234 4 2 { 12 13 }"
send "1235 47 6 4 1\n"
simple_expect "=1235 4 1 { 12 }"
send "1236 47 6 5 1\n"
simple_expect "=1236 5 1 { 13 }"
send "1237 47 6 5 50\n"
simple_expect "=1237 5 1 { 13 }"
send "1238 47 6 6 1\n"
simple_expect "%1238 16 6"
# Delete text 5
send "1200 29 5\n"
send "1239 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"
simple_expect "=1239"
# Texts written by person 5:
# ano: . 2 . . . . . 8
......@@ -781,21 +897,26 @@ simple_expect "=1200"
# ano: . . . 4 5
# tno: . . . 12 13
send "1240 104 6 1 2\n"
simple_expect "=1240 0 1 4 2 { 12 13 }"
send "1241 104 6 1 1\n"
simple_expect "=1241 1 1 4 1 { 12 }"
send "1201 47 6 1 2\n"
simple_expect "=1201 4 2 { 12 13 }"
send "1242 47 6 1 2\n"
simple_expect "=1242 4 2 { 12 13 }"
send "1202 47 6 1 1\n"
simple_expect "=1202 4 1 { 12 }"
send "1243 47 6 1 1\n"
simple_expect "=1243 4 1 { 12 }"
# Delete all remaining texts that person 5 have created.
talk_to client 0
send "1203 29 2\n"
simple_expect "=1203"
send "1244 29 2\n"
simple_expect "=1244"
send "1204 29 10\n"
simple_expect "=1204"
send "1245 29 10\n"
simple_expect "=1245"
talk_to client 1
# Text 2 is sent to conference 2, so we get no async message about it.
......@@ -809,35 +930,56 @@ simple_expect ":18 14 10 $any_time 5 0 8 0 2 { 0 1 6 9 } 0 \\*"
# ano: . . . 4 5
# tno: . . . 12 13
send "1205 47 5 1 2\n"
simple_expect "=1205 9 0 \\*"
send "1246 104 5 1 2\n"
simple_expect "=1246 0 0 0 \\*"
send "1247 104 5 1 1\n"
simple_expect "=1247 0 0 0 \\*"
send "1248 104 5 1 50\n"
simple_expect "=1248 0 0 0 \\*"
send "1249 104 5 7 1\n"
simple_expect "=1249 0 0 0 \\*"
send "1250 104 5 8 1\n"
simple_expect "=1250 0 0 0 \\*"
send "1251 104 5 8 2\n"
simple_expect "=1251 0 0 0 \\*"
send "1252 104 5 9 1\n"
simple_expect "%1252 16 9"
send "1253 47 5 1 2\n"
simple_expect "=1253 9 0 \\*"
send "1206 47 5 7 2\n"
simple_expect "=1206 9 0 \\*"
send "1254 47 5 7 2\n"
simple_expect "=1254 9 0 \\*"
send "1207 47 5 7 1\n"
simple_expect "=1207 9 0 \\*"
send "1255 47 5 7 1\n"
simple_expect "=1255 9 0 \\*"
send "1208 47 5 8 1\n"
simple_expect "=1208 9 0 \\*"
send "1256 47 5 8 1\n"
simple_expect "=1256 9 0 \\*"
send "1209 47 5 0 50\n"
simple_expect "=1209 9 0 \\*"
send "1257 47 5 0 50\n"
simple_expect "=1257 9 0 \\*"
send "1210 47 5 1 50\n"
simple_expect "=1210 9 0 \\*"
send "1258 47 5 1 50\n"
simple_expect "=1258 9 0 \\*"
send "1211 47 5 9 50\n"
simple_expect "%1211 16 9*"
send "1259 47 5 9 50\n"
simple_expect "%1259 16 9*"
# Shut down the server.
talk_to client 0
send "1212 42 255\n"
simple_expect "=1212" "42=enable succeeded"
send "1213 44 0\n"
simple_expect "=1213" "44=shutdown-kom succeeded"
send "1260 42 255\n"
simple_expect "=1260" "42=enable succeeded"
send "1261 44 0\n"
simple_expect "=1261" "44=shutdown-kom succeeded"
simple_expect ":2 13 6 2" "c0 sees auto-logout of c1 af