public void WriteBadOpCode() { var badInstruction = new Instruction((OpCode)254); Assert.That(badInstruction.ToString(), Is.StringMatching(@"^254\s+;.*")); var ms = new StringWriter(); using (var writer = new InstructionTextWriter(ms)) writer.Write(badInstruction); }
public void WriteExtraParameter() { var badInstruction = new Instruction(OpCode.Ret).Source(10); Assert.That(badInstruction.ToString(), Is.StringMatching(@"^Ret\s+\$10")); var ms = new StringWriter(); using (var writer = new InstructionTextWriter(ms)) writer.Write(badInstruction); }
public void Decompile(string file) { file = string.Concat(_testPaths[Environment.MachineName], file); var objData = Compile(file); var reader = new CodeReader(objData); var writer = new InstructionTextWriter(Console.Out); foreach (var instruction in reader) { writer.Write(instruction); } }
public void WriteMissingParameter() { var badInstruction = new Instruction(OpCode.Mov).Source(10); Assert.That(badInstruction.ToString(), Is.StringMatching(@"^Mov")); var ms = new StringWriter(); using (var writer = new InstructionTextWriter(ms)) { writer.Write(badInstruction); } }