AsmResolver.Tests.Native.X86SizeComputationTests.TestSizeComputation C# (CSharp) 메소드

TestSizeComputation() 개인적인 정적인 메소드

private static TestSizeComputation ( byte opcodes ) : void
opcodes byte
리턴 void
        private static void TestSizeComputation(byte[] opcodes)
        {
            var reader = new MemoryStreamReader(opcodes);
            var disassembler = new X86Disassembler(reader);

            while (reader.Position < reader.Length)
            {
                var instruction = disassembler.ReadNextInstruction();

                var expectedSize = reader.Position - instruction.Offset;
                var computeSize = instruction.ComputeSize();

                if (expectedSize != computeSize)
                    Assert.Fail("The instruction {0} has size {1}, but {2} was computed.", instruction, expectedSize,
                        computeSize);
            }
        }