dom/system/gonk/tests/test_ril_worker_cellbroadcast.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/system/gonk/tests/test_ril_worker_cellbroadcast.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,436 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +subscriptLoader.loadSubScript("resource://gre/modules/ril_consts.js", this);
     1.8 +
     1.9 +function run_test() {
    1.10 +  run_next_test();
    1.11 +}
    1.12 +
    1.13 +add_test(function test_ril_consts_cellbroadcast_misc() {
    1.14 +  // Must be 16 for indexing.
    1.15 +  do_check_eq(CB_DCS_LANG_GROUP_1.length, 16);
    1.16 +  do_check_eq(CB_DCS_LANG_GROUP_2.length, 16);
    1.17 +
    1.18 +  // Array length must be even.
    1.19 +  do_check_eq(CB_NON_MMI_SETTABLE_RANGES.length & 0x01, 0);
    1.20 +  for (let i = 0; i < CB_NON_MMI_SETTABLE_RANGES.length;) {
    1.21 +    let from = CB_NON_MMI_SETTABLE_RANGES[i++];
    1.22 +    let to = CB_NON_MMI_SETTABLE_RANGES[i++];
    1.23 +    do_check_eq(from < to, true);
    1.24 +  }
    1.25 +
    1.26 +  run_next_test();
    1.27 +});
    1.28 +
    1.29 +add_test(function test_ril_worker_GsmPDUHelper_readCbDataCodingScheme() {
    1.30 +  let worker = newWorker({
    1.31 +    postRILMessage: function(data) {
    1.32 +      // Do nothing
    1.33 +    },
    1.34 +    postMessage: function(message) {
    1.35 +      // Do nothing
    1.36 +    }
    1.37 +  });
    1.38 +
    1.39 +  let context = worker.ContextPool._contexts[0];
    1.40 +  function test_dcs(dcs, encoding, language, hasLanguageIndicator, messageClass) {
    1.41 +    context.Buf.readUint8 = function() {
    1.42 +      return dcs;
    1.43 +    };
    1.44 +
    1.45 +    let msg = {};
    1.46 +    context.GsmPDUHelper.readCbDataCodingScheme(msg);
    1.47 +
    1.48 +    do_check_eq(msg.dcs, dcs);
    1.49 +    do_check_eq(msg.encoding, encoding);
    1.50 +    do_check_eq(msg.language, language);
    1.51 +    do_check_eq(msg.hasLanguageIndicator, hasLanguageIndicator);
    1.52 +    do_check_eq(msg.messageClass, messageClass);
    1.53 +  }
    1.54 +
    1.55 +  function test_dcs_throws(dcs) {
    1.56 +    context.Buf.readUint8 = function() {
    1.57 +      return dcs;
    1.58 +    };
    1.59 +
    1.60 +    do_check_throws(function() {
    1.61 +      context.GsmPDUHelper.readCbDataCodingScheme({});
    1.62 +    }, "Unsupported CBS data coding scheme: " + dcs);
    1.63 +  }
    1.64 +
    1.65 +  // Group 0000
    1.66 +  for (let i = 0; i < 16; i++) {
    1.67 +    test_dcs(i, PDU_DCS_MSG_CODING_7BITS_ALPHABET, CB_DCS_LANG_GROUP_1[i],
    1.68 +             false, GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
    1.69 +  }
    1.70 +
    1.71 +  // Group 0001
    1.72 +  //   0000 GSM 7 bit default alphabet; message preceded by language indication.
    1.73 +  test_dcs(0x10, PDU_DCS_MSG_CODING_7BITS_ALPHABET, null, true,
    1.74 +           GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
    1.75 +  //   0001 UCS2; message preceded by language indication.
    1.76 +  test_dcs(0x11, PDU_DCS_MSG_CODING_16BITS_ALPHABET, null, true,
    1.77 +           GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
    1.78 +
    1.79 +  // Group 0010
    1.80 +  //   0000..0100
    1.81 +  for (let i = 0; i < 5; i++) {
    1.82 +    test_dcs(0x20 + i, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
    1.83 +             CB_DCS_LANG_GROUP_2[i], false,
    1.84 +             GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
    1.85 +  }
    1.86 +  //   0101..1111 Reserved
    1.87 +  for (let i = 5; i < 16; i++) {
    1.88 +    test_dcs(0x20 + i, PDU_DCS_MSG_CODING_7BITS_ALPHABET, null, false,
    1.89 +             GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
    1.90 +  }
    1.91 +
    1.92 +  // Group 0100, 0101, 1001
    1.93 +  for (let group of [0x40, 0x50, 0x90]) {
    1.94 +    for (let i = 0; i < 16; i++) {
    1.95 +      let encoding = i & 0x0C;
    1.96 +      if (encoding == 0x0C) {
    1.97 +        encoding = PDU_DCS_MSG_CODING_7BITS_ALPHABET;
    1.98 +      }
    1.99 +      let messageClass = GECKO_SMS_MESSAGE_CLASSES[i & PDU_DCS_MSG_CLASS_BITS];
   1.100 +      test_dcs(group + i, encoding, null, false, messageClass);
   1.101 +    }
   1.102 +  }
   1.103 +
   1.104 +  // Group 1111
   1.105 +  for (let i = 0; i < 16; i ++) {
   1.106 +    let encoding = i & 0x04 ? PDU_DCS_MSG_CODING_8BITS_ALPHABET
   1.107 +                            : PDU_DCS_MSG_CODING_7BITS_ALPHABET;
   1.108 +    let messageClass;
   1.109 +    switch(i & PDU_DCS_MSG_CLASS_BITS) {
   1.110 +      case 0x01: messageClass = PDU_DCS_MSG_CLASS_USER_1; break;
   1.111 +      case 0x02: messageClass = PDU_DCS_MSG_CLASS_USER_2; break;
   1.112 +      case 0x03: messageClass = PDU_DCS_MSG_CLASS_3; break;
   1.113 +      default: messageClass = PDU_DCS_MSG_CLASS_NORMAL; break;
   1.114 +    }
   1.115 +    test_dcs(0xF0 + i, encoding, null, false,
   1.116 +             GECKO_SMS_MESSAGE_CLASSES[messageClass]);
   1.117 +  }
   1.118 +
   1.119 +  // Group 0011, 1000, 1010, 1011, 1100
   1.120 +  //   0000..1111 Reserved
   1.121 +  for (let group of [0x30, 0x80, 0xA0, 0xB0, 0xC0]) {
   1.122 +    for (let i = 0; i < 16; i++) {
   1.123 +      test_dcs(group + i, PDU_DCS_MSG_CODING_7BITS_ALPHABET, null, false,
   1.124 +               GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
   1.125 +    }
   1.126 +  }
   1.127 +
   1.128 +  // Group 0110, 0111, 1101, 1110
   1.129 +  //   TODO: unsupported
   1.130 +  for (let group of [0x60, 0x70, 0xD0, 0xE0]) {
   1.131 +    for (let i = 0; i < 16; i++) {
   1.132 +      test_dcs_throws(group + i);
   1.133 +    }
   1.134 +  }
   1.135 +
   1.136 +  run_next_test();
   1.137 +});
   1.138 +
   1.139 +add_test(function test_ril_worker_GsmPDUHelper_readGsmCbData() {
   1.140 +  let worker = newWorker({
   1.141 +    postRILMessage: function(data) {
   1.142 +      // Do nothing
   1.143 +    },
   1.144 +    postMessage: function(message) {
   1.145 +      // Do nothing
   1.146 +    }
   1.147 +  });
   1.148 +
   1.149 +  let context = worker.ContextPool._contexts[0];
   1.150 +  function test_data(options, expected) {
   1.151 +    let readIndex = 0;
   1.152 +    context.Buf.readUint8 = function() {
   1.153 +      return options[3][readIndex++];
   1.154 +    };
   1.155 +    context.Buf.readUint8Array = function(length) {
   1.156 +      let array = new Uint8Array(length);
   1.157 +      for (let i = 0; i < length; i++) {
   1.158 +        array[i] = this.readUint8();
   1.159 +      }
   1.160 +      return array;
   1.161 +    };
   1.162 +
   1.163 +    let msg = {
   1.164 +      encoding: options[0],
   1.165 +      language: options[1],
   1.166 +      hasLanguageIndicator: options[2]
   1.167 +    };
   1.168 +    context.GsmPDUHelper.readGsmCbData(msg, options[3].length);
   1.169 +
   1.170 +    do_check_eq(msg.body, expected[0]);
   1.171 +    do_check_eq(msg.data == null, expected[1] == null);
   1.172 +    if (expected[1] != null) {
   1.173 +      do_check_eq(msg.data.length, expected[1].length);
   1.174 +      for (let i = 0; i < expected[1].length; i++) {
   1.175 +        do_check_eq(msg.data[i], expected[1][i]);
   1.176 +      }
   1.177 +    }
   1.178 +    do_check_eq(msg.language, expected[2]);
   1.179 +  }
   1.180 +
   1.181 +  // We're testing Cell Broadcast message body with all zeros octet stream. As
   1.182 +  // shown in 3GPP TS 23.038, septet 0x00 will be decoded as '@' when both
   1.183 +  // langTableIndex and langShiftTableIndex equal to
   1.184 +  // PDU_DCS_MSG_CODING_7BITS_ALPHABET.
   1.185 +
   1.186 +  // PDU_DCS_MSG_CODING_7BITS_ALPHABET
   1.187 +  test_data([PDU_DCS_MSG_CODING_7BITS_ALPHABET, null, false,
   1.188 +              [0]],
   1.189 +            ["@", null, null]);
   1.190 +  test_data([PDU_DCS_MSG_CODING_7BITS_ALPHABET, null, true,
   1.191 +              [0, 0, 0, 0]],
   1.192 +            ["@", null, "@@"]);
   1.193 +  test_data([PDU_DCS_MSG_CODING_7BITS_ALPHABET, "@@", false,
   1.194 +              [0]],
   1.195 +            ["@", null, "@@"]);
   1.196 +
   1.197 +  // PDU_DCS_MSG_CODING_8BITS_ALPHABET
   1.198 +  test_data([PDU_DCS_MSG_CODING_8BITS_ALPHABET, null, false,
   1.199 +              [0]],
   1.200 +            [null, [0], null]);
   1.201 +
   1.202 +  // PDU_DCS_MSG_CODING_16BITS_ALPHABET
   1.203 +  test_data([PDU_DCS_MSG_CODING_16BITS_ALPHABET, null, false,
   1.204 +              [0x00, 0x40]],
   1.205 +            ["@", null, null]);
   1.206 +  test_data([PDU_DCS_MSG_CODING_16BITS_ALPHABET, null, true,
   1.207 +              [0x00, 0x00, 0x00, 0x40]],
   1.208 +            ["@", null, "@@"]);
   1.209 +  test_data([PDU_DCS_MSG_CODING_16BITS_ALPHABET, "@@", false,
   1.210 +              [0x00, 0x40]],
   1.211 +            ["@", null, "@@"]);
   1.212 +
   1.213 +  run_next_test();
   1.214 +});
   1.215 +
   1.216 +add_test(function test_ril_worker__checkCellBroadcastMMISettable() {
   1.217 +  let worker = newWorker({
   1.218 +    postRILMessage: function(data) {
   1.219 +      // Do nothing
   1.220 +    },
   1.221 +    postMessage: function(message) {
   1.222 +      // Do nothing
   1.223 +    }
   1.224 +  });
   1.225 +
   1.226 +  let context = worker.ContextPool._contexts[0];
   1.227 +  let ril = context.RIL;
   1.228 +
   1.229 +  function test(from, to, expected) {
   1.230 +    do_check_eq(expected, ril._checkCellBroadcastMMISettable(from, to));
   1.231 +  }
   1.232 +
   1.233 +  test(-2, -1, false);
   1.234 +  test(-1, 0, false);
   1.235 +  test(0, 1, true);
   1.236 +  test(1, 1, false);
   1.237 +  test(2, 1, false);
   1.238 +  test(65536, 65537, false);
   1.239 +
   1.240 +  // We have both [4096, 4224), [4224, 4352), so it's actually [4096, 4352),
   1.241 +  // and [61440, 65536), [65535, 65536), so it's actually [61440, 65536).
   1.242 +  for (let i = 0; i < CB_NON_MMI_SETTABLE_RANGES.length;) {
   1.243 +    let from = CB_NON_MMI_SETTABLE_RANGES[i++];
   1.244 +    let to = CB_NON_MMI_SETTABLE_RANGES[i++];
   1.245 +    if ((from != 4224) && (from != 65535)) {
   1.246 +      test(from - 1, from, true);
   1.247 +    }
   1.248 +    test(from - 1, from + 1, false);
   1.249 +    test(from - 1, to, false);
   1.250 +    test(from - 1, to + 1, false);
   1.251 +    test(from, from + 1, false);
   1.252 +    test(from, to, false);
   1.253 +    test(from, to + 1, false);
   1.254 +    if ((from + 1) < to) {
   1.255 +      test(from + 1, to, false);
   1.256 +      test(from + 1, to + 1, false);
   1.257 +    }
   1.258 +    if ((to != 4224) && (to < 65535)) {
   1.259 +      test(to, to + 1, true);
   1.260 +      test(to + 1, to + 2, true);
   1.261 +    }
   1.262 +  }
   1.263 +
   1.264 +  run_next_test();
   1.265 +});
   1.266 +
   1.267 +add_test(function test_ril_worker__mergeCellBroadcastConfigs() {
   1.268 +  let worker = newWorker({
   1.269 +    postRILMessage: function(data) {
   1.270 +      // Do nothing
   1.271 +    },
   1.272 +    postMessage: function(message) {
   1.273 +      // Do nothing
   1.274 +    }
   1.275 +  });
   1.276 +
   1.277 +  let context = worker.ContextPool._contexts[0];
   1.278 +  let ril = context.RIL;
   1.279 +
   1.280 +  function test(olist, from, to, expected) {
   1.281 +    let result = ril._mergeCellBroadcastConfigs(olist, from, to);
   1.282 +    do_check_eq(JSON.stringify(expected), JSON.stringify(result));
   1.283 +  }
   1.284 +
   1.285 +  test(null, 0, 1, [0, 1]);
   1.286 +
   1.287 +  test([10, 13],  7,  8, [ 7,  8, 10, 13]);
   1.288 +  test([10, 13],  7,  9, [ 7,  9, 10, 13]);
   1.289 +  test([10, 13],  7, 10, [ 7, 13]);
   1.290 +  test([10, 13],  7, 11, [ 7, 13]);
   1.291 +  test([10, 13],  7, 12, [ 7, 13]);
   1.292 +  test([10, 13],  7, 13, [ 7, 13]);
   1.293 +  test([10, 13],  7, 14, [ 7, 14]);
   1.294 +  test([10, 13],  7, 15, [ 7, 15]);
   1.295 +  test([10, 13],  7, 16, [ 7, 16]);
   1.296 +  test([10, 13],  8,  9, [ 8,  9, 10, 13]);
   1.297 +  test([10, 13],  8, 10, [ 8, 13]);
   1.298 +  test([10, 13],  8, 11, [ 8, 13]);
   1.299 +  test([10, 13],  8, 12, [ 8, 13]);
   1.300 +  test([10, 13],  8, 13, [ 8, 13]);
   1.301 +  test([10, 13],  8, 14, [ 8, 14]);
   1.302 +  test([10, 13],  8, 15, [ 8, 15]);
   1.303 +  test([10, 13],  8, 16, [ 8, 16]);
   1.304 +  test([10, 13],  9, 10, [ 9, 13]);
   1.305 +  test([10, 13],  9, 11, [ 9, 13]);
   1.306 +  test([10, 13],  9, 12, [ 9, 13]);
   1.307 +  test([10, 13],  9, 13, [ 9, 13]);
   1.308 +  test([10, 13],  9, 14, [ 9, 14]);
   1.309 +  test([10, 13],  9, 15, [ 9, 15]);
   1.310 +  test([10, 13],  9, 16, [ 9, 16]);
   1.311 +  test([10, 13], 10, 11, [10, 13]);
   1.312 +  test([10, 13], 10, 12, [10, 13]);
   1.313 +  test([10, 13], 10, 13, [10, 13]);
   1.314 +  test([10, 13], 10, 14, [10, 14]);
   1.315 +  test([10, 13], 10, 15, [10, 15]);
   1.316 +  test([10, 13], 10, 16, [10, 16]);
   1.317 +  test([10, 13], 11, 12, [10, 13]);
   1.318 +  test([10, 13], 11, 13, [10, 13]);
   1.319 +  test([10, 13], 11, 14, [10, 14]);
   1.320 +  test([10, 13], 11, 15, [10, 15]);
   1.321 +  test([10, 13], 11, 16, [10, 16]);
   1.322 +  test([10, 13], 12, 13, [10, 13]);
   1.323 +  test([10, 13], 12, 14, [10, 14]);
   1.324 +  test([10, 13], 12, 15, [10, 15]);
   1.325 +  test([10, 13], 12, 16, [10, 16]);
   1.326 +  test([10, 13], 13, 14, [10, 14]);
   1.327 +  test([10, 13], 13, 15, [10, 15]);
   1.328 +  test([10, 13], 13, 16, [10, 16]);
   1.329 +  test([10, 13], 14, 15, [10, 13, 14, 15]);
   1.330 +  test([10, 13], 14, 16, [10, 13, 14, 16]);
   1.331 +  test([10, 13], 15, 16, [10, 13, 15, 16]);
   1.332 +
   1.333 +  test([10, 13, 14, 17],  7,  8, [ 7,  8, 10, 13, 14, 17]);
   1.334 +  test([10, 13, 14, 17],  7,  9, [ 7,  9, 10, 13, 14, 17]);
   1.335 +  test([10, 13, 14, 17],  7, 10, [ 7, 13, 14, 17]);
   1.336 +  test([10, 13, 14, 17],  7, 11, [ 7, 13, 14, 17]);
   1.337 +  test([10, 13, 14, 17],  7, 12, [ 7, 13, 14, 17]);
   1.338 +  test([10, 13, 14, 17],  7, 13, [ 7, 13, 14, 17]);
   1.339 +  test([10, 13, 14, 17],  7, 14, [ 7, 17]);
   1.340 +  test([10, 13, 14, 17],  7, 15, [ 7, 17]);
   1.341 +  test([10, 13, 14, 17],  7, 16, [ 7, 17]);
   1.342 +  test([10, 13, 14, 17],  7, 17, [ 7, 17]);
   1.343 +  test([10, 13, 14, 17],  7, 18, [ 7, 18]);
   1.344 +  test([10, 13, 14, 17],  7, 19, [ 7, 19]);
   1.345 +  test([10, 13, 14, 17],  8,  9, [ 8,  9, 10, 13, 14, 17]);
   1.346 +  test([10, 13, 14, 17],  8, 10, [ 8, 13, 14, 17]);
   1.347 +  test([10, 13, 14, 17],  8, 11, [ 8, 13, 14, 17]);
   1.348 +  test([10, 13, 14, 17],  8, 12, [ 8, 13, 14, 17]);
   1.349 +  test([10, 13, 14, 17],  8, 13, [ 8, 13, 14, 17]);
   1.350 +  test([10, 13, 14, 17],  8, 14, [ 8, 17]);
   1.351 +  test([10, 13, 14, 17],  8, 15, [ 8, 17]);
   1.352 +  test([10, 13, 14, 17],  8, 16, [ 8, 17]);
   1.353 +  test([10, 13, 14, 17],  8, 17, [ 8, 17]);
   1.354 +  test([10, 13, 14, 17],  8, 18, [ 8, 18]);
   1.355 +  test([10, 13, 14, 17],  8, 19, [ 8, 19]);
   1.356 +  test([10, 13, 14, 17],  9, 10, [ 9, 13, 14, 17]);
   1.357 +  test([10, 13, 14, 17],  9, 11, [ 9, 13, 14, 17]);
   1.358 +  test([10, 13, 14, 17],  9, 12, [ 9, 13, 14, 17]);
   1.359 +  test([10, 13, 14, 17],  9, 13, [ 9, 13, 14, 17]);
   1.360 +  test([10, 13, 14, 17],  9, 14, [ 9, 17]);
   1.361 +  test([10, 13, 14, 17],  9, 15, [ 9, 17]);
   1.362 +  test([10, 13, 14, 17],  9, 16, [ 9, 17]);
   1.363 +  test([10, 13, 14, 17],  9, 17, [ 9, 17]);
   1.364 +  test([10, 13, 14, 17],  9, 18, [ 9, 18]);
   1.365 +  test([10, 13, 14, 17],  9, 19, [ 9, 19]);
   1.366 +  test([10, 13, 14, 17], 10, 11, [10, 13, 14, 17]);
   1.367 +  test([10, 13, 14, 17], 10, 12, [10, 13, 14, 17]);
   1.368 +  test([10, 13, 14, 17], 10, 13, [10, 13, 14, 17]);
   1.369 +  test([10, 13, 14, 17], 10, 14, [10, 17]);
   1.370 +  test([10, 13, 14, 17], 10, 15, [10, 17]);
   1.371 +  test([10, 13, 14, 17], 10, 16, [10, 17]);
   1.372 +  test([10, 13, 14, 17], 10, 17, [10, 17]);
   1.373 +  test([10, 13, 14, 17], 10, 18, [10, 18]);
   1.374 +  test([10, 13, 14, 17], 10, 19, [10, 19]);
   1.375 +  test([10, 13, 14, 17], 11, 12, [10, 13, 14, 17]);
   1.376 +  test([10, 13, 14, 17], 11, 13, [10, 13, 14, 17]);
   1.377 +  test([10, 13, 14, 17], 11, 14, [10, 17]);
   1.378 +  test([10, 13, 14, 17], 11, 15, [10, 17]);
   1.379 +  test([10, 13, 14, 17], 11, 16, [10, 17]);
   1.380 +  test([10, 13, 14, 17], 11, 17, [10, 17]);
   1.381 +  test([10, 13, 14, 17], 11, 18, [10, 18]);
   1.382 +  test([10, 13, 14, 17], 11, 19, [10, 19]);
   1.383 +  test([10, 13, 14, 17], 12, 13, [10, 13, 14, 17]);
   1.384 +  test([10, 13, 14, 17], 12, 14, [10, 17]);
   1.385 +  test([10, 13, 14, 17], 12, 15, [10, 17]);
   1.386 +  test([10, 13, 14, 17], 12, 16, [10, 17]);
   1.387 +  test([10, 13, 14, 17], 12, 17, [10, 17]);
   1.388 +  test([10, 13, 14, 17], 12, 18, [10, 18]);
   1.389 +  test([10, 13, 14, 17], 12, 19, [10, 19]);
   1.390 +  test([10, 13, 14, 17], 13, 14, [10, 17]);
   1.391 +  test([10, 13, 14, 17], 13, 15, [10, 17]);
   1.392 +  test([10, 13, 14, 17], 13, 16, [10, 17]);
   1.393 +  test([10, 13, 14, 17], 13, 17, [10, 17]);
   1.394 +  test([10, 13, 14, 17], 13, 18, [10, 18]);
   1.395 +  test([10, 13, 14, 17], 13, 19, [10, 19]);
   1.396 +  test([10, 13, 14, 17], 14, 15, [10, 13, 14, 17]);
   1.397 +  test([10, 13, 14, 17], 14, 16, [10, 13, 14, 17]);
   1.398 +  test([10, 13, 14, 17], 14, 17, [10, 13, 14, 17]);
   1.399 +  test([10, 13, 14, 17], 14, 18, [10, 13, 14, 18]);
   1.400 +  test([10, 13, 14, 17], 14, 19, [10, 13, 14, 19]);
   1.401 +  test([10, 13, 14, 17], 15, 16, [10, 13, 14, 17]);
   1.402 +  test([10, 13, 14, 17], 15, 17, [10, 13, 14, 17]);
   1.403 +  test([10, 13, 14, 17], 15, 18, [10, 13, 14, 18]);
   1.404 +  test([10, 13, 14, 17], 15, 19, [10, 13, 14, 19]);
   1.405 +  test([10, 13, 14, 17], 16, 17, [10, 13, 14, 17]);
   1.406 +  test([10, 13, 14, 17], 16, 18, [10, 13, 14, 18]);
   1.407 +  test([10, 13, 14, 17], 16, 19, [10, 13, 14, 19]);
   1.408 +  test([10, 13, 14, 17], 17, 18, [10, 13, 14, 18]);
   1.409 +  test([10, 13, 14, 17], 17, 19, [10, 13, 14, 19]);
   1.410 +  test([10, 13, 14, 17], 18, 19, [10, 13, 14, 17, 18, 19]);
   1.411 +
   1.412 +  test([10, 13, 16, 19],  7, 14, [ 7, 14, 16, 19]);
   1.413 +  test([10, 13, 16, 19],  7, 15, [ 7, 15, 16, 19]);
   1.414 +  test([10, 13, 16, 19],  7, 16, [ 7, 19]);
   1.415 +  test([10, 13, 16, 19],  8, 14, [ 8, 14, 16, 19]);
   1.416 +  test([10, 13, 16, 19],  8, 15, [ 8, 15, 16, 19]);
   1.417 +  test([10, 13, 16, 19],  8, 16, [ 8, 19]);
   1.418 +  test([10, 13, 16, 19],  9, 14, [ 9, 14, 16, 19]);
   1.419 +  test([10, 13, 16, 19],  9, 15, [ 9, 15, 16, 19]);
   1.420 +  test([10, 13, 16, 19],  9, 16, [ 9, 19]);
   1.421 +  test([10, 13, 16, 19], 10, 14, [10, 14, 16, 19]);
   1.422 +  test([10, 13, 16, 19], 10, 15, [10, 15, 16, 19]);
   1.423 +  test([10, 13, 16, 19], 10, 16, [10, 19]);
   1.424 +  test([10, 13, 16, 19], 11, 14, [10, 14, 16, 19]);
   1.425 +  test([10, 13, 16, 19], 11, 15, [10, 15, 16, 19]);
   1.426 +  test([10, 13, 16, 19], 11, 16, [10, 19]);
   1.427 +  test([10, 13, 16, 19], 12, 14, [10, 14, 16, 19]);
   1.428 +  test([10, 13, 16, 19], 12, 15, [10, 15, 16, 19]);
   1.429 +  test([10, 13, 16, 19], 12, 16, [10, 19]);
   1.430 +  test([10, 13, 16, 19], 13, 14, [10, 14, 16, 19]);
   1.431 +  test([10, 13, 16, 19], 13, 15, [10, 15, 16, 19]);
   1.432 +  test([10, 13, 16, 19], 13, 16, [10, 19]);
   1.433 +  test([10, 13, 16, 19], 14, 15, [10, 13, 14, 15, 16, 19]);
   1.434 +  test([10, 13, 16, 19], 14, 16, [10, 13, 14, 19]);
   1.435 +  test([10, 13, 16, 19], 15, 16, [10, 13, 15, 19]);
   1.436 +
   1.437 +  run_next_test();
   1.438 +});
   1.439 +

mercurial