Пример #1
0
 public MnemonicOptionsTestCase(string hexBytes, Code code, int bitness, string formattedString, FormatMnemonicOptions flags)
 {
     HexBytes        = hexBytes;
     Code            = code;
     Bitness         = bitness;
     FormattedString = formattedString;
     Flags           = flags;
 }
Пример #2
0
        void FormatMnemonicOptions(string hexBytes, Code code, int bitness, ulong ip, string formattedString, FormatMnemonicOptions options)
        {
            var decoder = Decoder.Create(bitness, new ByteArrayCodeReader(hexBytes));

            decoder.IP = ip;
            decoder.Decode(out var instruction);
            Assert.Equal(code, instruction.Code);
            var formatter = FormatterFactory.Create();
            var output    = new StringOutput();

            formatter.FormatMnemonic(instruction, output, options);
            var actualFormattedString = output.ToStringAndReset();

#pragma warning disable xUnit2006 // Do not use invalid string equality check
            // Show the full string without ellipses by using Equal<string>() instead of Equal()
            Assert.Equal <string>(formattedString, actualFormattedString);
#pragma warning restore xUnit2006 // Do not use invalid string equality check
        }
Пример #3
0
 /// <summary>
 /// Formats the mnemonic and any prefixes
 /// </summary>
 /// <param name="instruction">Instruction</param>
 /// <param name="output">Output</param>
 /// <param name="options">Options</param>
 public abstract void FormatMnemonic(ref Instruction instruction, FormatterOutput output, FormatMnemonicOptions options);