void Invalid_bitness_throws() { foreach (var bitness in BitnessUtils.GetInvalidBitnessValues()) { Assert.Throws <ArgumentOutOfRangeException>(() => new Assembler(bitness)); } }
void OpCodeInfo_IsAvailableInMode_throws_if_invalid_bitness() { foreach (var bitness in BitnessUtils.GetInvalidBitnessValues()) { Assert.Throws <ArgumentOutOfRangeException>(() => Code.Nopd.ToOpCode().IsAvailableInMode(bitness)); } }
void TryEncode_with_invalid_bitness_throws() { foreach (var bitness in BitnessUtils.GetInvalidBitnessValues()) { Assert.Throws <ArgumentOutOfRangeException>(() => BlockEncoder.TryEncode(bitness, new InstructionBlock(new CodeWriterImpl(), new Instruction[1], 0), out _, out _)); } foreach (var bitness in BitnessUtils.GetInvalidBitnessValues()) { Assert.Throws <ArgumentOutOfRangeException>(() => BlockEncoder.TryEncode(bitness, new[] { new InstructionBlock(new CodeWriterImpl(), new Instruction[1], 0) }, out _, out _)); } }
void Test_Decoder_Create_throws() { foreach (var bitness in BitnessUtils.GetInvalidBitnessValues()) { Assert.Throws <ArgumentOutOfRangeException>(() => Decoder.Create(bitness, new ByteArrayCodeReader("90"), DecoderOptions.None)); } foreach (var bitness in new[] { 16, 32, 64 }) { Assert.Throws <ArgumentNullException>(() => Decoder.Create(bitness, null, DecoderOptions.None)); } }
void Test_Encoder_Create_throws() { foreach (var bitness in BitnessUtils.GetInvalidBitnessValues()) { Assert.Throws <ArgumentOutOfRangeException>(() => Encoder.Create(bitness, new CodeWriterImpl())); } foreach (var bitness in new[] { 16, 32, 64 }) { Assert.Throws <ArgumentNullException>(() => Encoder.Create(bitness, null)); } }