testIntValues method Null safety

Future<void> testIntValues()

Implementation

Future<void> testIntValues() async {
  await test('int sign modes', () async {
    Model m = newModel();
    m.wordSize = 8;
    m.displayMode = DisplayMode.decimal;
    for (int i = 0; i < 256; i++) {
      m.integerSignMode = SignMode.unsigned;
      m.xI = BigInt.from(i);
      m.integerSignMode = SignMode.twosComplement;
      if (i & 0x80 == 0) {
        await expect(m.xI, BigInt.from(i));
      } else {
        await expect(m.xI, BigInt.from(i - 0x100));
      }
      m.integerSignMode = SignMode.onesComplement;
      if (i & 0x80 == 0) {
        await expect(m.xI, BigInt.from(i));
      } else {
        await expect(m.xI, BigInt.from(i - 0xff));
      }
      m.integerSignMode = SignMode.unsigned;
      await expect(m.xI, BigInt.from(i));
      await expect(m.x.internal, BigInt.from(i));
    }
  });
}