public static void StructWithFloatFieldNotTightlyPackedNaNCompareTest()
        {
            StructWithFloatFieldNotTightlyPacked obj1 = new StructWithFloatFieldNotTightlyPacked();
            obj1.value1 = float.NaN;
            obj1.value2 = 1;

            StructWithFloatFieldNotTightlyPacked obj2 = new StructWithFloatFieldNotTightlyPacked();
            obj2.value1 = -float.NaN;
            obj2.value2 = 1;

            Assert.True(obj1.Equals(obj2));
        }
Beispiel #2
0
        public static void StructWithFloatFieldNotTightlyPackedZeroCompareTest()
        {
            StructWithFloatFieldNotTightlyPacked obj1 = new StructWithFloatFieldNotTightlyPacked();

            obj1.value1 = 0.0f;
            obj1.value2 = 1;

            StructWithFloatFieldNotTightlyPacked obj2 = new StructWithFloatFieldNotTightlyPacked();

            obj2.value1 = -0.0f;
            obj2.value2 = 1;

            Assert.True(obj1.Equals(obj2));
            Assert.Equal(obj1.GetHashCode(), obj2.GetHashCode());
        }