示例#1
0
    public static void TestGetHashCode()
    {
        UInt32 i1 = 123;
        UInt32 i2 = 654;

        Assert.NotEqual(0, i1.GetHashCode());
        Assert.NotEqual(i1.GetHashCode(), i2.GetHashCode());
    }
示例#2
0
            public override int GetHashCode()
            {
                UInt32 tmp = (uint)(VendorId << 16);

                tmp |= DeviceId;
                return(tmp.GetHashCode());
            }
示例#3
0
文件: MLOD.cs 项目: Onebeld/Regul
 public override int GetHashCode()
 {
     return(mName.GetHashCode()
            ^ mMaterialIndex.GetHashCode()
            ^ mVertexFormatIndex.GetHashCode()
            ^ mVertexBufferIndex.GetHashCode()
            ^ mIndexBufferIndex.GetHashCode()
            ^ mPrimitiveType.GetHashCode()
            ^ mFlags.GetHashCode()
            ^ mStreamOffset.GetHashCode()
            ^ mStartVertex.GetHashCode()
            ^ mStartIndex.GetHashCode()
            ^ mMinVertexIndex.GetHashCode()
            ^ mVertexCount.GetHashCode()
            ^ mPrimitiveCount.GetHashCode()
            ^ mSkinControllerIndex.GetHashCode()
            ^ mScaleOffsetIndex.GetHashCode()
            ^ mJointReferences.GetHashCode()
            ^ mBounds.GetHashCode()
            ^ mGeometryStates.GetHashCode()
            ^ mParentName.GetHashCode()
            ^ mMirrorPlane.GetHashCode()
            ^ mOwner.GetHashCode()
            );
 }
示例#4
0
        public TxOutputKey(UInt256 txHash, UInt32 txOutputIndex)
        {
            this._txHash        = txHash;
            this._txOutputIndex = txOutputIndex;

            this.hashCode = txHash.GetHashCode() ^ txOutputIndex.GetHashCode();
        }
示例#5
0
        public TxKey(UInt256 blockHash, UInt32 txIndex, UInt256 txHash)
        {
            this._blockHash = blockHash;
            this._txIndex   = txIndex;
            this._txHash    = txHash;

            this.hashCode = blockHash.GetHashCode() ^ txIndex.GetHashCode() ^ txHash.GetHashCode();
        }
示例#6
0
 public override int GetHashCode()
 {
     return
         (mVertexSize.GetHashCode()
          ^ mVertexCount.GetHashCode()
          ^ mByteOffset.GetHashCode()
          ^ mSwizzles.GetHashCode()
         );
 }
示例#7
0
        public UnspentTx(UInt256 blockHash, UInt32 txIndex, UInt256 txHash, ImmutableBitArray unspentOutputs)
        {
            this._blockHash      = blockHash;
            this._txIndex        = txIndex;
            this._txHash         = txHash;
            this._unspentOutputs = unspentOutputs;

            this.notDefault = true;
            this.hashCode   = blockHash.GetHashCode() ^ txIndex.GetHashCode() ^ txHash.GetHashCode() ^ unspentOutputs.GetHashCode();
        }
示例#8
0
文件: MLOD.cs 项目: Onebeld/Regul
 public override int GetHashCode()
 {
     return
         (mName.GetHashCode()
          ^ mStartIndex.GetHashCode()
          ^ mMinVertexIndex.GetHashCode()
          ^ mVertexCount.GetHashCode()
          ^ mPrimitiveCount.GetHashCode()
         );
 }
示例#9
0
            public override int GetHashCode()
            {
                var hash = 17;

                hash = hash * 23 + format.GetHashCode();
                hash = hash * 23 + w.GetHashCode();
                hash = hash * 23 + h.GetHashCode();
                hash = hash * 23 + refresh_rate.GetHashCode();
                return(hash);
            }
