dom/system/gonk/tests/test_ril_worker_cellbroadcast.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 3
michael@0 4 subscriptLoader.loadSubScript("resource://gre/modules/ril_consts.js", this);
michael@0 5
michael@0 6 function run_test() {
michael@0 7 run_next_test();
michael@0 8 }
michael@0 9
michael@0 10 add_test(function test_ril_consts_cellbroadcast_misc() {
michael@0 11 // Must be 16 for indexing.
michael@0 12 do_check_eq(CB_DCS_LANG_GROUP_1.length, 16);
michael@0 13 do_check_eq(CB_DCS_LANG_GROUP_2.length, 16);
michael@0 14
michael@0 15 // Array length must be even.
michael@0 16 do_check_eq(CB_NON_MMI_SETTABLE_RANGES.length & 0x01, 0);
michael@0 17 for (let i = 0; i < CB_NON_MMI_SETTABLE_RANGES.length;) {
michael@0 18 let from = CB_NON_MMI_SETTABLE_RANGES[i++];
michael@0 19 let to = CB_NON_MMI_SETTABLE_RANGES[i++];
michael@0 20 do_check_eq(from < to, true);
michael@0 21 }
michael@0 22
michael@0 23 run_next_test();
michael@0 24 });
michael@0 25
michael@0 26 add_test(function test_ril_worker_GsmPDUHelper_readCbDataCodingScheme() {
michael@0 27 let worker = newWorker({
michael@0 28 postRILMessage: function(data) {
michael@0 29 // Do nothing
michael@0 30 },
michael@0 31 postMessage: function(message) {
michael@0 32 // Do nothing
michael@0 33 }
michael@0 34 });
michael@0 35
michael@0 36 let context = worker.ContextPool._contexts[0];
michael@0 37 function test_dcs(dcs, encoding, language, hasLanguageIndicator, messageClass) {
michael@0 38 context.Buf.readUint8 = function() {
michael@0 39 return dcs;
michael@0 40 };
michael@0 41
michael@0 42 let msg = {};
michael@0 43 context.GsmPDUHelper.readCbDataCodingScheme(msg);
michael@0 44
michael@0 45 do_check_eq(msg.dcs, dcs);
michael@0 46 do_check_eq(msg.encoding, encoding);
michael@0 47 do_check_eq(msg.language, language);
michael@0 48 do_check_eq(msg.hasLanguageIndicator, hasLanguageIndicator);
michael@0 49 do_check_eq(msg.messageClass, messageClass);
michael@0 50 }
michael@0 51
michael@0 52 function test_dcs_throws(dcs) {
michael@0 53 context.Buf.readUint8 = function() {
michael@0 54 return dcs;
michael@0 55 };
michael@0 56
michael@0 57 do_check_throws(function() {
michael@0 58 context.GsmPDUHelper.readCbDataCodingScheme({});
michael@0 59 }, "Unsupported CBS data coding scheme: " + dcs);
michael@0 60 }
michael@0 61
michael@0 62 // Group 0000
michael@0 63 for (let i = 0; i < 16; i++) {
michael@0 64 test_dcs(i, PDU_DCS_MSG_CODING_7BITS_ALPHABET, CB_DCS_LANG_GROUP_1[i],
michael@0 65 false, GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
michael@0 66 }
michael@0 67
michael@0 68 // Group 0001
michael@0 69 // 0000 GSM 7 bit default alphabet; message preceded by language indication.
michael@0 70 test_dcs(0x10, PDU_DCS_MSG_CODING_7BITS_ALPHABET, null, true,
michael@0 71 GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
michael@0 72 // 0001 UCS2; message preceded by language indication.
michael@0 73 test_dcs(0x11, PDU_DCS_MSG_CODING_16BITS_ALPHABET, null, true,
michael@0 74 GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
michael@0 75
michael@0 76 // Group 0010
michael@0 77 // 0000..0100
michael@0 78 for (let i = 0; i < 5; i++) {
michael@0 79 test_dcs(0x20 + i, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
michael@0 80 CB_DCS_LANG_GROUP_2[i], false,
michael@0 81 GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
michael@0 82 }
michael@0 83 // 0101..1111 Reserved
michael@0 84 for (let i = 5; i < 16; i++) {
michael@0 85 test_dcs(0x20 + i, PDU_DCS_MSG_CODING_7BITS_ALPHABET, null, false,
michael@0 86 GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
michael@0 87 }
michael@0 88
michael@0 89 // Group 0100, 0101, 1001
michael@0 90 for (let group of [0x40, 0x50, 0x90]) {
michael@0 91 for (let i = 0; i < 16; i++) {
michael@0 92 let encoding = i & 0x0C;
michael@0 93 if (encoding == 0x0C) {
michael@0 94 encoding = PDU_DCS_MSG_CODING_7BITS_ALPHABET;
michael@0 95 }
michael@0 96 let messageClass = GECKO_SMS_MESSAGE_CLASSES[i & PDU_DCS_MSG_CLASS_BITS];
michael@0 97 test_dcs(group + i, encoding, null, false, messageClass);
michael@0 98 }
michael@0 99 }
michael@0 100
michael@0 101 // Group 1111
michael@0 102 for (let i = 0; i < 16; i ++) {
michael@0 103 let encoding = i & 0x04 ? PDU_DCS_MSG_CODING_8BITS_ALPHABET
michael@0 104 : PDU_DCS_MSG_CODING_7BITS_ALPHABET;
michael@0 105 let messageClass;
michael@0 106 switch(i & PDU_DCS_MSG_CLASS_BITS) {
michael@0 107 case 0x01: messageClass = PDU_DCS_MSG_CLASS_USER_1; break;
michael@0 108 case 0x02: messageClass = PDU_DCS_MSG_CLASS_USER_2; break;
michael@0 109 case 0x03: messageClass = PDU_DCS_MSG_CLASS_3; break;
michael@0 110 default: messageClass = PDU_DCS_MSG_CLASS_NORMAL; break;
michael@0 111 }
michael@0 112 test_dcs(0xF0 + i, encoding, null, false,
michael@0 113 GECKO_SMS_MESSAGE_CLASSES[messageClass]);
michael@0 114 }
michael@0 115
michael@0 116 // Group 0011, 1000, 1010, 1011, 1100
michael@0 117 // 0000..1111 Reserved
michael@0 118 for (let group of [0x30, 0x80, 0xA0, 0xB0, 0xC0]) {
michael@0 119 for (let i = 0; i < 16; i++) {
michael@0 120 test_dcs(group + i, PDU_DCS_MSG_CODING_7BITS_ALPHABET, null, false,
michael@0 121 GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
michael@0 122 }
michael@0 123 }
michael@0 124
michael@0 125 // Group 0110, 0111, 1101, 1110
michael@0 126 // TODO: unsupported
michael@0 127 for (let group of [0x60, 0x70, 0xD0, 0xE0]) {
michael@0 128 for (let i = 0; i < 16; i++) {
michael@0 129 test_dcs_throws(group + i);
michael@0 130 }
michael@0 131 }
michael@0 132
michael@0 133 run_next_test();
michael@0 134 });
michael@0 135
michael@0 136 add_test(function test_ril_worker_GsmPDUHelper_readGsmCbData() {
michael@0 137 let worker = newWorker({
michael@0 138 postRILMessage: function(data) {
michael@0 139 // Do nothing
michael@0 140 },
michael@0 141 postMessage: function(message) {
michael@0 142 // Do nothing
michael@0 143 }
michael@0 144 });
michael@0 145
michael@0 146 let context = worker.ContextPool._contexts[0];
michael@0 147 function test_data(options, expected) {
michael@0 148 let readIndex = 0;
michael@0 149 context.Buf.readUint8 = function() {
michael@0 150 return options[3][readIndex++];
michael@0 151 };
michael@0 152 context.Buf.readUint8Array = function(length) {
michael@0 153 let array = new Uint8Array(length);
michael@0 154 for (let i = 0; i < length; i++) {
michael@0 155 array[i] = this.readUint8();
michael@0 156 }
michael@0 157 return array;
michael@0 158 };
michael@0 159
michael@0 160 let msg = {
michael@0 161 encoding: options[0],
michael@0 162 language: options[1],
michael@0 163 hasLanguageIndicator: options[2]
michael@0 164 };
michael@0 165 context.GsmPDUHelper.readGsmCbData(msg, options[3].length);
michael@0 166
michael@0 167 do_check_eq(msg.body, expected[0]);
michael@0 168 do_check_eq(msg.data == null, expected[1] == null);
michael@0 169 if (expected[1] != null) {
michael@0 170 do_check_eq(msg.data.length, expected[1].length);
michael@0 171 for (let i = 0; i < expected[1].length; i++) {
michael@0 172 do_check_eq(msg.data[i], expected[1][i]);
michael@0 173 }
michael@0 174 }
michael@0 175 do_check_eq(msg.language, expected[2]);
michael@0 176 }
michael@0 177
michael@0 178 // We're testing Cell Broadcast message body with all zeros octet stream. As
michael@0 179 // shown in 3GPP TS 23.038, septet 0x00 will be decoded as '@' when both
michael@0 180 // langTableIndex and langShiftTableIndex equal to
michael@0 181 // PDU_DCS_MSG_CODING_7BITS_ALPHABET.
michael@0 182
michael@0 183 // PDU_DCS_MSG_CODING_7BITS_ALPHABET
michael@0 184 test_data([PDU_DCS_MSG_CODING_7BITS_ALPHABET, null, false,
michael@0 185 [0]],
michael@0 186 ["@", null, null]);
michael@0 187 test_data([PDU_DCS_MSG_CODING_7BITS_ALPHABET, null, true,
michael@0 188 [0, 0, 0, 0]],
michael@0 189 ["@", null, "@@"]);
michael@0 190 test_data([PDU_DCS_MSG_CODING_7BITS_ALPHABET, "@@", false,
michael@0 191 [0]],
michael@0 192 ["@", null, "@@"]);
michael@0 193
michael@0 194 // PDU_DCS_MSG_CODING_8BITS_ALPHABET
michael@0 195 test_data([PDU_DCS_MSG_CODING_8BITS_ALPHABET, null, false,
michael@0 196 [0]],
michael@0 197 [null, [0], null]);
michael@0 198
michael@0 199 // PDU_DCS_MSG_CODING_16BITS_ALPHABET
michael@0 200 test_data([PDU_DCS_MSG_CODING_16BITS_ALPHABET, null, false,
michael@0 201 [0x00, 0x40]],
michael@0 202 ["@", null, null]);
michael@0 203 test_data([PDU_DCS_MSG_CODING_16BITS_ALPHABET, null, true,
michael@0 204 [0x00, 0x00, 0x00, 0x40]],
michael@0 205 ["@", null, "@@"]);
michael@0 206 test_data([PDU_DCS_MSG_CODING_16BITS_ALPHABET, "@@", false,
michael@0 207 [0x00, 0x40]],
michael@0 208 ["@", null, "@@"]);
michael@0 209
michael@0 210 run_next_test();
michael@0 211 });
michael@0 212
michael@0 213 add_test(function test_ril_worker__checkCellBroadcastMMISettable() {
michael@0 214 let worker = newWorker({
michael@0 215 postRILMessage: function(data) {
michael@0 216 // Do nothing
michael@0 217 },
michael@0 218 postMessage: function(message) {
michael@0 219 // Do nothing
michael@0 220 }
michael@0 221 });
michael@0 222
michael@0 223 let context = worker.ContextPool._contexts[0];
michael@0 224 let ril = context.RIL;
michael@0 225
michael@0 226 function test(from, to, expected) {
michael@0 227 do_check_eq(expected, ril._checkCellBroadcastMMISettable(from, to));
michael@0 228 }
michael@0 229
michael@0 230 test(-2, -1, false);
michael@0 231 test(-1, 0, false);
michael@0 232 test(0, 1, true);
michael@0 233 test(1, 1, false);
michael@0 234 test(2, 1, false);
michael@0 235 test(65536, 65537, false);
michael@0 236
michael@0 237 // We have both [4096, 4224), [4224, 4352), so it's actually [4096, 4352),
michael@0 238 // and [61440, 65536), [65535, 65536), so it's actually [61440, 65536).
michael@0 239 for (let i = 0; i < CB_NON_MMI_SETTABLE_RANGES.length;) {
michael@0 240 let from = CB_NON_MMI_SETTABLE_RANGES[i++];
michael@0 241 let to = CB_NON_MMI_SETTABLE_RANGES[i++];
michael@0 242 if ((from != 4224) && (from != 65535)) {
michael@0 243 test(from - 1, from, true);
michael@0 244 }
michael@0 245 test(from - 1, from + 1, false);
michael@0 246 test(from - 1, to, false);
michael@0 247 test(from - 1, to + 1, false);
michael@0 248 test(from, from + 1, false);
michael@0 249 test(from, to, false);
michael@0 250 test(from, to + 1, false);
michael@0 251 if ((from + 1) < to) {
michael@0 252 test(from + 1, to, false);
michael@0 253 test(from + 1, to + 1, false);
michael@0 254 }
michael@0 255 if ((to != 4224) && (to < 65535)) {
michael@0 256 test(to, to + 1, true);
michael@0 257 test(to + 1, to + 2, true);
michael@0 258 }
michael@0 259 }
michael@0 260
michael@0 261 run_next_test();
michael@0 262 });
michael@0 263
michael@0 264 add_test(function test_ril_worker__mergeCellBroadcastConfigs() {
michael@0 265 let worker = newWorker({
michael@0 266 postRILMessage: function(data) {
michael@0 267 // Do nothing
michael@0 268 },
michael@0 269 postMessage: function(message) {
michael@0 270 // Do nothing
michael@0 271 }
michael@0 272 });
michael@0 273
michael@0 274 let context = worker.ContextPool._contexts[0];
michael@0 275 let ril = context.RIL;
michael@0 276
michael@0 277 function test(olist, from, to, expected) {
michael@0 278 let result = ril._mergeCellBroadcastConfigs(olist, from, to);
michael@0 279 do_check_eq(JSON.stringify(expected), JSON.stringify(result));
michael@0 280 }
michael@0 281
michael@0 282 test(null, 0, 1, [0, 1]);
michael@0 283
michael@0 284 test([10, 13], 7, 8, [ 7, 8, 10, 13]);
michael@0 285 test([10, 13], 7, 9, [ 7, 9, 10, 13]);
michael@0 286 test([10, 13], 7, 10, [ 7, 13]);
michael@0 287 test([10, 13], 7, 11, [ 7, 13]);
michael@0 288 test([10, 13], 7, 12, [ 7, 13]);
michael@0 289 test([10, 13], 7, 13, [ 7, 13]);
michael@0 290 test([10, 13], 7, 14, [ 7, 14]);
michael@0 291 test([10, 13], 7, 15, [ 7, 15]);
michael@0 292 test([10, 13], 7, 16, [ 7, 16]);
michael@0 293 test([10, 13], 8, 9, [ 8, 9, 10, 13]);
michael@0 294 test([10, 13], 8, 10, [ 8, 13]);
michael@0 295 test([10, 13], 8, 11, [ 8, 13]);
michael@0 296 test([10, 13], 8, 12, [ 8, 13]);
michael@0 297 test([10, 13], 8, 13, [ 8, 13]);
michael@0 298 test([10, 13], 8, 14, [ 8, 14]);
michael@0 299 test([10, 13], 8, 15, [ 8, 15]);
michael@0 300 test([10, 13], 8, 16, [ 8, 16]);
michael@0 301 test([10, 13], 9, 10, [ 9, 13]);
michael@0 302 test([10, 13], 9, 11, [ 9, 13]);
michael@0 303 test([10, 13], 9, 12, [ 9, 13]);
michael@0 304 test([10, 13], 9, 13, [ 9, 13]);
michael@0 305 test([10, 13], 9, 14, [ 9, 14]);
michael@0 306 test([10, 13], 9, 15, [ 9, 15]);
michael@0 307 test([10, 13], 9, 16, [ 9, 16]);
michael@0 308 test([10, 13], 10, 11, [10, 13]);
michael@0 309 test([10, 13], 10, 12, [10, 13]);
michael@0 310 test([10, 13], 10, 13, [10, 13]);
michael@0 311 test([10, 13], 10, 14, [10, 14]);
michael@0 312 test([10, 13], 10, 15, [10, 15]);
michael@0 313 test([10, 13], 10, 16, [10, 16]);
michael@0 314 test([10, 13], 11, 12, [10, 13]);
michael@0 315 test([10, 13], 11, 13, [10, 13]);
michael@0 316 test([10, 13], 11, 14, [10, 14]);
michael@0 317 test([10, 13], 11, 15, [10, 15]);
michael@0 318 test([10, 13], 11, 16, [10, 16]);
michael@0 319 test([10, 13], 12, 13, [10, 13]);
michael@0 320 test([10, 13], 12, 14, [10, 14]);
michael@0 321 test([10, 13], 12, 15, [10, 15]);
michael@0 322 test([10, 13], 12, 16, [10, 16]);
michael@0 323 test([10, 13], 13, 14, [10, 14]);
michael@0 324 test([10, 13], 13, 15, [10, 15]);
michael@0 325 test([10, 13], 13, 16, [10, 16]);
michael@0 326 test([10, 13], 14, 15, [10, 13, 14, 15]);
michael@0 327 test([10, 13], 14, 16, [10, 13, 14, 16]);
michael@0 328 test([10, 13], 15, 16, [10, 13, 15, 16]);
michael@0 329
michael@0 330 test([10, 13, 14, 17], 7, 8, [ 7, 8, 10, 13, 14, 17]);
michael@0 331 test([10, 13, 14, 17], 7, 9, [ 7, 9, 10, 13, 14, 17]);
michael@0 332 test([10, 13, 14, 17], 7, 10, [ 7, 13, 14, 17]);
michael@0 333 test([10, 13, 14, 17], 7, 11, [ 7, 13, 14, 17]);
michael@0 334 test([10, 13, 14, 17], 7, 12, [ 7, 13, 14, 17]);
michael@0 335 test([10, 13, 14, 17], 7, 13, [ 7, 13, 14, 17]);
michael@0 336 test([10, 13, 14, 17], 7, 14, [ 7, 17]);
michael@0 337 test([10, 13, 14, 17], 7, 15, [ 7, 17]);
michael@0 338 test([10, 13, 14, 17], 7, 16, [ 7, 17]);
michael@0 339 test([10, 13, 14, 17], 7, 17, [ 7, 17]);
michael@0 340 test([10, 13, 14, 17], 7, 18, [ 7, 18]);
michael@0 341 test([10, 13, 14, 17], 7, 19, [ 7, 19]);
michael@0 342 test([10, 13, 14, 17], 8, 9, [ 8, 9, 10, 13, 14, 17]);
michael@0 343 test([10, 13, 14, 17], 8, 10, [ 8, 13, 14, 17]);
michael@0 344 test([10, 13, 14, 17], 8, 11, [ 8, 13, 14, 17]);
michael@0 345 test([10, 13, 14, 17], 8, 12, [ 8, 13, 14, 17]);
michael@0 346 test([10, 13, 14, 17], 8, 13, [ 8, 13, 14, 17]);
michael@0 347 test([10, 13, 14, 17], 8, 14, [ 8, 17]);
michael@0 348 test([10, 13, 14, 17], 8, 15, [ 8, 17]);
michael@0 349 test([10, 13, 14, 17], 8, 16, [ 8, 17]);
michael@0 350 test([10, 13, 14, 17], 8, 17, [ 8, 17]);
michael@0 351 test([10, 13, 14, 17], 8, 18, [ 8, 18]);
michael@0 352 test([10, 13, 14, 17], 8, 19, [ 8, 19]);
michael@0 353 test([10, 13, 14, 17], 9, 10, [ 9, 13, 14, 17]);
michael@0 354 test([10, 13, 14, 17], 9, 11, [ 9, 13, 14, 17]);
michael@0 355 test([10, 13, 14, 17], 9, 12, [ 9, 13, 14, 17]);
michael@0 356 test([10, 13, 14, 17], 9, 13, [ 9, 13, 14, 17]);
michael@0 357 test([10, 13, 14, 17], 9, 14, [ 9, 17]);
michael@0 358 test([10, 13, 14, 17], 9, 15, [ 9, 17]);
michael@0 359 test([10, 13, 14, 17], 9, 16, [ 9, 17]);
michael@0 360 test([10, 13, 14, 17], 9, 17, [ 9, 17]);
michael@0 361 test([10, 13, 14, 17], 9, 18, [ 9, 18]);
michael@0 362 test([10, 13, 14, 17], 9, 19, [ 9, 19]);
michael@0 363 test([10, 13, 14, 17], 10, 11, [10, 13, 14, 17]);
michael@0 364 test([10, 13, 14, 17], 10, 12, [10, 13, 14, 17]);
michael@0 365 test([10, 13, 14, 17], 10, 13, [10, 13, 14, 17]);
michael@0 366 test([10, 13, 14, 17], 10, 14, [10, 17]);
michael@0 367 test([10, 13, 14, 17], 10, 15, [10, 17]);
michael@0 368 test([10, 13, 14, 17], 10, 16, [10, 17]);
michael@0 369 test([10, 13, 14, 17], 10, 17, [10, 17]);
michael@0 370 test([10, 13, 14, 17], 10, 18, [10, 18]);
michael@0 371 test([10, 13, 14, 17], 10, 19, [10, 19]);
michael@0 372 test([10, 13, 14, 17], 11, 12, [10, 13, 14, 17]);
michael@0 373 test([10, 13, 14, 17], 11, 13, [10, 13, 14, 17]);
michael@0 374 test([10, 13, 14, 17], 11, 14, [10, 17]);
michael@0 375 test([10, 13, 14, 17], 11, 15, [10, 17]);
michael@0 376 test([10, 13, 14, 17], 11, 16, [10, 17]);
michael@0 377 test([10, 13, 14, 17], 11, 17, [10, 17]);
michael@0 378 test([10, 13, 14, 17], 11, 18, [10, 18]);
michael@0 379 test([10, 13, 14, 17], 11, 19, [10, 19]);
michael@0 380 test([10, 13, 14, 17], 12, 13, [10, 13, 14, 17]);
michael@0 381 test([10, 13, 14, 17], 12, 14, [10, 17]);
michael@0 382 test([10, 13, 14, 17], 12, 15, [10, 17]);
michael@0 383 test([10, 13, 14, 17], 12, 16, [10, 17]);
michael@0 384 test([10, 13, 14, 17], 12, 17, [10, 17]);
michael@0 385 test([10, 13, 14, 17], 12, 18, [10, 18]);
michael@0 386 test([10, 13, 14, 17], 12, 19, [10, 19]);
michael@0 387 test([10, 13, 14, 17], 13, 14, [10, 17]);
michael@0 388 test([10, 13, 14, 17], 13, 15, [10, 17]);
michael@0 389 test([10, 13, 14, 17], 13, 16, [10, 17]);
michael@0 390 test([10, 13, 14, 17], 13, 17, [10, 17]);
michael@0 391 test([10, 13, 14, 17], 13, 18, [10, 18]);
michael@0 392 test([10, 13, 14, 17], 13, 19, [10, 19]);
michael@0 393 test([10, 13, 14, 17], 14, 15, [10, 13, 14, 17]);
michael@0 394 test([10, 13, 14, 17], 14, 16, [10, 13, 14, 17]);
michael@0 395 test([10, 13, 14, 17], 14, 17, [10, 13, 14, 17]);
michael@0 396 test([10, 13, 14, 17], 14, 18, [10, 13, 14, 18]);
michael@0 397 test([10, 13, 14, 17], 14, 19, [10, 13, 14, 19]);
michael@0 398 test([10, 13, 14, 17], 15, 16, [10, 13, 14, 17]);
michael@0 399 test([10, 13, 14, 17], 15, 17, [10, 13, 14, 17]);
michael@0 400 test([10, 13, 14, 17], 15, 18, [10, 13, 14, 18]);
michael@0 401 test([10, 13, 14, 17], 15, 19, [10, 13, 14, 19]);
michael@0 402 test([10, 13, 14, 17], 16, 17, [10, 13, 14, 17]);
michael@0 403 test([10, 13, 14, 17], 16, 18, [10, 13, 14, 18]);
michael@0 404 test([10, 13, 14, 17], 16, 19, [10, 13, 14, 19]);
michael@0 405 test([10, 13, 14, 17], 17, 18, [10, 13, 14, 18]);
michael@0 406 test([10, 13, 14, 17], 17, 19, [10, 13, 14, 19]);
michael@0 407 test([10, 13, 14, 17], 18, 19, [10, 13, 14, 17, 18, 19]);
michael@0 408
michael@0 409 test([10, 13, 16, 19], 7, 14, [ 7, 14, 16, 19]);
michael@0 410 test([10, 13, 16, 19], 7, 15, [ 7, 15, 16, 19]);
michael@0 411 test([10, 13, 16, 19], 7, 16, [ 7, 19]);
michael@0 412 test([10, 13, 16, 19], 8, 14, [ 8, 14, 16, 19]);
michael@0 413 test([10, 13, 16, 19], 8, 15, [ 8, 15, 16, 19]);
michael@0 414 test([10, 13, 16, 19], 8, 16, [ 8, 19]);
michael@0 415 test([10, 13, 16, 19], 9, 14, [ 9, 14, 16, 19]);
michael@0 416 test([10, 13, 16, 19], 9, 15, [ 9, 15, 16, 19]);
michael@0 417 test([10, 13, 16, 19], 9, 16, [ 9, 19]);
michael@0 418 test([10, 13, 16, 19], 10, 14, [10, 14, 16, 19]);
michael@0 419 test([10, 13, 16, 19], 10, 15, [10, 15, 16, 19]);
michael@0 420 test([10, 13, 16, 19], 10, 16, [10, 19]);
michael@0 421 test([10, 13, 16, 19], 11, 14, [10, 14, 16, 19]);
michael@0 422 test([10, 13, 16, 19], 11, 15, [10, 15, 16, 19]);
michael@0 423 test([10, 13, 16, 19], 11, 16, [10, 19]);
michael@0 424 test([10, 13, 16, 19], 12, 14, [10, 14, 16, 19]);
michael@0 425 test([10, 13, 16, 19], 12, 15, [10, 15, 16, 19]);
michael@0 426 test([10, 13, 16, 19], 12, 16, [10, 19]);
michael@0 427 test([10, 13, 16, 19], 13, 14, [10, 14, 16, 19]);
michael@0 428 test([10, 13, 16, 19], 13, 15, [10, 15, 16, 19]);
michael@0 429 test([10, 13, 16, 19], 13, 16, [10, 19]);
michael@0 430 test([10, 13, 16, 19], 14, 15, [10, 13, 14, 15, 16, 19]);
michael@0 431 test([10, 13, 16, 19], 14, 16, [10, 13, 14, 19]);
michael@0 432 test([10, 13, 16, 19], 15, 16, [10, 13, 15, 19]);
michael@0 433
michael@0 434 run_next_test();
michael@0 435 });
michael@0 436

mercurial