public override int GetHashCode()
 {
     if (_methodInfo != null)
     {
         return(_opCode.GetHashCode() * 33 + _methodInfo.GetHashCode() * 2);
     }
     return(_opCode.GetHashCode() * 33 + _constructorInfo.GetHashCode() * 2 + 1);
 }
Esempio n. 2
0
        public void VerifyOpCode(OpCode opCode, string name, OpCodeType opCodeType, OperandType operandType, int size, int value, StackBehaviour stackBehaviourPop, StackBehaviour stackBehaviourPush)
        {
            Assert.Equal(name, opCode.Name);
            Assert.Equal(opCodeType, opCode.OpCodeType);
            Assert.Equal(operandType, opCode.OperandType);
            Assert.Equal(size, opCode.Size);
            Assert.Equal((short)value, opCode.Value);
            Assert.Equal(stackBehaviourPop, opCode.StackBehaviourPop);
            Assert.Equal(stackBehaviourPush, opCode.StackBehaviourPush);
            Assert.Equal(name, opCode.ToString());

            Assert.Equal(opCode.GetHashCode(), opCode.GetHashCode());

            Assert.True(opCode.Equals(opCode));
            Assert.False(opCode.Equals("OpCode"));
            Assert.False(opCode.Equals(null));
        }
Esempio n. 3
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = Offset;
         hashCode = (hashCode * 397) ^ OpCode.GetHashCode();
         hashCode = (hashCode * 397) ^ (Operand != null ? Operand.GetHashCode() : 0);
         return(hashCode);
     }
 }
Esempio n. 4
0
        public override int GetHashCode()
        {
            int hashCode = 0;

            unchecked {
                hashCode += 1000000007 * OpCode.GetHashCode();
                hashCode += 1000000009 * ByteArgument.GetHashCode();
                hashCode += 1000000021 * SByteArgument.GetHashCode();
                hashCode += 1000000033 * Int16Argument.GetHashCode();
                hashCode += 1000000087 * Int32Argument.GetHashCode();
                hashCode += 1000000093 * Int64Argument.GetHashCode();
                hashCode += 1000000097 * SingleArgument.GetHashCode();
                hashCode += 1000000103 * DoubleArgument.GetHashCode();
                if (argument != null)
                {
                    hashCode += 1000000123 * argument.GetHashCode();
                }
            }
            return(hashCode);
        }
Esempio n. 5
0
    private bool VerifyEqualsGetHashCodeF(OpCode op1, OpCode op2, string errNum)
    {
        bool retVal = true;

        try
        {
            int hash1 = op1.GetHashCode();
            int hash2 = op2.GetHashCode();
            if (hash1 == hash2)
            {
                TestLibrary.TestFramework.LogError(errNum, "Result is not the value as expected,hash1 is: " + hash1 + ",hash2 is: " + hash2);
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError(errNum, "Unexpected exception: " + e);
            retVal = false;
        }
        return retVal;
    }
Esempio n. 6
0
    private bool VerifyEqualsGetHashCodeF(OpCode op1, OpCode op2, string errNum)
    {
        bool retVal = true;

        try
        {
            int hash1 = op1.GetHashCode();
            int hash2 = op2.GetHashCode();
            if (hash1 == hash2)
            {
                TestLibrary.TestFramework.LogError(errNum, "Result is not the value as expected,hash1 is: " + hash1 + ",hash2 is: " + hash2);
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError(errNum, "Unexpected exception: " + e);
            retVal = false;
        }
        return(retVal);
    }
Esempio n. 7
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (OpCode != 0)
            {
                hash ^= OpCode.GetHashCode();
            }
            if (Uid != 0L)
            {
                hash ^= Uid.GetHashCode();
            }
            if (Data.Length != 0)
            {
                hash ^= Data.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Esempio n. 8
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (No != 0)
            {
                hash ^= No.GetHashCode();
            }
            if (OpCode != global::Dcgameprotobuf.PTxtOp.TxtMsg)
            {
                hash ^= OpCode.GetHashCode();
            }
            if (Msg.Length != 0)
            {
                hash ^= Msg.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Esempio n. 9
0
 public override int GetHashCode()
 {
     return(opCode.GetHashCode() * operand.GetHashCode());
 }
Esempio n. 10
0
 public override int GetHashCode()
 {
     return(OpCode.GetHashCode());
 }