コード例 #1
0
 void Invalid_bitness_throws()
 {
     foreach (var bitness in BitnessUtils.GetInvalidBitnessValues())
     {
         Assert.Throws <ArgumentOutOfRangeException>(() => new Assembler(bitness));
     }
 }
コード例 #2
0
 void OpCodeInfo_IsAvailableInMode_throws_if_invalid_bitness()
 {
     foreach (var bitness in BitnessUtils.GetInvalidBitnessValues())
     {
         Assert.Throws <ArgumentOutOfRangeException>(() => Code.Nopd.ToOpCode().IsAvailableInMode(bitness));
     }
 }
コード例 #3
0
 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 _));
     }
 }
コード例 #4
0
ファイル: MiscTests.cs プロジェクト: 5l1v3r1/iced-1
        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));
            }
        }
コード例 #5
0
        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));
            }
        }