示例#10
0
        public override int GetHashCode()
        {
            int hash = specialFormat.GetHashCode() * 17;

            hash = hash * 17 + compCount.GetHashCode();
            hash = hash * 17 + compByteWidth.GetHashCode();
            hash = hash * 17 + compType.GetHashCode();
            hash = hash * 17 + srgbCorrected.GetHashCode();
            return(hash);
        }
示例#11
0
文件: UInt32Test.cs 项目: yonder/mono
 public void TestGetHashCode()
 {
     try {
         MyUInt32_1.GetHashCode();
         MyUInt32_2.GetHashCode();
         MyUInt32_3.GetHashCode();
     }
     catch {
         Assert.Fail("GetHashCode should not raise an exception here");
     }
 }
示例#12
0
        public override int GetHashCode()
        {
            int hashCode = -855528038;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name);

            hashCode = hashCode * -1521134295 + Format.GetHashCode();
            hashCode = hashCode * -1521134295 + NbTuples.GetHashCode();
            hashCode = hashCode * -1521134295 + NbValuesPerTuple.GetHashCode();
            return(hashCode);
        }
示例#13
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = Persistent.GetHashCode();
         hashCode = (hashCode * 397) ^ Random.GetHashCode();
         hashCode = (hashCode * 397) ^ ToSource.GetHashCode();
         hashCode = (hashCode * 397) ^ ToDestination.GetHashCode();
         hashCode = (hashCode * 397) ^ CtMask.GetHashCode();
         hashCode = (hashCode * 397) ^ CtMark.GetHashCode();
         return(hashCode);
     }
 }
示例#14
0
        /// <summary> Gets the hash code for the current format. </summary>
        /// <returns> The hash code. </returns>
        public override Int32 GetHashCode()
        {
            Int32 Hash = FConnectionId.GetHashCode();

            Hash = (Hash * 397) ^ FDeviceType.GetHashCode();
            Hash = (Hash * 397) ^ FInterval.GetHashCode();
            Hash = (Hash * 397) ^ FMode.GetHashCode();
            Hash = (Hash * 397) ^ FNotificationsEnabled.GetHashCode();
            Hash = (Hash * 397) ^ FNumberOfBytes.GetHashCode();
            Hash = (Hash * 397) ^ FRevision.GetHashCode();
            Hash = (Hash * 397) ^ FUnit.GetHashCode();
            return(Hash);
        }
示例#15
0
        public override Int32 GetHashCode()
        {
            var hashCode = instructionPointer.GetHashCode() ^
                           registers.GetHashCode() ^
                           zeroFlag.GetHashCode();

            foreach (var key in dataSegment.Keys)
            {
                hashCode ^= dataSegment[key].GetHashCode();
            }

            return(hashCode);
        }
示例#16
0
        public override int GetHashCode()
        {
            unchecked {
                int hash = 17;

                hash = hash * 29 + PrimaryNameServer.GetHashCode();
                hash = hash * 29 + Hostmaster.GetHashCode();
                hash = hash * 29 + Serial.GetHashCode();
                hash = hash * 29 + RefreshSeconds.GetHashCode();
                hash = hash * 29 + RetrySeconds.GetHashCode();
                hash = hash * 29 + ExpireSeconds.GetHashCode();
                hash = hash * 29 + MinimumTTL.GetHashCode();
                return(hash);
            }
        }
示例#17
0
        private void RandomSyncedDelivery(Stimulus stim, UInt32 begin, UInt32 end)
        {
            Random          syncRandom      = new Random(randomSeed + begin.GetHashCode() + end.GetHashCode());
            List <Interval> bufferIntervals = new List <Interval>();

            for (int i = 0; i < stim.stims_per_sound; i++)
            {
                StimulusInterval interval;
                Interval         bufferInterval;
                do
                {
                    uint duration   = (uint)syncRandom.Next((int)(stim.dur_min), (int)(stim.dur_max));
                    uint buffer     = stim.dur_max + stim.interval_min;
                    uint randomStim = ((uint)syncRandom.Next((int)(begin), (int)(end - buffer)));
                    bufferInterval = new Interval(randomStim, randomStim + buffer);
                    interval       = new StimulusInterval(stim, randomStim, randomStim + duration);
                } while (bufferIntervals.Exists(a => a.Overlap(bufferInterval)));
                stim.stimIntervals.Add(interval);
                bufferIntervals.Add(bufferInterval);
            }
        }
