示例#1
0
        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));
        }
示例#2
0
        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);
        }
示例#3
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);
        }
    }
示例#4
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;
        }
    }