示例#1
0
        public void Float32LessThanOrEqual_Compiled()
        {
            var exports = ComparisonTestBase <float> .CreateInstance(
                new GetLocal(0),
                new GetLocal(1),
                new Float32LessThanOrEqual(),
                new End());

            var values = new[]
            {
                0.0f,
                1.0f,
                -1.0f,
                -(float)Math.PI,
                (float)Math.PI,
                (float)double.NaN,
                (float)double.NegativeInfinity,
                (float)double.PositiveInfinity,
                (float)double.Epsilon,
                -(float)double.Epsilon,
            };

            foreach (var comparand in values)
            {
                foreach (var value in values)
                {
                    Assert.AreEqual(comparand <= value, exports.Test(comparand, value) != 0);
                }

                foreach (var value in values)
                {
                    Assert.AreEqual(value <= comparand, exports.Test(value, comparand) != 0);
                }
            }
        }
    public void Int32LessThanUnsigned_Compiled()
    {
        var exports = ComparisonTestBase <int> .CreateInstance(
            new LocalGet(0),
            new LocalGet(1),
            new Int32LessThanUnsigned(),
            new End());

        var values = new uint[]
        {
            0,
            1,
            0x00,
            0x0F,
            0xF0,
            0xFF,
            byte.MaxValue,
            ushort.MaxValue,
            int.MaxValue,
            uint.MaxValue,
        };

        foreach (var comparand in values)
        {
            foreach (var value in values)
            {
                Assert.AreEqual(comparand < value, exports.Test((int)comparand, (int)value) != 0);
            }

            foreach (var value in values)
            {
                Assert.AreEqual(value < comparand, exports.Test((int)value, (int)comparand) != 0);
            }
        }
    }
示例#3
0
    public void Float64GreaterThan_Compiled()
    {
        var exports = ComparisonTestBase <double> .CreateInstance(
            new LocalGet(0),
            new LocalGet(1),
            new Float64GreaterThan(),
            new End());

        var values = new[]
        {
            0.0,
            1.0,
            -1.0,
            -Math.PI,
            Math.PI,
            double.NaN,
            double.NegativeInfinity,
            double.PositiveInfinity,
            double.Epsilon,
            -double.Epsilon,
        };

        foreach (var comparand in values)
        {
            foreach (var value in values)
            {
                Assert.AreEqual(comparand > value, exports.Test(comparand, value) != 0);
            }

            foreach (var value in values)
            {
                Assert.AreEqual(value > comparand, exports.Test(value, comparand) != 0);
            }
        }
    }
    public void Int64LessThanSigned_Compiled()
    {
        var exports = ComparisonTestBase <long> .CreateInstance(
            new LocalGet(0),
            new LocalGet(1),
            new Int64LessThanSigned(),
            new End());

        var values = new[]
        {
            -1,
            0,
            1,
            0x00,
            0x0F,
            0xF0,
            0xFF,
            byte.MaxValue,
            short.MinValue,
            short.MaxValue,
            ushort.MaxValue,
            int.MinValue,
            int.MaxValue,
            uint.MaxValue,
            long.MinValue,
            long.MaxValue,
        };

        foreach (var comparand in values)
        {
            foreach (var value in values)
            {
                Assert.AreEqual(comparand < value, exports.Test(comparand, value) != 0);
            }

            foreach (var value in values)
            {
                Assert.AreEqual(value < comparand, exports.Test(value, comparand) != 0);
            }
        }
    }
        public void Int32GreaterThanSigned_Compiled()
        {
            var exports = ComparisonTestBase <int> .CreateInstance(
                new GetLocal(0),
                new GetLocal(1),
                new Int32GreaterThanSigned(),
                new End());

            var values = new int[]
            {
                -1,
                0,
                1,
                0x00,
                0x0F,
                0xF0,
                0xFF,
                byte.MaxValue,
                short.MinValue,
                short.MaxValue,
                ushort.MaxValue,
                int.MinValue,
                int.MaxValue,
            };

            foreach (var comparand in values)
            {
                foreach (var value in values)
                {
                    Assert.AreEqual(comparand > value, exports.Test(comparand, value) != 0);
                }

                foreach (var value in values)
                {
                    Assert.AreEqual(value > comparand, exports.Test(value, comparand) != 0);
                }
            }
        }
示例#6
0
        public void Int32NotEqual_Compiled()
        {
            var exports = ComparisonTestBase <int> .CreateInstance(
                new GetLocal(0),
                new GetLocal(1),
                new Int32NotEqual(),
                new End());

            var values = Samples.Int32;

            foreach (var comparand in values)
            {
                foreach (var value in values)
                {
                    Assert.AreEqual(comparand != value, exports.Test(comparand, value) != 0);
                }

                foreach (var value in values)
                {
                    Assert.AreEqual(value != comparand, exports.Test(value, comparand) != 0);
                }
            }
        }
示例#7
0
        public void Float32NotEqual_Compiled()
        {
            var exports = ComparisonTestBase <float> .CreateInstance(
                new LocalGet(0),
                new LocalGet(1),
                new Float32NotEqual(),
                new End());

            var values = Samples.Single;

            foreach (var comparand in values)
            {
                foreach (var value in values)
                {
                    Assert.AreEqual(comparand != value, exports.Test(comparand, value) != 0);
                }

                foreach (var value in values)
                {
                    Assert.AreEqual(value != comparand, exports.Test(value, comparand) != 0);
                }
            }
        }
        public void Int64LessThanOrEqualUnsigned_Compiled()
        {
            var exports = ComparisonTestBase <long> .CreateInstance(
                new GetLocal(0),
                new GetLocal(1),
                new Int64LessThanOrEqualUnsigned(),
                new End());

            var values = new ulong[]
            {
                0,
                1,
                0x00,
                0x0F,
                0xF0,
                0xFF,
                byte.MaxValue,
                ushort.MaxValue,
                int.MaxValue,
                uint.MaxValue,
                long.MaxValue,
                ulong.MaxValue,
            };

            foreach (var comparand in values)
            {
                foreach (var value in values)
                {
                    Assert.AreEqual(comparand <= value, exports.Test((long)comparand, (long)value) != 0);
                }

                foreach (var value in values)
                {
                    Assert.AreEqual(value <= comparand, exports.Test((long)value, (long)comparand) != 0);
                }
            }
        }