示例#18
0
    public bool PosTest3()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest3: the UInt32 instance is the Int32 MaxValue");

        try
        {
            UInt32 uintA = (UInt32)Int32.MaxValue;
            Int32  uintB = uintA.GetHashCode();
            if (uintB != Int32.MaxValue)
            {
                TestLibrary.TestFramework.LogError("005", "the ActualResult is not the ExpectResult");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("006", "Unexpected exception: " + e);
            retVal = false;
        }
        return(retVal);
    }
    public override int GetHashCode()
    {
        int hash = 0;

        hash ^= baseColor.GetHashCode();
        hash ^= baseMaskType.GetHashCode();
        hash ^= baseMaskParameters.GetHashCode();
        hash ^= baseMaskAxis.GetHashCode();
        hash ^= sampleMode.GetHashCode();
        hash ^= alphaMaskTextureID.GetHashCode();
        hash ^= alphaMaskScaleOffset.GetHashCode();
        hash ^= normalMapTextureID.GetHashCode();
        hash ^= normalMapScaleOffset.GetHashCode();
        hash ^= parallaxMapTextureID.GetHashCode();
        hash ^= parallaxMapScaleOffset.GetHashCode();
        hash ^= roughnessMapTextureID.GetHashCode();
        hash ^= roughnessMapScaleOffset.GetHashCode();
        hash ^= layerCount.GetHashCode();
        for (int i = 0; i < layerCount; ++i)
        {
            hash ^= layers[i].GetHashCode();
        }
        return(hash);
    }
示例#20
0
    public bool PosTest5()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest5: the UInt32 instance is less than the Int32 MaxValue");

        try
        {
            int    intA  = this.GetInt32(1, Int32.MaxValue);
            UInt32 uintA = (UInt32)intA;
            Int32  uintB = uintA.GetHashCode();
            if (uintB != intA)
            {
                TestLibrary.TestFramework.LogError("009", "the ActualResult is not the ExpectResult");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("010", "Unexpected exception: " + e);
            retVal = false;
        }
        return(retVal);
    }
示例#21
0
 public override int GetHashCode() => value.GetHashCode();
 public override int GetHashCode()
 {
     return(m_Handle.GetHashCode() ^ m_Version.GetHashCode());
 }
示例#23
0
 public override int GetHashCode()
 {
     return(Value.GetHashCode());
 }
示例#24
0
文件: SKIN.cs 项目: Onebeld/Regul
 public override int GetHashCode()
 {
     return(mNameHash.GetHashCode()
            ^ mInverseBindPose.GetHashCode());
 }
示例#25
0
 public override int GetHashCode()
 {
     return(Id.GetHashCode());
 }
示例#26
0
 public override Int32 GetHashCode()
 {
     return(InstructionPointer.GetHashCode() ^ IsTainted.GetHashCode());
 }
示例#27
0
 public override int GetHashCode()
 {
     // ReSharper disable NonReadonlyMemberInGetHashCode
     return(CombineHashCodes(hasValue.GetHashCode(), value.GetHashCode()));
     // ReSharper restore NonReadonlyMemberInGetHashCode
 }
示例#28
0
 public override int GetHashCode()
 {
     return(rawType.GetHashCode());
 }
示例#29
0
 override public int GetHashCode()
 {
     return(ID.GetHashCode());
 }
示例#30
0
 public override int GetHashCode()
 {
     return(m_data.GetHashCode());
 }