Exemplo n.º 1
0
    public static void TestGetHashCode()
    {
        UInt32 i1 = 123;
        UInt32 i2 = 654;

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

                tmp |= DeviceId;
                return(tmp.GetHashCode());
            }
Exemplo n.º 3
0
 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()
            );
 }
Exemplo n.º 4
0
        public TxOutputKey(UInt256 txHash, UInt32 txOutputIndex)
        {
            this._txHash        = txHash;
            this._txOutputIndex = txOutputIndex;

            this.hashCode = txHash.GetHashCode() ^ txOutputIndex.GetHashCode();
        }
Exemplo n.º 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();
        }
Exemplo n.º 6
0
 public override int GetHashCode()
 {
     return
         (mVertexSize.GetHashCode()
          ^ mVertexCount.GetHashCode()
          ^ mByteOffset.GetHashCode()
          ^ mSwizzles.GetHashCode()
         );
 }
Exemplo n.º 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();
        }
Exemplo n.º 8
0
 public override int GetHashCode()
 {
     return
         (mName.GetHashCode()
          ^ mStartIndex.GetHashCode()
          ^ mMinVertexIndex.GetHashCode()
          ^ mVertexCount.GetHashCode()
          ^ mPrimitiveCount.GetHashCode()
         );
 }
Exemplo n.º 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);
            }
Exemplo n.º 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);
        }
Exemplo n.º 11
0
 public void TestGetHashCode()
 {
     try {
         MyUInt32_1.GetHashCode();
         MyUInt32_2.GetHashCode();
         MyUInt32_3.GetHashCode();
     }
     catch {
         Assert.Fail("GetHashCode should not raise an exception here");
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
    }
Exemplo n.º 19
0
    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);
    }
Exemplo n.º 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);
    }
Exemplo n.º 21
0
 public override int GetHashCode() => value.GetHashCode();
 public override int GetHashCode()
 {
     return(m_Handle.GetHashCode() ^ m_Version.GetHashCode());
 }
Exemplo n.º 23
0
 public override int GetHashCode()
 {
     return(Value.GetHashCode());
 }
Exemplo n.º 24
0
 public override int GetHashCode()
 {
     return(mNameHash.GetHashCode()
            ^ mInverseBindPose.GetHashCode());
 }
Exemplo n.º 25
0
 public override int GetHashCode()
 {
     return(Id.GetHashCode());
 }
Exemplo n.º 26
0
 public override Int32 GetHashCode()
 {
     return(InstructionPointer.GetHashCode() ^ IsTainted.GetHashCode());
 }
Exemplo n.º 27
0
 public override int GetHashCode()
 {
     // ReSharper disable NonReadonlyMemberInGetHashCode
     return(CombineHashCodes(hasValue.GetHashCode(), value.GetHashCode()));
     // ReSharper restore NonReadonlyMemberInGetHashCode
 }
Exemplo n.º 28
0
 public override int GetHashCode()
 {
     return(rawType.GetHashCode());
 }
Exemplo n.º 29
0
 override public int GetHashCode()
 {
     return(ID.GetHashCode());
 }
Exemplo n.º 30
0
 public override int GetHashCode()
 {
     return(m_data.GetHashCode());
 }