public static void AssertSingleOpCode( byte[] bytes, Func <IOpCode, bool> typeCheck, OpCodeSize size = OpCodeSize._16, bool reducedCore = false) { var opcodes = Identify(bytes, reducedCore).ToList(); Assert.IsTrue(opcodes.Count == 1); var opcode = opcodes.First(); Assert.IsTrue(opcode.Size == size); Assert.IsTrue(typeCheck(opcode)); }
public static void AssertDoubleOpCode( byte[] bytes, Func <IOpCode, bool> typeCheck1, Func <IOpCode, bool> typeCheck2, OpCodeSize size = OpCodeSize._16) { var opcodes = Identify(bytes).ToList(); Assert.IsTrue(opcodes.Count == 2); var opcode1 = opcodes.Single(typeCheck1); var opcode2 = opcodes.Single(typeCheck2); Assert.IsTrue(opcode1.Size == size); Assert.IsTrue(opcode2.Size == size); }
public static int Main() { OpCodeSize test = new OpCodeSize(); TestLibrary.TestFramework.BeginTestCase("OpCodeSize"); if (test.RunTests()) { TestLibrary.TestFramework.EndTestCase(); TestLibrary.TestFramework.LogInformation("PASS"); return(100); } else { TestLibrary.TestFramework.EndTestCase(); TestLibrary.TestFramework.LogInformation("FAIL"); return(0); } }
public static int Main() { OpCodeSize test = new OpCodeSize(); TestLibrary.TestFramework.BeginTestCase("OpCodeSize"); if (test.RunTests()) { TestLibrary.TestFramework.EndTestCase(); TestLibrary.TestFramework.LogInformation("PASS"); return 100; } else { TestLibrary.TestFramework.EndTestCase(); TestLibrary.TestFramework.LogInformation("FAIL"); return 0; } }